Nexus is a TypeScript monorepo for an authenticated LLM product. It currently contains a Hono modular-monolith API, a Next.js web application, and a shared PostgreSQL/Drizzle package.
The implemented vertical slice covers phone OTP authentication, cookie and Bearer sessions, current-user lookup, free-plan assignment, entitlement and quota enforcement, OpenAI-backed streaming LLM generation, durable request records, and normalized usage accounting. The browser UI supports OTP login, session revocation, and an authenticated streaming generation workspace.
apps/api Hono API and business modules
apps/web Next.js browser application
packages/database PostgreSQL connection and migration runner
docs/ Architecture, module, contract, and development documentation
The API follows router -> service -> repo. Business modules live in
apps/api/src/modules/{auth,users,billing,llm}, and cross-module calls go through each module's
index.ts.
The domain flow is implemented and exercised through unit, HTTP, module integration, and web
component tests. In development, the default API entry point composes the complete local runtime
with in-memory SMS/email inboxes and a deterministic LLM provider. Setting OPENAI_API_KEY selects
the OpenAI Responses adapter; OPENAI_MODEL controls the provider model. Deployment composition
remains deferred.
See project status for the implementation matrix and known gaps.
Prerequisites are Node.js 24, pnpm 10.14, and Docker with Compose.
pnpm install --frozen-lockfile
cp .env.example .env
pnpm docker:up
pnpm db:migrate
pnpm check
pnpm typecheck
pnpm test
pnpm buildFor service URLs, environment handling, focused test commands, and the current runtime limitation, read local development.