A minimal FastAPI app with intentional anti-patterns, built for practicing GitHub workflows (Issues, Project Boards, branches, PRs) before a hackathon.
- Hardcoded secret - API key is hardcoded instead of using env vars
- Copy-pasted logic - The Groq API call is duplicated across endpoints
- No error handling - Crashes if Groq returns an error response
- Go to console.groq.com
- Sign up / log in
- Create an API key
Using uv (recommended):
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
cp .env.example .env
# Edit .env with your actual GROQ_API_KEY
uvicorn main:app --reloadUsing pip (fallback):
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your actual GROQ_API_KEY
uvicorn main:app --reload# Health check
curl http://localhost:8000/health
# Chat
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello!"}'
# Summarize
curl -X POST http://localhost:8000/summarize \
-H "Content-Type: application/json" \
-d '{"text": "Some long text to summarize..."}'API docs: http://localhost:8000/docs
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/<name> |
feature/add-streaming |
| Bug fix | fix/<name> |
fix/use-env-var-for-api-key |
| Refactor | refactor/<name> |
refactor/extract-groq-client |
See practice-guide.md for a step-by-step walkthrough of the GitHub workflow exercises.