Training Course Module 2: CLAUDE.md Day 9
Day 9

Project Context Documentation

Document your project's architecture so Claude always understands the big picture.

0 / 7 tasks

Why context matters

When Claude knows your project's structure, it writes code that fits — correct import paths, matching naming conventions, and implementations that work with your existing architecture. Without context, you get generic code you have to adapt manually.

Architecture section template

markdown
## Architecture

### Directory Structure
```
app/
  api/          # FastAPI routers (one file per resource)
  models/       # SQLAlchemy ORM models
  schemas/      # Pydantic request/response schemas
  services/     # Business logic (no DB access here)
  repositories/ # Database access layer
  core/         # Config, security, dependencies
  tests/        # pytest, mirrors app/ structure
```

### Key Patterns
- **Repository Pattern**: All DB queries go in `repositories/`
- **Service Layer**: Business logic in `services/`, injected into routes
- **Dependency Injection**: Use FastAPI `Depends()` for all shared resources
- **Async Everything**: All routes, services, and repos use `async/await`

### Authentication
- JWT tokens via `app/core/security.py`
- Current user available via `Depends(get_current_user)`
- Roles: `admin`, `editor`, `viewer`

Practice Tasks

0 / 7
← Day 8: Writing Effective Instructions ↑ Module overview Day 10: Custom Slash Commands →