Application Tracker Coding Agent
An AI coding assistant specialized for the **Application Tracker** project — a web application that helps users track and manage job applications throughout the entire application process.
Project Context
Tech Stack
**Backend**: FastAPI, Python 3.12, SQLAlchemy (async), PostgreSQL**Frontend**: React, TypeScript, Vite**Architecture**: Onion Architecture (backend), Feature-Sliced Design (frontend)**Deployment**: Docker with dev container supportCore Functionality
Add and manage job applications with comprehensive detailsTrack application progress through all stagesStore company information, interview dates, and application URLsFilter and sort applications by multiple parametersInstructions for AI Agent
1. Code Style & Standards
#### Python Backend (3.12+)
Use Python 3.12 features with full type hintsFollow PEP 8 with ruff formatting (line length: 120)Use async/await for all database operationsPrefer Pydantic v2 models with `ConfigDict`Use SQLAlchemy 2.0 ORM syntax with async sessionsApply SOLID principles and dependency injection#### TypeScript Frontend
Use TypeScript strict modeWrite React functional components with hooksFollow ESLint and Prettier standardsPrefer async/await over promisesUse Feature-Sliced Design structure (see below)2. Backend: Onion Architecture
Organize code into these layers:
1. **Domain Layer** (`core/domain/`): Pure business entities and enums
2. **Application Layer** (`core/services/`): Business logic and orchestration
3. **Infrastructure Layer** (`infrastructure/`): External concerns (DB, auth, etc.)
4. **Presentation Layer** (`routers/`): HTTP endpoints and API contracts
**Key Patterns:**
Repository Pattern for data access abstractionService Layer keeps business logic out of endpointsDTO Pattern separates internal models from API contractsUse FastAPI's dependency injection system3. Frontend: Feature-Sliced Design (FSD)
Organize frontend code into these layers (top to bottom):
**App** (`src/app/`): Application initialization, providers, global config**Pages** (`src/pages/`): Route-level components and page logic**Features** (`src/features/`): User-facing functionality and business features**Entities** (`src/entities/`): Business entities and their representations**Shared** (`src/shared/`): Reusable infrastructure, UI kit, utilities**FSD Segments within each layer:**
`ui/` — User interface components`api/` — API calls and data fetching logic`model/` — Business logic, stores, types`lib/` — Infrastructure utilities`config/` — Configuration and constants4. Pre-commit Compliance
Ensure all generated code passes pre-commit hooks:
**File Formatting:**
No trailing whitespace on any lineEnd all files with exactly one newline characterAvoid large files**Python Code:**
Must pass `ruff check` and `ruff format`Must pass `mypy` type checkingUse ruff's import sorting (`--select I --fix`)**Frontend Code:**
Must pass ESLint rulesMust be formatted with PrettierApply to `.js`, `.ts`, `.tsx`, `.jsx`, `.json`, `.yaml`, `.html`, `.css`5. Database Patterns
Use async SQLAlchemy with proper session managementDefine relationships with `back_populates`Use enum types for status fieldsInclude audit fields (`time_create`, `time_update`)6. Testing Standards
Use `BaseTest` class for common test utilitiesOrganize tests by feature (e.g., `TestApplicationUpdate`)Use pytest fixtures with proper dependency injectionFollow AAA pattern: Arrange, Act, Assert7. Commit Message Standards
Follow [Conventional Commits](https://www.conventionalcommits.org/):
**Format:**
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
**Types:**
`feat:` — New feature`fix:` — Bug fix`docs:` — Documentation changes`style:` — Code formatting (no logic changes)`refactor:` — Code restructuring`perf:` — Performance improvements`test:` — Adding or updating tests`build:` — Build system or dependency changes`ci:` — CI/CD configuration changes`chore:` — Maintenance tasks**Breaking Changes:**
Add `!` after type/scope: `feat!:` or `feat(api)!:`Or use footer: `BREAKING CHANGE: description`**Examples:**
```
feat(auth): add JWT token refresh functionality
fix(db): resolve connection pool timeout issue
docs: update API documentation for user endpoints
refactor!: restructure user service architecture
```
Usage Examples
**Backend service creation:**
```python
core/services/application_service.py
from typing import Protocol
from core.domain.entities import Application
class ApplicationRepository(Protocol):
async def get_by_id(self, app_id: int) -> Application | None: ...
async def save(self, app: Application) -> Application: ...
class ApplicationService:
def __init__(self, repo: ApplicationRepository) -> None:
self._repo = repo
async def update_status(self, app_id: int, status: str) -> Application:
app = await self._repo.get_by_id(app_id)
if not app:
raise ValueError("Application not found")
app.status = status
return await self._repo.save(app)
```
**Frontend FSD structure:**
```typescript
// src/features/application-status/ui/StatusBadge.tsx
import { ApplicationStatus } from '@/entities/application'
export const StatusBadge = ({ status }: { status: ApplicationStatus }) => {
return <span className={`badge badge-${status}`}>{status}</span>
}
```
Important Notes
Always use async/await for database operationsExtract common logic into utilities (DRY principle)Maintain strict type safety throughoutImplement comprehensive error handling with custom exceptionsKeep business logic in services, not in endpoints or componentsFollow the architectural patterns consistently