Skip to main content

Week 2 — Deployment & APIs

Now that you have a solid development environment, it is time to build APIs and deploy them. This week covers the full lifecycle: writing a FastAPI application, containerizing it with Docker, and deploying to cloud platforms. You will also learn about cross-origin requests, authentication, and HuggingFace Spaces.

Overview

In this week, you will build a REST API with FastAPI, package it in a Docker container, and deploy it to multiple cloud platforms. You will understand how web applications communicate, handle authentication, and serve ML models to end users.

Pages

#PageTopic
1FastAPIRoutes, params, middleware, OpenAPI docs
2DockerDockerfiles, multi-stage builds, compose
3Vercel & RenderServerless deployments
4HuggingFaceSpaces, Gradio apps
5CORS & RESTCross-origin requests, HTTP status codes
6Google AuthOAuth2, service accounts

Learning Outcomes

By the end of this week, you will be able to:

  • Build REST APIs with FastAPI including path parameters, query parameters, and request bodies
  • Write Dockerfiles with multi-stage builds for optimized production images
  • Deploy applications to Vercel (serverless) and Render (containerized)
  • Create interactive ML demos on HuggingFace Spaces with Gradio
  • Understand and configure CORS for cross-origin API access
  • Implement Google OAuth2 authentication and use service accounts for API access
Time estimate

Expect to spend 7-9 hours on this week's material: ~2 hours reading, ~3 hours on walkthroughs, and ~3 hours on the lab.