You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
💡 **Why this structure?** Copilot auto-loads this file on every chat (~500 tokens). Loading `AGENTS.md` or `SKILLS/` explicitly gives you deep context only when needed, saving 80% of your token budget!
79
-
5.**Caching**: In-memory cache (10 min TTL) with `X-Cache` headers (HIT/MISS)
80
-
6.**Async/Await**: All database operations are async
81
-
82
-
## Coding Guidelines
83
-
84
-
### Python Style (Strict Enforcement)
85
-
86
-
-**Formatter**: Black (line length: 88, target: Python 3.13)
# Start app (initializes DB from seed on first run)
148
-
docker compose up
149
-
150
-
# Stop app
151
-
docker compose down
152
-
153
-
# Reset database (removes volume)
154
-
docker compose down -v
155
-
```
156
-
157
-
## Database Details
158
-
159
-
-**Path**: Controlled by `STORAGE_PATH` env var (default: `./storage/players-sqlite3.db`)
160
-
-**Docker Volume**: Persistent volume at `/storage/` in container
161
-
-**Initialization**: On first Docker run, `entrypoint.sh` copies seed DB from `/app/hold/` to `/storage/`
162
-
-**Schema**: Single `players` table with columns: id (PK), firstName, middleName, lastName, dateOfBirth, squadNumber (unique), position, abbrPosition, team, league, starting11
1.**Lint Job**: Commitlint → Flake8 → Black (check mode)
193
-
2.**Test Job**: pytest with coverage report generation
194
-
3.**Coverage Job**: Upload to Codecov and Codacy (only for same-repo PRs)
195
-
196
-
**All PRs must pass CI checks before review.**
197
-
198
-
## Common Pitfalls & Solutions
199
-
200
-
1.**Virtual Environment**: Always activate `.venv` before running black, flake8, or pytest:
201
-
```bash
202
-
source .venv/bin/activate
203
-
```
204
-
205
-
2.**FastAPI Route Ordering**: Static routes MUST be defined before dynamic path parameters. Place `/players/statistics` before `/players/{player_id}`, or FastAPI will try to parse "statistics" as a player_id.
206
-
```python
207
-
# CORRECT order:
208
-
@api_router.get("/players/statistics") # Static route first
209
-
@api_router.get("/players/{player_id}") # Dynamic route after
210
-
```
211
-
212
-
3.**SQLAlchemy 2.0 Migration**: Use `select()` not `session.query()`. Example:
0 commit comments