High-performance REST and query connector exposing Hyle datasets and schemas over HTTP in plain C. Canonical header is <ttypt/axil-hyle.h>.
git clone https://github.com/tty-pt/axil-hyleDocumentation
axil-hyle
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
| Method | Endpoint | Auth / CSRF | Description |
|---|---|---|---|
GET | /api/dataset/:id | Public / Session | Execute query over dataset :id (filter, sort, search, page) |
GET | /api/dataset/:id/:item_id | Public / Session | Retrieve single record by primary key |
POST | /api/dataset/:id | Required | Create new record with schema validation |
PUT | /api/dataset/:id/:item_id | Required | Update existing record fields |
DELETE | /api/dataset/:id/:item_id | Required | Delete record by primary key |
GET | /api/schema/:id | Public | Return 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
axilrequest dispatch viaaxil_register_handler()mounted duringxy_install(). - Query & Schema Engine: Delegates queries to
libhyle, leveraging liblemma for accent-preserving full-text search (pão ≠ pao). - Persistence Layer: Backed by
libhyle-sourcestorage drivers (store_fsfilesystem 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 viaaxil_hyle_set_item_read_filter(axil_hyle_item_read_filter_fn fn, void *user_data)(<ttypt/axil-hyle.h>) to enforce visibility onGET /api/dataset/:id(filtering results) andGET /api/dataset/:id/:item_id(returning401anonymously or403when 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.