Skip to main content

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 local mode only; all other environments use explicit migration files.
  • Row-level multi-tenancy — every entity carries a tenant foreign key, and the TenantHeaderMiddleware injects 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 JwtAuthGuard is 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.
State management:
  • 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.