Instructions for AI coding assistants working on this codebase.
This is a monorepo for GDG on Campus Yaşar University's core software infrastructure. It contains backend microservices, frontend applications, and utility scripts.
| Layer | Technology |
|---|---|
| Backend | Python 3.14, FastAPI, Motor (MongoDB) |
| Frontend | React, TypeScript, Vite |
| Package Managers | uv (Python), Bun (JS/TS) |
| Linters/Formatters | Ruff (Python), Biome (JS/TS) |
| Task Runner | Makefile |
├── services/ # Backend microservices (FastAPI)
│ ├── form/ # Form management service
│ │ └── app/
│ │ ├── main.py # Entry point
│ │ ├── routers/ # API routes
│ │ ├── models/ # Pydantic models
│ │ ├── services/ # Business logic
│ │ ├── db/ # Database (MongoDB)
│ │ └── utils/ # Helpers
│ ├── mail/ # Email campaign service
│ │ └── app/
│ │ ├── main.py # Entry point
│ │ ├── config.py # Settings (Pydantic BaseSettings)
│ │ ├── routers/ # API routes
│ │ ├── models/ # Pydantic models
│ │ ├── repositories/ # Data access layer
│ │ ├── services/ # Business logic
│ │ ├── templates/ # HTML templates
│ │ ├── db/ # Database (MongoDB)
│ │ └── utils/ # Helpers
│ └── user/ # User management service (internal)
│ └── app/
│ ├── main.py # Entry point
│ ├── config.py # Settings (Pydantic BaseSettings)
│ ├── routers/ # API routes
│ ├── models/ # Pydantic models
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ ├── auth/ # API token authentication
│ ├── db/ # Database (MongoDB)
│ └── utils/ # Helpers
├── frontend/ # Frontend applications (React)
│ └── form/ # Form management UI
│ └── src/
│ ├── components/ # Reusable components
│ ├── pages/ # Route components
│ ├── hooks/ # Custom hooks
│ ├── services/ # API calls
│ ├── types/ # TypeScript definitions
│ └── utils/ # Helpers
├── scripts/ # Utility scripts
├── docs/ # Documentation & conventions
├── .ai/ # AI agent instructions
│ ├── INSTRUCTIONS.md # Global instructions (this file)
│ └── services/
│ ├── mail/ # Mail service detailed docs
│ └── user/ # User service detailed docs
└── .github/ # GitHub workflows, templates, CODEOWNERS
For detailed context on specific services, see:
- Mail Service:
.ai/services/mail/{CLAUDE│AGENTS│GEMINI}.md- Campaign scheduling, email sending, unsubscribe flow - User Service:
.ai/services/user/{CLAUDE│AGENTS│GEMINI}.md- User management, per-service auth, form/mail tracking
make help # List all commands
make install # Install all dependencies (backend + frontend)
make dev # Run both backend and frontend dev servers
make lint # Lint and auto-fix both backend and frontend
make format # Format both backend and frontend
make clean # Remove cache and build artifacts
make run-form-service # Start form FastAPI dev server
make run-form-frontend # Start Vite dev server
make run-mail-service # Start mail FastAPI dev server
make test-mail-service # Run mail service tests
make run-mail-campaign # Run email campaign CLI
make run-user-service # Start user FastAPI dev server
make test-user-service # Run user service tests
make sync-prompts # Sync AI prompt filesmake install # Install all dependencies
make run-form-service # Run dev server
make format # Format code
make lint # Lint codemake install # Install all dependencies
make run-form-frontend # Run dev server
make format # Format code
make lint # Lint code| Type | Convention | Example |
|---|---|---|
| Files | snake_case | user_router.py |
| Functions | snake_case | get_user_by_id() |
| Classes | PascalCase | UserResponse |
| Constants | UPPER_SNAKE | MAX_RETRIES |
| Variables | snake_case | user_count |
Rules:
- Use
uvfor dependencies, never pip - Use
async/awaitfor all I/O operations (DB, API calls) - Strict type hints required for all function arguments and return values
- Use Pydantic models for data validation
- Separate logic:
routers/(HTTP handling) →services/(business logic) - Follow Ruff defaults
Logging:
- Always use Tamga for logging in all backend services and scripts
- Never use Python's built-in
loggingmodule orprint()for logging purposes - Log everything: API requests, database operations, errors, important state changes, and business logic events
- Logging is critical for debugging, monitoring, and auditing - comprehensive logs are required
| Type | Convention | Example |
|---|---|---|
| Components | PascalCase | UserCard.tsx |
| Hooks | camelCase with use |
useAuth.ts |
| Utils | camelCase | formatDate.ts |
| Types/Interfaces | PascalCase | User, ApiResponse |
| Variables | camelCase | userName |
| Constants | UPPER_SNAKE | API_URL |
Rules:
- Use
bunfor packages, never npm - Use function components only
- Define prop interfaces for all components
- Avoid
anytype - use strict TypeScript - One component per file
- Extract reusable logic to custom hooks
feat/<issue-number>-<slug>- New features (e.g.,feat/42-new-dashboard)fix/<issue-number>-<slug>- Bug fixes (e.g.,fix/55-button-overlap)docs/<issue-number>-<slug>- Documentation updates
feat:- New featurefix:- Bug fixdocs:- Documentationref:- Code refactoringci:- CI/CD changesstyle:- Formatting (no code change)
-
Never commit directly to
main -
Create a branch from
main -
Run formatters before opening PR (
make format) -
PR Titles:
- Must be all lowercase
- Must include scope (e.g.,
fix(ff): ...)
Tag Scope fb form-serviceff form-frontendma mailus user -
PR Template: Agents must read
.github/PULL_REQUEST_TEMPLATE.md -
Link issues in PR description (
Closes #123) -
Request review from
@seberatolmezor@dogukanurker -
At least one admin approval required
-
Always use "Squash and merge"
| File | Purpose |
|---|---|
Makefile |
Central entry point for dev commands |
services/form/pyproject.toml |
Form backend dependencies |
services/mail/pyproject.toml |
Mail backend dependencies |
services/mail/app/config.py |
Mail service settings |
services/user/pyproject.toml |
User backend dependencies |
services/user/app/config.py |
User service settings |
frontend/form/package.json |
Frontend dependencies |
frontend/form/vite.config.ts |
Frontend build config |
frontend/biome.json |
Biome (JS/TS linter) config |
.pre-commit-config.yaml |
Pre-commit hooks config |
docs/*.md |
Detailed conventions |
.ai/services/mail/INSTRUCTIONS.md |
Mail service AI instructions |
.ai/services/user/INSTRUCTIONS.md |
User service AI instructions |
- Use
.envfiles for service settings - Never commit secrets - use
.env.exampleas template - Document required env variables in service README
- Mail service:
make test-mail-serviceruns 126+ tests with pytest - User service:
make test-user-serviceruns 61 tests with pytest - Form service: No tests yet
- If adding tests, include clear command in service README
- Consider adding Makefile target (e.g.,
make test-<service>)