A hands-on troubleshooting lab series for developers learning how to debug common API issues.
Each lab contains a small broken Flask API. Learners must run the app, reproduce the error, investigate the cause and apply a fix.
This project is designed for:
- New backend developers
- API bootcamp students
- Developer education workshops
- DevRel/technical curriculum demos
- Instructors teaching debugging workflows
By the end of these labs, learners should be able to:
- Read API error messages and logs more carefully
- Use HTTP status codes to guide debugging
- Identity common configuration and environment problems
- Debug authenication, CORS, rate limiting, JSON and database issues
- Explain the difference between symptoms and root causes
- Document a clear troubleshooting process
- Python
- Flask
- SQLite
- Flask-CORS
- python-dotenv
Clone the repo:
git clone https://github.com/lilvina/api-debugging-labs.git
cd api-debugging-labsCreate and activate a virtual environment:
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip3 install -r requirements.txtThen test the endpoint with curl or Postman.
| Lab | Topic | Primary Skill |
|---|---|---|
| Lab 1 | 401 Authentication Error | Debugging headers and API keys |
| Lab 2 | Missing Environment Variables | Debugging configuration issues |
| Lab 3 | Rate Limiting 429 | Understanding API limits |
| Lab 4 | Invalid JSON Responses | Debugging response formatting |
| Lab 5 | CORS Issues | Debugging browser/API communication |
| Lab 6 | Database Connection Failure | Debugging database setup |
For each lab:
- Read the
problem.mdfile. - Run the broken app.
- Reproduce the issue.
- Read the error message or API response.
- Try the hints only if needed.
- Fix the bug.
- Compare your answer with
solution-guide.md. - Review
instructor-notes.mdfor teaching ideas.
These labs can be used as:
- A live debugging workshop
- A take-home exercise
- Pair programming practice
- API onboarding material
- A technical curriculum portfolio sample
| Time | Activity |
|---|---|
| 5 min | Introduce the debugging strategy |
| 10 min | Learners reproduce the bug |
| 15 min | Learners investigate and fix |
| 10 min | Group debrief |
| 5 min | Instructor explains production relevance |
Before jumping to the solution, ask:
- What status code am I getting?
- Is the request formatted correctly?
- Are headers missing?
- Are environment variables loaded?
- Is the server returning valid JSON?
- Is the database connected?
- Is this a browser-only issue or an API issue?
MIT