[Testdriven.io] Test-Driven Development with FastAPI and Docker

[Testdriven.io] Test-Driven Development with FastAPI and Docker

Register & Get access to index
tdd-fastapi-docker.png


In this course, you'll learn how to build, test, and deploy a text summarization service with Python, FastAPI, and Docker. The service itself will be exposed via a RESTful API and deployed to Heroku with Docker.


What will you learn?​

Part 1 - Foundation and Concepts

In this first part, you'll learn how to develop an async RESTful API with Python, FastAPI, and Postgres. You'll containerize FastAPI and Postgres to run inside Docker containers and configure pytest in order to practice Test-Driven Development (TDD).

Learning Objectives​

  1. Develop an asynchronous RESTful API with Python and FastAPI
  2. Practice Test-Driven Development
  3. Test a FastAPI app with pytest
  4. Interact with a Postgres database asynchronously
  5. Containerize FastAPI and Postgres inside a Docker container
  6. Run unit and integration tests with code coverage
  7. Check your code for any code quality issues via a linter

Part 2 - Deployment, Testing, and Best Practices

In the second part, you'll start by deploying FastAPI, Gunicorn, Uvicorn, and Postgres to Heroku with Docker. You'll then continue to build out the RESTful API as you write unit and integration tests. Finally, we'll develop a text summarization service to produce article summaries from a given URL.

Learning Objectives​

  1. Configure GitHub Actions for continuous integration and deployment
  2. Use GitHub Packages to store Docker Images
  3. Speed up a Docker-based CI build with Docker Cache
  4. Deploy FastAPI, Uvicorn, and Postgres to Heroku with Docker
  5. Parameterize test functions and mock functionality in tests with pytest
  6. Run tests in parallel with pytest-xdist
  7. Document a RESTful API with Swagger/OpenAPI
  8. Run a background process outside the request/response flow

What do you need to know?​

This is not a beginner course. It's designed for the advanced-beginner -- someone with at least six months of web development experience. Before beginning, you should have some familiarity with the following topics.
  • Docker and Docker Compose
  • FastAPI

Meet the Author​

Michael Herman​

Michael is a software engineer and educator who lives and works in the Denver/Boulder area. He is the co-founder/author of Real Python. Besides development, he enjoys building financial models, tech writing, content marketing, and teaching.
Author
etherusb
Downloads
455
Views
2,709
First release
Last update
Rating
5.00 star(s) 2 ratings

More resources from etherusb

Latest reviews

thank you!
please up more testdriven.io courses if you have them. thx very much!