CODEX // oaoisme wiki

§ unswayed-backend

Overview — what unswayed-backend is

updated 2026-06-02

unswayed-backend

unswayed-backend is the backend service for unswayed, a RALLi Technologies product, built with NestJS. This section of Codex explains how the backend is built and operated — teaching prose you can read later to understand the system, not a changelog.

Where it is

  • Repo: RALLi-Technologies/unswayed-backend (GitHub); working copy at /root/work/ralli_backend on this box.
  • Status: active. On top of the NestJS scaffold sits a complete email/password authentication foundation — the User model and the register/login/OTP/password-reset/refresh surface — backed by PostgreSQL + Prisma, with a strict, green test toolchain (100% coverage).

The stack

  • NestJS 11 on Node.js 22, TypeScript (strict), Express adapter.
  • PostgreSQL + Prisma 6 for persistence (schema + migrations in prisma/).
  • @nestjs/config + Joi for boot-time-validated configuration.
  • @nestjs/jwt + passport-jwt and argon2 for the auth layer.
  • Jest (transformed by SWC) for unit/integration tests, behind a 90% coverage gate on all four metrics.
  • Jest + supertest for end-to-end tests that boot the real application against a Postgres test database.
  • ESLint (flat config) + Prettier.

How it documents itself

This project is built to be self-describing. Three habits keep it that way:

  1. A single source of truth in the repodocs/ARCHITECTURE.md always reflects the real structure, and AGENTS.md is the operating manual every agent reads first.
  2. Durable memorydocs/ai/memory/ records what was done and why, so no session (or model) starts blind.
  3. This wiki — every feature and change gets a page here explaining how it works and why.

See Authentication (the first real feature), The NestJS scaffold (how the app is laid out and how to extend it), and The agent operating model.

Features

The authoritative feature list lives in the repo at docs/FEATURES.md and is mirrored here. Today: the operating structure itself, the NestJS application baseline, repo governance (protected branches / PR-only), and the authentication foundation. Next up: social login and a master-data module (countries/states/cities/…), which registration will depend on for foreign- key validation.