Architecture¶
Changemaker Lite uses a dual-API architecture with a shared PostgreSQL database.
Under Construction
Detailed architecture documentation is being written. Check back soon.
System Overview¶
Browser ──► Nginx (reverse proxy) ──┬──► Express API (port 4000) ──► PostgreSQL
├──► Fastify Media API (port 4100) ──┘
├──► React Admin GUI (port 3000)
└──► MkDocs / Other Services
Key Components¶
| Component | Technology | Role |
|---|---|---|
| Main API | Express.js + Prisma | Auth, campaigns, map, shifts, pages |
| Media API | Fastify + Prisma | Video library, analytics, uploads |
| Admin GUI | React + Ant Design | Single-page admin application |
| Database | PostgreSQL 16 | Shared by both APIs (30+ tables) |
| Cache | Redis | Rate limiting, job queues, geocoding |
| Proxy | Nginx | Subdomain routing, security headers |
Authentication Flow¶
- JWT access tokens (15 min) + refresh tokens (7 days)
- Refresh token rotation with atomic database transaction
- Role-based access control (5 roles)
- Rate limiting on auth endpoints (10/min per IP)