Stock across many branches has to stay consistent in real time, large Excel imports must land without choking the system, and the whole thing has to run on an AWS budget of zero.
The goal of StockFlow Cloud was to manage stock levels and inter-branch transfers in real time, and to automate the Excel stock-in process end to end.
The naive version puts everything behind one API: upload the file, parse it in the request, write it to the database. That works for a hundred rows. At tens of thousands it ties up the API, times out, and a single network blip halfway through leaves stock counted twice.
The first version was a hybrid: NestJS on ECS Fargate behind an ALB, with Aurora in a private VPC. Aurora already scaled to zero, but being in a VPC dragged in a NAT Gateway, the ALB and Fargate, all billed by the hour. The system could only be stood up briefly and destroyed. So it was rebuilt fully serverless (ADR-001): Neon Postgres over TLS, Lambdas outside any VPC, and the API itself on Lambda.



