Read-only GraphQL and REST API serving the Geo knowledge graph, governance, versioning, search, and profile data.
The API is a TypeScript service running on Bun with Hono as the HTTP framework. It serves two query paradigms:
- PostGraphile GraphQL (
/graphql) — auto-generated from the PostgreSQL schema - Custom REST endpoints — versioning, governance, profiles, search, IPFS uploads
All data enters through the Rust indexer pipeline (Kafka → indexers → PostgreSQL/OpenSearch). The API reads from PostgreSQL and OpenSearch.
Kafka Topics
|
+-- kg-indexer --------------> PostgreSQL
+-- search-indexer ----------> OpenSearch
+-- actions-indexer ---------> PostgreSQL
+-- scoring-service ---------> PostgreSQL
|
v
+------------------+
| Gaia API |
| (Bun + Hono) |
| |
| /graphql |<-- PostGraphile
| /versioned/* |<-- Temporal entity queries
| /proposals/* |<-- Governance status
| /profile/* |<-- User profiles
| /search/* |<-- OpenSearch proxy
| /ipfs/* |<-- IPFS uploads
| /health/* |<-- K8s probes
+------------------+
docker compose up -dThis starts PostgreSQL on localhost:5432 with user postgres, password postgres, database gaia.
cp .env.example .env
# Edit .env with your values (see .env.example for descriptions)bun install
bun run db:migratebun run startThe API starts on http://localhost:3000 (default).
| Command | Description |
|---|---|
bun run start |
Start the API server |
bun run test |
Run tests (vitest) |
bun run lint |
Lint with Biome |
bun run lint:fix |
Lint and auto-fix |
bun run format |
Format with Biome |
bun run check |
TypeScript type check |
bun run ci |
Format check + lint + type check |
bun run db:generate |
Generate Drizzle migrations |
bun run db:migrate |
Run database migrations |
See .env.example for all environment variables with descriptions.
- API Architecture — layers, tech stack, query patterns
- Database Configuration — PostgreSQL and PgBouncer setup
- Search Query Architecture — OpenSearch query design