Technical Documentation

System Architecture

The Auto Glass platform is built as a cloud-native microservices architecture designed for high availability, horizontal scalability, and clean separation of domain concerns. Each service owns its data and exposes a well-defined REST API consumed by the API Gateway.

Architecture Principles: Single-responsibility services · Event-driven async communication via Redis Pub/Sub · Zero-trust internal networking · Circuit-breaker pattern on all external API calls · 99.9% SLA target

High-Level System Architecture

The platform is organized into five horizontal layers: Client, API Gateway, Microservices, Data, and External Integrations. Each layer has a distinct responsibility boundary.

Loading diagram…

Technology Stack

LayerTechnologyRationale
Frontend WebNext.js 15, React 19, Tailwind CSSServer-side rendering, edge-optimised delivery, type-safe components
Mobile AppReact Native + Expo SDK 52Single codebase for iOS + Android technician app
API GatewayKong Gateway 3.xRate limiting, JWT validation, request logging, plugin ecosystem
Backend ServicesNode.js 22 (LTS), Go 1.23Node for I/O-heavy services; Go for Dispatch Engine requiring high concurrency
Primary DatabasePostgreSQL 16ACID compliance, JSONB for flexible glass catalog, row-level security
Cache / QueueRedis 7.x (Cluster)Job queues, technician geolocation (Geo commands), session store
TelemetryTimescaleDBTime-series extension of PostgreSQL for GPS tracks and sensor data
Object StorageS3-compatible (AWS / MinIO)Damage photos, calibration certificates, signed invoice PDFs
CDN / EdgeVercel Edge Network, CloudFrontSub-50ms TTFB globally for customer-facing web app
ObservabilityPrometheus + Grafana, Sentry, Datadog APMMetrics, alerting, distributed tracing, error tracking

Deployment Pipeline

Code travels from a developer's local machine through automated CI/CD gating before reaching production. A mandatory manual approval gate protects the production namespace.

Loading diagram…

Service Communication Patterns

Synchronous (Request/Response)

  • All client-to-service calls via HTTPS REST through the API Gateway
  • Service-to-service calls within the same request lifecycle use internal HTTP with mTLS

Asynchronous (Event-Driven)

  • BookingCreated → Dispatch Engine picks up and assigns nearest technician
  • JobCompleted → Invoice Service auto-generates PDF → Notification Service sends SMS/email
  • PaymentSucceeded → Inventory Service decrements parts stock
  • ClaimSubmitted → Insurance EDI Service queues 837P electronic claim

Scalability & Resilience

ConcernStrategy
Horizontal scalingAll services are stateless; deployed as K8s Deployments with HPA (Horizontal Pod Autoscaler)
Database read scalingTwo read replicas behind PgBouncer connection pool; writes to primary only
Cache warmingNAGS glass catalog pre-loaded into Redis on startup; TTL 24h with background refresh
Circuit breakerAll external API calls (NHTSA, NAGS, Stripe) wrapped with opossum circuit breaker
FailoverPostgreSQL automatic failover via Patroni; Redis Sentinel for cache failover
DR / RTORecovery Time Objective < 15 min; daily automated snapshots to cross-region S3
Security Note: All internal service-to-service communication uses mTLS with certificates rotated every 30 days via cert-manager. No service is exposed directly to the internet — all traffic must flow through the API Gateway.