Tech Stack
Architecture
Data Flow
- 1
Admin manages customers, workers, and services through the React SPA dashboard
- 2
React SPA communicates with Fastify REST API via Axios with JWT authentication
- 3
Fastify routes validate requests with JSON schemas and delegate to service layer
- 4
Prisma ORM queries PostgreSQL with tenant isolation on every operation
- 5
Recurring schedule engine auto-generates work orders based on configurable patterns
- 6
Workers receive jobs via offline-first PWA with IndexedDB cache and sync queue
- 7
Stripe webhooks process SaaS subscriptions and customer payment confirmations
- 8
Resend and Twilio fire-and-forget notifications for invoices and job alerts
Code Patterns
Multi-Tenant Isolation
Every API query filters by tenant_id extracted from the JWT. Prisma middleware enforces row-level isolation, and response serializers strip sensitive fields — ensuring zero data leakage between business accounts.
Offline-First Sync Engine
Service Workers cache job data with 24-hour TTL and 50-item cap. An IndexedDB write queue captures mutations offline, retrying with exponential backoff (3 attempts) when connectivity returns via the online event.
QR + PIN Worker Authentication
Workers scan a unique QR token that identifies them, then set a PIN on first login. Refresh token rotation with reuse detection prevents session hijacking, and account lockout triggers after 5 failed attempts.
System Metrics
What's Next
The next milestone focuses on proof-of-work features: photo evidence capture (before/after photos per job), GPS clock-in verification to confirm workers are on-site, and push notifications so workers receive real-time job alerts without polling the app.
A customer-facing portal will let end customers view their cleaning schedule, accept quotes, request reschedules, and pay invoices — closing the loop between cleaning businesses and their clients.
The platform will also add a lead capture funnel on the landing page with analytics tracking, converting the marketing site from informational to revenue-generating.
Want similar results for your project?