- AllCodex Portal (Web Frontend)
- AllKnower (AI Orchestrator & RAG Engine)
- AllCodex Core (Headless Lore Database)
Service Inventory
| Service | Stack | Port | Primary Responsibility |
|---|---|---|---|
| AllCodex Portal | Next.js 16, React 19, Bun, Tailwind CSS 4 | 3000 | The user interface. Serves the grimoire web UI, manages local state, and proxies all API requests server-side. |
| AllKnower | Elysia, Bun, Prisma (Postgres), LanceDB | 3001 | The AI brain. Handles OpenRouter models, stores vector embeddings, manages background dump processing, and hosts analytics. |
| AllCodex Core | Node.js, Express 5, SQLite | 8080 | The database. A customized, headless fork of the Trilium note-taking application. Stores all nodes, attributes, and relations, and renders public share pages. |
Communication & Data Flow
To ensure high security, the browser never communicates directly with the database (Core) or the AI brain (AllKnower). The Portal acts as a strict BFF (Backend-for-Frontend) proxy.Security Boundary
- No Client Tokens: AllCodex Core external API (ETAPI) tokens and AllKnower authorization Bearer tokens are kept strictly server-side.
- HTTP-only Cookies: The Portal resolves user sessions from HTTP-only cookies (
allknower_tokenandallknower_url). Browser-based JavaScript cannot read these cookies, eliminating token theft vectors. - Unidirectional Database Writes:
- The user writes directly to Core via Portal proxy (when editing notes manually).
- The user triggers AI jobs (like Brain Dump) via Portal. AllKnower computes the changes and writes them to Core via the secure Core ETAPI interface.
- Core never makes outbound calls to AllKnower or the Portal.
Auth & Bootstrap Sequence (Auto-Provisioning)
To make self-hosting painless, AllCodex includes a zero-login bootstrap chain:Core Startup
On startup, AllCodex Core reads the
ALLCODEX_PASSWORD environment variable and auto-configures its administrator password.AllKnower Startup
AllKnower checks if a default administrator exists. If not, it creates a default account and runs a loopback authentication call to AllCodex Core using the startup password. It then generates an ETAPI token and stores it as an encrypted
UserIntegration record in its Postgres database.Portal Intercept
When a browser first visits the Portal, Next.js middleware detects that the
allknower_token cookie is missing. It calls AllKnower’s internal /internal/auto-provision route using a shared portal secret, retrieves a session token for the bootstrapped default user, and sets it as an HTTP-only cookie in the user’s browser.