Cloud · Engineering case study
Supply Chain Digital Twin
AI-assisted route recommendations and asynchronous what-if simulations for complex supply chain networks.
The problem & context
A digital twin platform for evaluating supply chain routes, network scenarios, and operational KPIs, built as a Next.js monorepo, a FastAPI backend, and Supabase on AWS.
Architecture
Illustrative view of the digital twin platform. A Next.js monorepo frontend, packaged as a Docker container on Amazon ECS, calls a modular FastAPI backend on Amazon ECS that separates routes, services, schemas, and models and enforces JWT, RBAC, and Azure AD SSO. FastAPI reads and writes networks, routes, and scenarios in Supabase PostgreSQL through its PostgREST API, with Alembic versioning the schema, and saves documents to Amazon S3. An AI route agent recommends optimal routes, while what-if scenarios are queued in Amazon SQS and run by AWS Lambda workers whose cost models price freight, expedite penalties, SLA violations, and capacity utilization before writing KPIs back to Supabase. CloudWatch captures logs and metrics across ECS and Lambda.
Illustrative system view, not a production screenshot.
Implementation & my contribution
- Architected a modular FastAPI backend with routes, services, schemas, and models, deployed on Amazon ECS.
- Built the Next.js monorepo frontend for networks, scenarios, and simulation results, deployed as a Docker container on Amazon ECS.
- Built an AI route-recommendation agent and an asynchronous simulation engine on AWS Lambda workers fed by Amazon SQS.
- Developed cost models for freight, expedite penalties, SLA violations, and capacity utilization.
- Persisted networks, scenarios, and simulation results in Supabase PostgreSQL through its PostgREST API, with Alembic schema migrations, and stored documents in Amazon S3.
- Implemented RBAC, JWT authentication, refresh-token rotation, replay detection, and Azure AD SSO.
- Monitored the FastAPI service on ECS and the Lambda workers with CloudWatch logs and metrics.
Outcome
Enabled route recommendations, what-if analysis, and permission-controlled network and simulation workflows.