See repository documentation for full architecture. Key stacks include FastAPI-based services, React/Vite frontend, and a static Next.js marketing site. Messaging uses Twilio and SMTP with templated notifications. Authentication via Keycloak. Local development orchestrated with Docker Compose. Event messaging uses Google Pub/Sub (emulated in dev) with custom Consumer and Producer implementations (which can be found at fern-labour-pub-sub linked above).
Fern Labour (legacy)
The original FernLabour.com backend, written in Python on GCP. Replaced by the Cloudflare Workers + Durable Objects rewrite; kept here for reference.
Overview
#saas
#health
#legacy
#TypeScript
#Python
#SQL
#React
#Next.js
#FastAPI
#SQLAlchemy
Repositories
- fern-labour-monorepo monorepo
- fern-labour-pub-sub package
- fern-labour-core package
- fern-labour-notifications-shared package
Components
Marketing Site
frontendTypeScript Β· Next.js
Hosted on Cloudflare β Pages
- Static export for faster load times, easier hosting, and better SEO.
Frontend App
frontendTypeScript Β· React (Vite)
Hosted on Cloudflare β Pages
- Labour tracking application. Supports PWA installation and offline tracking.
Labour Service API
backendPython Β· FastAPI
Hosted on GCP β Cloud Run
- Contraction analysis, subscriber relationships, Stripe
Notification Service
backendPython Β· FastAPI
Hosted on GCP β Cloud Run
- SMS, WhatsApp, Email via Twilio/SMTP
Contact Service
backendPython Β· FastAPI
Hosted on GCP β Cloud Run
- Slack integration and Cloudflare Turnstile
Auth
infraN/A Β· Keycloak
Hosted on GCP β Compute Engine
- OIDC provider for platform
Database
dbSQL Β· PostgreSQL
Hosted on GCP β Cloud SQL
- Sensitive information is encrypted at rest.
Technical Notes
Performance & Security
Load Performance
- Static Next.js marketing site exported and served via Cloudflare Pages for fast global edge delivery.
- React app built with Vite; optimized bundles and route-based code splitting keep the initial payload lean.
- Image assets optimized and lazyβloaded; fonts preloaded; HTTP caching tuned for static assets.
Security
- Authentication handled with Keycloak (OIDC); scoped tokens for services.
- All traffic over HTTPS; backend services isolated on GCP with leastβprivilege service accounts.
- Data stored in Cloud SQL with encryption at rest.
- Security headers can be locked down because the app does not call any non-fernlabour domains.