← Writing

Building a real-time freight risk intelligence SaaS, serverless-first

Yunseop Im · Georgia Tech M.S. Computer Science · Full-stack / backend systems

FreightScaler answers a deceptively simple question: which route exposes my cargo to the least risk? It compares route alternatives not just by travel time but by live weather risk, official NWS alerts, and road-event exposure — with per-segment explanations, saved route watchlists, and a multi-tenant SaaS account layer. This post is the architecture teardown: how a solo engineer takes a product from "Lambda function" to a platform with four documented architectural eras, 24 ADRs, and a live deployment.

Phase 1: the serverless wedge

The product started where most data products should: a route-risk query API on AWS Lambda + DynamoDB, a React/TypeScript frontend on CloudFront, and honest data boundaries. The key product decision was doctrinal, not technical — if a data source is unavailable, the UI says so instead of showing fabricated data. Every downstream trust decision (alerts, thresholds, watchlists) depends on users believing the numbers, so fake-data fallbacks were ruled out by design.

Phase 2–4: when scaling axes diverge, monoliths lose

Each growth phase was triggered by a concrete user demand, and each broke a different axis of the system:

PhaseUser triggerWhat brokeArchitectural response
Route risk queryInitial productNothing yetLambda + DynamoDB, fully serverless
Fleet telemetry"Show my 50 trucks live"~28M GPS events/day, WebSocket fan-outKafka + TimescaleDB hypertable + nginx LB
Freight marketplace"Find a carrier for this corridor"500 concurrent bids, real-time rankingCQRS + optimistic locking + Redis Sorted Set
Settlement"Weather delayed it — who pays?"Multi-step payment across servicesSaga orchestrator + atomic wallet + idempotency

The lesson encoded in ADR-0024: telemetry is write-heavy, tracking is connection-heavy, bidding is contention-heavy, settlement is consistency-heavy. These are different scaling axes — a monolith cannot scale them independently, which is why the platform evolved into services, not because "microservices" was a goal.

The backend decisions that matter

Twenty-four ADRs document the reasoning. The load-bearing ones:

The frontend: density without deception

The React/TypeScript client renders segment-level risk breakdowns — rain, flood, wind, heat, winter — so users see why a corridor scores differently, not just a number. Saved routes live in a private watchlist with per-route monitoring thresholds and manual refresh. A /status page exposes live data-source health, frontend retry/fallback counters, and browser performance snapshots — the operational transparency is part of the product, not an internal tool.

Engineering hygiene as a feature

The repo carries the same discipline the harness blog post describes: GitHub Actions for CI, nightly runs, security scanning (Trivy), Terraform plan/apply separation, promote-to-prod and rollback workflows, CODEOWNERS, dependabot, and a PR template. Deployment is not an afterthought — promote-prod.yml and rollback.yml are first-class pipelines because a solo engineer's safety net is the pipeline.

What I'd do differently / what's next

The honest gaps: billing isn't wired, the marketplace phase is documented more than deployed, and the settlement saga exists as design + foundation rather than a live money path. Those boundaries are deliberate — entitlement and saga contracts landed before the risky parts did.

The through-line across both this project and my agent work is the same: the structure is the product. Whether it's a freight-risk graph or an agent lifecycle, the leverage comes from getting the data model, the failure semantics, and the verification loops right — before adding surface area.

Live demo: d23c97ytqgl4xu.cloudfront.net · Repo: github.com/signalgap9-del/peachtree-dispatch
Related: Running autonomous AI agents safely · profile & projects · LinkedIn