Overview
Project Zoe is a standard client-server application with a NestJS REST API backend and a React single-page application frontend. Both are TypeScript throughout.Server
The server is a NestJS application organised into feature modules. Each module owns its controllers, services, DTOs, and TypeORM entities.Key infrastructure choices
- TypeORM with PostgreSQL. Schema synchronisation is enabled in
localmode only; all other environments use explicit migration files. - Row-level multi-tenancy — every entity carries a
tenantforeign key, and theTenantHeaderMiddlewareinjects the tenant context on every request. See Multi-Tenancy. - Redis is used as an in-memory cache (1-hour default TTL). The server falls back gracefully when Redis is unavailable in development.
- JWT access + refresh token pair. The
JwtAuthGuardis applied globally; public routes opt out with the@Public()decorator. - WebSocket gateway (
NotificationsGateway) provides real-time notifications to connected clients.
Client
The client is a React 19 + Vite SPA structured into feature modules that mirror the server.- Redux Toolkit — global auth state (current user, token)
- TanStack Query — server state, caching, and background refetching for API calls
- React Router v6 — client-side routing
Data model summary
The core entities and their relationships:Deployment
Both repos follow a two-branch CI/CD model:
The CI pipeline reads a base64-encoded
.env from a GitHub secret and applies it at build/deploy time.