Skip to content

Repository map

Trile is split across four repositories under one workspace. This page orients a new engineer.

RepoStackResponsibility
trileNestJS 11, Drizzle, PostgreSQL 16, Redis 7 + BullMQ, Better AuthThe 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, StorybookThe merchant dashboard (manage business, catalog, subscriptions, keys, webhooks, team).
trile_checkoutReact, Vite, TanStack Router/Query, TailwindThe hosted checkout app a customer uses to top up and subscribe. Backs checkout.trile.app.
trile-landingAstroMarketing site (trile.app).
docsAstro StarlightThis documentation site (docs.trile.app).
trile-landing (marketing) ──▶ trile_checkout (hosted checkout) ──┐
│ HTTP /v1
trile_frontend (dashboard) ─────────────────────────────────────-──┤
trile (backend API)
┌─────────────────┼─────────────────┐
▼ ▼ ▼
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.
PathWhat
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).