Architecture Overview
NHC Portals is a multi-repo project made up of three tightly coupled services:
| Repo | Role | Tech |
|---|---|---|
django-api | REST backend, business logic, async tasks | Django 4.2, DRF, Celery, MySQL, Redis |
portals | Multi-role SPA | React 18, Chakra UI, Vite |
testing | E2E automation | Cypress 13, Cucumber, Turbo monorepo |
High-Level Diagram
Browser
│
▼
portals (React SPA)
│ REST / JWT
▼
django-api (DRF)
├── MySQL ← primary data store
├── Redis ← Celery broker + cache
├── AWS S3 ← file/document storage
├── SendGrid ← transactional email
└── Clearchecks ← background check integrationKey Design Decisions
- Multi-tenant: every resource is scoped to an
Organization. A single deployment serves multiple home care agencies. - Role-based access: five roles —
MASTER,ADMIN,EMPLOYEE,CLIENT,MARKETER— each with distinct portal views and API permissions. - JWT auth:
dj-rest-auth+simplejwtissue access/refresh tokens consumed by the SPA. - Async work: Celery handles PDF generation, email dispatch, and scheduled tasks (via django-celery-beat).
- PDF pipeline: WeasyPrint renders HTML→PDF; pyHanko applies digital signatures.