Skip to content

CloudBytesCollection/serverless-python-dev

Repository files navigation

serverless-python-dev

Building Serverless Python Apps on AWS

Companion code for Building Serverless Python Apps on AWS (Cloud Bytes Collection). Clone this repo and open the project that matches the chapter you are on.

Which project should I use?

Folder When to use it
sample-fastapi-graphql-starter-project Chapter 2 — FastAPI + Strawberry starter (hello_world, local GraphQL)
sample-fastapi-graphql-book-api Chapters 3–8 — Books/reviews API, MongoDB, Docker, CDK/Fargate, CI/CD
sample-fastapi-graphql-book-api-mcp Chapter 9 — Same API with MCP tools (fastapi-mcp, REST routes exposed to agents)

Each folder has its own README with environment variables, Docker notes, and deploy steps.

Prerequisites

  • Python 3.12 (see each project’s .python-version)
  • uv for installs (uv sync in each project directory)
  • Docker (for MongoDB and container builds in the book API projects)
  • AWS CDK CLI >= 2.1124.1 when you reach the deploy chapters

Quick start

Chapter 2 starter

cd sample-fastapi-graphql-starter-project
uv sync --all-groups
uv run pytest tests
uv run python main.py

Open GraphiQL at http://127.0.0.1:8000/graph (see that project’s README).

Book API (main example)

cd sample-fastapi-graphql-book-api
uv sync --all-groups
docker compose up mongo   # in another terminal
uv run pytest tests
uv run uvicorn main:app --reload

Copy or create a .env file using the variables listed in sample-fastapi-graphql-book-api/README.MD.

Book API + MCP (Chapter 9)

cd sample-fastapi-graphql-book-api-mcp
uv sync --all-groups
docker compose up mongo
uv run uvicorn main:app --reload

See sample-fastapi-graphql-book-api-mcp/README.MD for MCP Inspector setup.

Related repos

The Node.js book in this series uses a different repository: serverless-nodejs-dev (sample-aws-book-api-starter, sample-aws-book-api). Those projects are not part of this Python repo.

License

Each subproject includes its own license file (typically BSD 3-Clause). See the folder you are working in.

About

Building Serverless Python Apps on AWS - Companion Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors