This document describes how the repository is organized, how major services connect, and where to look in the code for each concern.
SignBank is a monorepo with a Quasar (Vue 3) frontend, a NestJS API, PostgreSQL for persistence, Typesense for search, NGINX as reverse proxy/TLS termination, and dufs for serving uploaded files. Orchestration is done with Docker Compose (local, test, and production variants at the repo root).
flowchart LR
subgraph client [Browser]
FE[Quasar frontend]
end
NGINX[NGINX]
API[NestJS backend]
DB[(PostgreSQL)]
TS[Typesense]
FS[dufs / file volume]
FE --> NGINX
NGINX --> API
NGINX --> FS
API --> DB
API --> TS
API --> FS
- Frontend talks to the API over HTTP (Axios); search uses the backend’s search endpoints, which query Typesense.
- Backend owns business rules, authentication (JWT), Prisma/PostgreSQL data, and indexing/sync with Typesense.
- Videos and static uploads are stored on disk and exposed via dufs (see
DUFS_URL/ compose configuration).
For environment variables, compose files, and first-time DB setup, see the root README.md.
| Path | Role |
|---|---|
frontend/ |
Quasar SPA: search UI, gloss detail, requests workflow, admin screens |
backend/ |
NestJS API, Prisma schema & migrations, scheduled jobs (e.g. backup) |
nginx/ |
Reverse proxy config and TLS cert mount points |
typesense/ |
Typesense data directory (volume) |
docker-compose-local.yaml |
Local dev stack |
docker-compose-production.yaml |
Production-oriented stack |
docker-compose-test.yaml |
Test stack |
schema.env |
Example env template (copy to .env at root) |
src/main.ts— Bootstraps NestJS, enables CORS againstBASE_URL, registers globalValidationPipe, listens onPORT.src/app.module.ts— Root module: wires feature modules andScheduleModulefor cron-style tasks.
Each domain typically has *.module.ts, *.controller.ts, and *.service.ts under src/<feature>/:
| Module | Responsibility |
|---|---|
AuthModule |
Login, register, JWT refresh, profile |
UsersModule |
User listing and admin operations (roles, passwords) |
PrismaModule |
Database client |
GlossesModule / GlossDataModule |
Published gloss identity and rich gloss payload (senses, definitions, examples, relations, minimal pairs, videos) |
GlossRequestsModule |
Workflow for proposed entries: draft → submit → accept/decline |
VideosModule / SignVideosModule |
Upload and sign-video records |
SearchModule |
Search API backed by Typesense |
TypesenseModule |
Collection init/sync/status |
SensesModule, DefinitionsModule, ExamplesModule, TranslationsModule, ExampleTranslationsModule |
CRUD slices used by gloss editing |
BackupModule |
Scheduled DB backup logic (see src/backup/) |
HTTP route inventory and auth notes: backend/README.md.
prisma/schema.prisma— Single source of truth for tables, enums (roles, request status, phonology enums, lexical categories, relation types, etc.), and relations.prisma/migrations/— Schema history.
Dockerfile.local/Dockerfile.prod— Image builds; entry scripts may run migrations before start (seedocker-entrypoint.sh).
src/router/routes.ts— Declares all top-level paths and which page component loads.src/router/index.ts— Vue Router factory (history mode follows Quasar env).
Main routes:
/and/search→ search/gloss/:gloss→ published gloss detail/my-requests(+create,edit/:id,view/:id) → contributor request workflow/confirm-requests(+review/:id) → admin review queue/user-management→ admin users
Layout: src/layouts/MainLayout.vue wraps pages with HeaderComponent (drawer nav, login/logout).
src/boot/axios.ts— API base URL and interceptors for authenticated calls.src/boot/auth.ts— Auth-related startup if present.src/boot/i18n.ts— i18n setup.
src/stores/user.store.ts— Current user, JWT tokens,isAdmin/isLoggedIn.src/services/api.ts— Typed wrappers around REST endpoints.src/services/search.service.ts— Search query helpers.
- `src/pages/`` — One primary screen per route (search, gloss, requests, admin).
src/components/GlossDetail/— Large gloss “document” UI: header, senses, definitions, examples, videos, phonology, related glosses, minimal pairs.src/components/Search/— Search bar, filters, result cards, phonology filters.src/components/UserManagement/— Admin user table and dialogs.src/i18n/— Locale bundles (e.g.en-US,ca-ES,es-ES).
Cross-cutting: src/types/ (models, API DTOs, enums), src/utils/ (validation, phonology options, URLs), src/composables/, src/hooks/useAuthentication.ts.
More detail: frontend/README.md.
| Concern | Where it lives |
|---|---|
| Authentication | Backend AuthModule; frontend useAuthentication, user.store, Axios |
| Authorization | Backend guards (per-route); UI hides admin items in HeaderComponent (isAdmin) |
| Search index | TypesenseModule + Typesense container; frontend uses search API |
| File uploads | Backend video upload endpoints; files served via dufs |
| Scheduled backups | Docker db-backup service (Postgres dumps) + optional BackupModule in API |
| CI / release | .github/workflows/ |
- Product and user guide — What the app is for and how people use it.
- Phase 2 feature ideas — Possible future enhancements.
- Backend API & DB diagram
- Frontend file map