Skip to content

Servers

API Reference: Engine · Types · Config Registry · Placement · Lightbox · Lens · Embeds · Coordinators · Storage · Events · Security · This Page

11 server examples implementing the same REST API contract. Swap backends without code changes — clients (editors, web apps, RemoteStore) work with any of them.

Live version: https://docs.alap.info/api-reference/servers

API contract

All servers implement the same REST contract, documented below. Machine-readable version: openapi.yaml.

All servers expose 7 endpoints:

GET    /configs              → ["demo", "work-links", ...]
GET    /configs/:name        → { config: AlapConfig, meta: { createdAt, updatedAt } }
PUT    /configs/:name        → body is AlapConfig JSON → 204
DELETE /configs/:name        → 204
GET    /search               → cross-config search
POST   /cherry-pick          → { source, expression } → { allLinks }
POST   /query                → { expression, configName?, configs? } → { results }

Search query parameters

ParamDescription
tagMatch links with this tag
qCase-insensitive substring match across fields
regexRegex match across fields
fieldsComma-separated: label,url,tags,description,id (default: all)
configRegex pattern to filter config names
limitMax results (default 100, max 1000)

Cherry-pick and query

These endpoints resolve Alap expressions server-side. Node/Bun servers use AlapEngine from alap/core. Python, PHP, Go, Rust, Ruby, and Java servers use native ports of the expression parser. All servers sanitize URLs in responses.

Server matrix

ServerLanguageFrameworkDatabaseDependencies
Express + SQLiteNode.jsExpressSQLite3
Hono + SQLiteNode.jsHonoSQLite3
Bun + SQLiteTypeScriptBun built-inSQLite0
Laravel + SQLitePHPLaravel 12SQLiteComposer
Flask + SQLitePythonFlaskSQLite2
Django + SQLitePythonDjango 5.1SQLite2
FastAPI + PostgreSQLPythonFastAPIPostgreSQL4
Gin + SQLiteGoGinSQLite3
Axum + SQLiteRustAxumSQLite4
Spring Boot + SQLiteJava 21Spring Boot 3.4SQLite3

All servers default to port 3000. All include Dockerfiles (Podman-compatible).

Quick start

Node servers (pre-built library tarball)

bash
pnpm docker:express   # or docker:bun, docker:hono
podman run -p 3000:3000 alap-express
# → http://localhost:3000

Other languages (self-contained Dockerfiles)

bash
# Python
podman build -t alap-flask -f flask-sqlite/Dockerfile examples/servers/
podman run -p 3000:3000 alap-flask

# Go
podman build -t alap-gin -f examples/servers/gin-sqlite/Dockerfile .
podman run -p 3000:3000 alap-gin

# Rust
podman build -t alap-axum -f examples/servers/axum-sqlite/Dockerfile .
podman run -p 3000:3000 alap-axum

# Java
podman build -t alap-java-spring -f examples/servers/java-spring/Dockerfile .
podman run -p 3000:3000 alap-java-spring

# PHP
podman build -t alap-laravel examples/servers/laravel-sqlite/
podman run -p 3000:3000 alap-laravel

FastAPI + PostgreSQL

bash
cd examples/servers/fastapi-postgres
podman compose up
# → http://localhost:3000

Local development (without Docker)

bash
cd examples/servers/express-sqlite
npm install
node seed.js
node server.js
# → http://localhost:3000

Using with RemoteStore

typescript
import { createRemoteStore } from 'alap/storage';

const store = createRemoteStore({ baseUrl: 'http://localhost:3000' });
const config = await store.load('demo');

Any of the 11 servers works as the backend. Pick the language and framework that fits your stack.