Trile is split across four repositories under one workspace. This page orients a new engineer.
Repo Stack Responsibility trileNestJS 11, Drizzle, PostgreSQL 16, Redis 7 + BullMQ, Better Auth The backend. Serves the /v1 API and runs the billing/worker/scheduler processes. Source of truth for the OpenAPI spec. trile_frontendReact, Vite, TanStack Router/Query, Tailwind, Storybook The merchant dashboard (manage business, catalog, subscriptions, keys, webhooks, team). trile_checkoutReact, Vite, TanStack Router/Query, Tailwind The hosted checkout app a customer uses to top up and subscribe. Backs checkout.trile.app. trile-landingAstro Marketing site (trile.app). docsAstro Starlight This documentation site (docs.trile.app).
trile-landing (marketing) ──▶ trile_checkout (hosted checkout) ──┐
trile_frontend (dashboard) ─────────────────────────────────────-──┤
┌─────────────────┼─────────────────┐
PostgreSQL Redis providers
(BullMQ) (eSewa/Khalti/IME)
Both frontends consume the backend’s OpenAPI spec to generate a typed client:
npm run api:generate runs openapi-typescript against the backend’s /docs-json.
This docs site consumes the same /docs-json for its API Reference — see
Local development .
Path What src/main.tsBootstrap; selects the process role. src/app.module.tsRoot module wiring. src/modules/*One folder per bounded context (wallet, billing, subscriptions, catalog, checkout, webhooks, customers, events, merchant, team, security, auth, payment, …). src/shared/money.tsThe Money value object. src/shared/ids.tsPrefixed ULID generation. src/common/idempotency/The idempotency interceptor + store. src/auth/Better Auth configuration (3 auth modes). docs/runbooks/Operational runbooks (also summarized here ).