Back to projects

Cloud · Engineering case study

Supply Chain Digital Twin

AI-assisted route recommendations and asynchronous what-if simulations for complex supply chain networks.

Next.jsFastAPISupabaseAWS
Illustrative architecture
Web · ECSAPI · ECSDomain servicesLambda · S3Data · SupabaseAWSOBSERVEPostgRESTdocsjobsKPIslogslogsmigrationsNext.jsMonorepo · DockerAmazon ECSFastAPIAmazon ECSJWT · RBAC · SSONetworksRoutes · scenariosRoute agentAI recommendationsAmazon SQSSimulation jobsAmazon S3DocumentsCost modelsFreight · expediteSLA · capacitySimulation λAWS Lambdawhat-if workersSupabasePostgREST APIPostgreSQLCloudWatchLogs · metricsAlembicSchema migrations

01

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.

02

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.

03

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.
04

Outcome

Enabled route recommendations, what-if analysis, and permission-controlled network and simulation workflows.

Testimonials

Voices from collaboration.