What you are building
A chat assistant for a shop's stock manager. Ask it “Should I reorder SKU002?” and it looks up live stock in a database, runs the reorder calculation, and answers in plain English: “Yes, order 55 units now.”
Under the hood it is the most common shape of AI product being built today: a chat page talks to an API, which runs an AI agent (LangChain with an OpenAI model) that calls tools to read company data. Learn to deploy this one properly and you can deploy an HR assistant, an IT helpdesk bot or a sales copilot the same way.
On AWS it runs as two containers on ECS Fargate, behind a load balancer, inside a private network, with its database on EFS and its keys in Parameter Store. All of it is described in one CloudFormation file. If those words mean nothing yet, that is exactly what Part 1 is for.
The route through this guide
Follow the parts in order. Each one ends where the next begins.
Understand the system
How the agent decides which tools to use, the reorder maths, a tour of every code file, and every AWS service explained with an analogy, its role in this project and a real-world use. Includes an interactive walk-through of one request, a cost calculator and a quiz.
About 75 minutes of reading. No AWS account needed yet.
Deploy by hand
Eleven commands from an empty AWS account to a public URL. For each one: what it does, what every flag means, what you should see, and what to do if it fails. Then prove the database survives a restart, and delete everything with proof that nothing is left.
About 45 minutes, 8 of them waiting for AWS.
Automate with GitHub Actions
Turn the manual steps into a pipeline that deploys on every push to main, logs in to AWS without any stored password, tests the live page, and comes with a safe one-click teardown.
About 40 minutes. Needs Part 2 done once.
Before you begin
- An AWS account with an IAM user that has administrator access and a CLI access key. Not the root login.
- An OpenAI API key on a project with billing enabled and a monthly spend limit set.
- On your laptop: AWS CLI version 2, Docker Desktop, and a bash shell (macOS and Linux have one; on Windows use WSL or Git Bash).
- For Part 3: a GitHub account.
If you have seen the Azure version
This guide is a port of an earlier Azure Container Apps deployment of the same app. The app logic is unchanged. What differs:
- The language model moved from Groq (Llama 3.3) to OpenAI (
gpt-4o-miniby default, configurable). - About ten Azure CLI commands, including a hand-written REST call to attach the disk, became one CloudFormation template deployed with one command.
- Images are pulled with an IAM role instead of a registry admin password.
- Two latent bugs were fixed: the disk now mounts at
/app/dataso it no longer hidesschema.sql, and the health check no longer depends oncurl, which the image does not contain.
Part 1 has a full side-by-side comparison and explains why each difference matters.
For instructors
- Part 1 works as pre-reading or as the lecture itself. The request stepper and the cost calculator are designed to be driven live on a projector.
- Part 2 is the lab. It ends with a two-hour session plan, a pre-class checklist, and a troubleshooting method you can teach as a skill in its own right.
- Part 3 works as a live demo (edit one line on GitHub, watch it deploy) or as homework with five graded-difficulty exercises.
- Look for the dashed Teaching tip boxes: they mark the moments that land best in a classroom.
- Every page is a single file that works offline, prints cleanly (Ctrl+P or Cmd+P), and has a dark mode for screens.