v1.2.0HTTP ConnectorBSD-2-Clause

High-performance REST and query connector exposing Hyle datasets and schemas over HTTP in plain C. Canonical header is <ttypt/axil-hyle.h>.

GitHub
git clone https://github.com/tty-pt/axil-hyle

axil-hyle logo

axil-hyle

C99 BSD-2-Clause REST Engine axil—hyle bridge

High-performance REST and query connector exposing Hyle datasets and schemas over HTTP in plain C. Canonical header is <ttypt/axil-hyle.h>.

axil-hyle bridges axil HTTP routing with libhyle schemas and libhyle-source storage drivers, turning registered C schemas into paginated REST APIs with full-text search and validation.


1. Quickstart: Run the REST Service

Start the Axil daemon with the axil-hyle module loaded:

axil -d -p 8080 -m libaxil-hyle

Verified curl Queries

# 1. Full-text search and pagination over dataset:
curl -s "http://localhost:8080/api/dataset/song?q=love&sort=year&order=desc&limit=10"

# 2. Fetch a single record:
curl -s "http://localhost:8080/api/dataset/song/song_1"

# 3. Introspect schema:
curl -s "http://localhost:8080/api/schema/song"

2. REST API Reference

MethodEndpointAuth / CSRFDescription
GET/api/dataset/:idPublic / SessionExecute query over dataset :id (filter, sort, search, page)
GET/api/dataset/:id/:item_idPublic / SessionRetrieve single record by primary key
POST/api/dataset/:idRequiredCreate new record with schema validation
PUT/api/dataset/:id/:item_idRequiredUpdate existing record fields
DELETE/api/dataset/:id/:item_idRequiredDelete record by primary key
GET/api/schema/:idPublicReturn JSON schema descriptor for dynamic UI generation

Query Parameter Grammar

  • q=<search>: Full-text substring search across all searchable string fields.
  • filter_<field>=<val>: Exact equality filter on specific field.
  • sort=<field>&order=asc|desc: Sort results by field.
  • limit=<n>&page=<n>: 1-based pagination parameters.

3. Architecture & Ecosystem Context

  • HTTP Routing: Hooks into axil request dispatch via axil_register_handler() mounted during xy_install().
  • Query & Schema Engine: Delegates queries to libhyle, leveraging liblemma for accent-preserving full-text search (pão ≠ pao).
  • Persistence Layer: Backed by libhyle-source storage drivers (store_fs filesystem stores or in-memory volatile tables).
  • Authentication, CSRF & Per-Item Read Filtering: Integrates seamlessly with axil-auth for session cookie verification (QSESSION) and CSRF token protection on mutative endpoints. Applications can register a fail-closed per-item read filter via axil_hyle_set_item_read_filter(axil_hyle_item_read_filter_fn fn, void *user_data) (<ttypt/axil-hyle.h>) to enforce visibility on GET /api/dataset/:id (filtering results) and GET /api/dataset/:id/:item_id (returning 401 anonymously or 403 when authenticated without access).

4. Installation & Build

Prebuilt Packages

Prebuilt packages are distributed on tty.pt for Linux (APT / Alpine / Arch / Fedora-RHEL), macOS (Homebrew), Windows (winget / MSYS2), OpenBSD, and mobile static sysroots for Android (https://tty.pt/android/ — arm64-v8a, armeabi-v7a, x86_64) and iOS (https://tty.pt/ios/ — libaxil-hyle.xcframework). Follow the installation instructions and use axil-hyle as the package name.

NPM Package (@tty-pt/axil-hyle)

npm config set @tty-pt:registry https://tty.pt/npm/
npm install @tty-pt/axil-hyle

Build from Source

Builds use shared libstele rules (include ttypt/include.mk, JSON parsing via stl_json):

make                  # builds lib/libaxil-hyle.so
make test             # run verification tests
sudo make install     # install headers and library to system

License

BSD 2-Clause License. Copyright (c) 2026, tty-pt. See LICENSE.

Maintained by:tty-pt