The NestJS API behind /api/*: it verifies Supabase JWTs and issues RLS-scoped clients per caller.
The server-side API for the app. It authenticates requests against Supabase and talks to the database through Row-Level-Security-scoped clients, never with a service-role key. Architecture and the hard-won constraints are in docs/architecture/backend.md.
Standard Nest module layout: words, user, auth, supabase, config, common.
SupabaseService is the only place Supabase clients are created. Auth is a global AuthGuard
(opt out with @Public()), exposing the caller via @CurrentUser().
- No workspace packages at runtime. It produces artifacts consumed by
@languages-learner/api(OpenAPI schema and database types).
- Consumed over HTTP by
apps/web(via the generated SDK), not imported as a package.
- No
Scope.REQUEST, and never authenticate inside a provider factory — it short-circuits the guard chain (includingThrottlerGuard). Covered bytest/rate-limit.e2e.test.ts. - Env is validated at startup (
src/config/env.validation.ts). - After changing a DTO or handler return type, regenerate the contract:
pnpm --filter app-backend generate:api-schemas— see api-contract.md. database.types.tsis generated (generate-types) and copied intopackages/api; do not edit.
- Scripts, env vars and how to run: README
- Architecture: docs/architecture/backend.md