Contoso is a company that sells products for various outdoor activities. A marketing department of Contoso would like to launch a micro social media website to promote their products for existing and potential customers.
As a Python developer, you're going to build a Python backend app using FastAPI. For now, you're using the in-memory feature of SQLite.
Refer to the README doc for preparation.
- Check GitHub Copilot Agent Mode
- Prepare Custom Instructions
- Prepare Virtual Environment
- Build FastAPI Backend App
-
Click the GitHub Copilot icon on the top of GitHub Codespace or VS Code and open GitHub Copilot window.
-
If you're asked to login or sign up, do it. It's free of charge.
-
Make sure you're using GitHub Copilot Agent Mode.
-
Select model to either
GPT-4.1orClaude Sonnet 4.
-
Set the environment variable of
$REPOSITORY_ROOT.# bash/zsh REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
# PowerShell $REPOSITORY_ROOT = git rev-parse --show-toplevel
-
Copy custom instructions.
# bash/zsh cp -r $REPOSITORY_ROOT/docs/custom-instructions/python/. \ $REPOSITORY_ROOT/.github/
# PowerShell Copy-Item -Path $REPOSITORY_ROOT/docs/custom-instructions/python/* ` -Destination $REPOSITORY_ROOT/.github/ -Recurse -Force
-
Make sure that you're using GitHub Copilot Agent Mode with the model of
Claude Sonnet 4orGPT-4.1. -
Use prompt like below to prepare virtual environment for Python app development.
I'd like to write a Python application. But before that, I need to set up a virtual environment. Follow the instructions below. - Your working directory is `python`. - Identify all the steps first, which is you're going to do. - Use `.venv` for the virtual environment. - Use `uv` as the Python package manager.
-
Make sure that you're using GitHub Copilot Agent Mode with the model of
Claude Sonnet 4orGPT-4.1. -
Add
product-requirements.mdandopenapi.yamlto GitHub Copilot. -
Use prompt like below to build a FastAPI backend application.
I'd like to build a FastAPI application as a backend API. Carefully read the entire PRD and `openapi.yaml`. Then, follow the instructions below. - Your working directory is `python`. - Identify all the steps first, which is you're going to do. - Use FastAPI as the API app framework. - Use SQLite as the database. - Use in-memory feature of SQLite. - The database should always be initialized whenever starting the app. - Use `openapi.yaml` that describes all the endpoints and data schema. - Use the port number of `8000`. - Entrypoint is `main.py`. - The API application should render Swagger UI page through a default endpoint. - The API application should render exactly the same OpenAPI document through a default endpoint. - DO NOT add anything not defined in `openapi.yaml`. - DO NOT modify anything defined in `openapi.yaml`. -
Click the
[keep]button of GitHub Copilot to take the changes. -
Once the application is built, verify if it's written properly or not.
Run the FastAPI app and verify if the app is properly running. Also verify the OpenAPI endpoint renders exactly the same content as `openapi.yaml`. If app running fails, analyze the issues and fix them. -
Open a web browser and navigate to
http://localhost:8000. -
Click the
[keep]button of GitHub Copilot to take the changes.
OK. You've completed the "Python" step. Let's move onto STEP 02: JavaScript Frontend Development.

