Monorepo layout

trexi/
├─ apps/
│  ├─ frontend/   Next.js 16 (App Router) + React 19 + React Compiler + TS + Clerk
│  ├─ backend/    Express 5 + TypeScript (tsx) + Drizzle ORM + Clerk
│  └─ landing/    Marketing site (trexi.ai)
├─ docs/          This documentation site (Mintlify)
├─ docker-compose.yml    Local Postgres 16 (service: postgres)
├─ turbo.json            Turborepo task graph
└─ pnpm-workspace.yaml   workspaces = apps/*
Package manager: pnpm (workspaces). Orchestration: Turborepo.

Stack

  • Frontend — Next.js 16 (App Router), React 19 with the React Compiler enabled, TypeScript, Clerk for auth.
  • Backend — Express 5 on tsx, Drizzle ORM against Postgres 16, Clerk for auth (@clerk/express).
  • Database — Postgres 16. The schema is intentionally minimal: Clerk is the source of truth for users and orgs, and Postgres mirrors only what domain tables need to reference.
The React Compiler is enabled (reactCompiler: true in next.config.ts). It auto-memoizes — do not add useMemo, useCallback, or React.memo by hand unless profiling proves a need.

Data flow

The frontend is a thin dashboard that talks to the Express backend over HTTP (NEXT_PUBLIC_API_URL). The backend owns ATS logic, persistence, and the integration points (CLI / MCP) that agents drive. Auth tokens flow from Clerk on both sides.