Files
coding-agent-rules/project-structure.md
2025-10-04 16:16:05 -04:00

177 lines
9.8 KiB
Markdown

---
trigger: always_on
---
# Project Structure
The repository follows a modular monorepo layout. Top-level deployment artifacts live under `deploy/`, and shared scripts live under `scripts/`.
## Tree
```text
project-management-suite/
├── README.md # Project overview, setup instructions
├── LICENSE # Project license
├── .gitignore # Git ignore file
├── deploy/ # Project-level deployment artifacts (containers, envs, infra)
│ ├── compose.yml # Docker Compose for local dev and/or deployment
│ ├── .env.example # Example environment variables for compose/services
│ ├── docker/ # Dockerfiles, compose overrides, and container docs
│ │ ├── backend.Dockerfile
│ │ ├── frontend.Dockerfile
│ │ └── README.md
│ └── README.md # Notes on how to run/deploy with Deploy artifacts
├── scripts/ # Shared scripts for CI/local dev/ops
│ ├── ci/ # Scripts called by .gitea workflows
│ │ ├── backend-test.sh
│ │ └── frontend-test.sh
│ ├── dev/ # Developer convenience scripts
│ │ ├── start-backend.sh
│ │ ├── start-frontend.sh
│ │ ├── start-database.sh
│ │ └── reset-database.sh
│ └── utils/ # Misc utilities (lint, format, DB migrations, etc.)
│ ├── lint-backend.sh
│ ├── lint-frontend.sh
│ └── format-all.sh
├── backend/ # Server-side code (Python/FastAPI)
│ ├── pyproject.toml # Python project configuration
│ ├── .env.example # Example environment variables
│ ├── app/ # Application code
│ │ ├── main.py # FastAPI application entry point
│ │ ├── api/ # API routes
│ │ │ ├── __init__.py
│ │ │ ├── estimating.py # Estimating endpoints
│ │ │ ├── scheduling.py # Scheduling endpoints
│ │ │ └── tasks.py # Task management endpoints
│ │ ├── core/ # Core application code
│ │ │ ├── __init__.py
│ │ │ ├── config.py # Application configuration
│ │ │ ├── security.py # Authentication and authorization
│ │ │ └── errors.py # Error handling
│ │ ├── db/ # Database models and connections
│ │ │ ├── __init__.py
│ │ │ ├── session.py # Database session
│ │ │ └── models/ # Database models
│ │ │ ├── __init__.py
│ │ │ ├── user.py
│ │ │ ├── project.py
│ │ │ ├── task.py
│ │ │ └── estimate.py
│ │ ├── services/ # Business logic
│ │ │ ├── __init__.py
│ │ │ ├── estimating.py # Estimating logic
│ │ │ ├── scheduling.py # Scheduling logic
│ │ │ └── task.py # Task management logic
│ │ └── schemas/ # Pydantic schemas for request/response validation
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── project.py
│ │ ├── task.py
│ │ └── estimate.py
│ └── tests/ # Server-side tests (pytest)
│ ├── __init__.py # Make 'tests' a package
│ ├── conftest.py # Test configuration and fixtures
│ ├── unit/ # Unit tests for backend/app
│ │ ├── __init__.py # Make 'unit' a package
│ │ ├── test_api/ # For files in backend/app/api/
│ │ │ ├── __init__.py
│ │ │ └── test_estimating/ # For app/api/estimating.py
│ │ │ ├── __init__.py
│ │ │ ├── test_get_estimate.py # Example for get_estimate()
│ │ │ └── test_create_estimate.py # Example for create_estimate()
│ │ ├── test_core/ # For files in backend/app/core/
│ │ │ ├── __init__.py
│ │ │ └── test_config/ # For app/core/config.py
│ │ │ ├── __init__.py
│ │ │ └── test_get_settings.py # Example for get_settings()
│ │ ├── test_db/ # For files in backend/app/db/
│ │ │ ├── __init__.py
│ │ │ ├── test_session/ # For app/db/session.py
│ │ │ │ ├── __init__.py
│ │ │ │ └── test_get_connection_string.py # For get_connection_string() in session.py
│ │ │ └── test_models/ # For files in backend/app/db/models/
│ │ │ ├── __init__.py
│ │ │ └── test_user/ # For app/db/models/user.py
│ │ │ ├── __init__.py
│ │ │ └── test_user_creation.py # Example test for a function in user.py
│ │ ├── test_services/ # For files in backend/app/services/
│ │ │ ├── __init__.py
│ │ │ └── test_estimating/ # For app/services/estimating.py
│ │ │ ├── __init__.py
│ │ │ └── test_calculate_estimate.py # Example for calculate_estimate()
│ │ └── test_schemas/ # For files in backend/app/schemas/
│ │ ├── __init__.py
│ │ └── test_user/ # For app/schemas/user.py
│ │ ├── __init__.py
│ │ └── test_user_validation.py # Example for a validation function
│ └── integration/ # Integration tests
│ ├── __init__.py # Make 'integration' a package
│ ├── test_api/ # Test API endpoints
│ │ ├── __init__.py
│ │ ├── test_estimating.py
│ │ ├── test_scheduling.py
│ │ └── test_tasks.py
│ └── test_db/ # Test database operations
│ ├── __init__.py
│ └── test_models.py
├── frontend/ # Client-side code (React)
│ ├── package.json # Node.js dependencies
│ ├── .env.example # Example environment variables
│ ├── public/ # Static assets
│ │ ├── index.html
│ │ ├── favicon.ico
│ │ └── assets/
│ ├── src/ # React source code
│ │ ├── index.js # Entry point
│ │ ├── App.js # Main application component
│ │ ├── components/ # Reusable UI components
│ │ │ ├── common/ # Shared components
│ │ │ │ ├── Header.jsx
│ │ │ │ ├── Sidebar.jsx
│ │ │ │ └── Footer.jsx
│ │ │ ├── estimating/ # Estimating-related components
│ │ │ ├── scheduling/ # Scheduling-related components
│ │ │ └── tasks/ # Task management components
│ │ ├── pages/ # Page components
│ │ │ ├── Dashboard.jsx
│ │ │ ├── Estimating.jsx
│ │ │ ├── Scheduling.jsx
│ │ │ └── TaskManagement.jsx
│ │ ├── services/ # API service calls
│ │ │ ├── api.js # API client setup
│ │ │ ├── estimating.js
│ │ │ ├── scheduling.js
│ │ │ └── tasks.js
│ │ ├── store/ # State management (Redux/Context)
│ │ │ ├── index.js
│ │ │ ├── actions/
│ │ │ └── reducers/
│ │ ├── utils/ # Utility functions
│ │ └── styles/ # CSS/SCSS styles
│ └── tests/ # Client-side tests
│ ├── components/
│ ├── pages/
│ └── services/
└── docs/ # Documentation
├── api/ # API documentation
│ └── CHANGELOG.md # API surface changes and migration notes
├── architecture/ # Architecture diagrams
└── user-guide/ # User documentation
## Notes
- deploy/
- Use `deploy/compose.yml` as the canonical Compose file. If a legacy `docker-compose.yml` exists at repo root, consider removing or updating it to point to `deploy/compose.yml`.
- Provide `deploy/.env.example` to document required environment variables.
- Optionally include `deploy/k8s/` if you plan Kubernetes deployments.
- scripts/
- Place CI entrypoints under `scripts/ci/` and have `.gitea/workflows/*` call these scripts to keep CI DRY.
- Move ad-hoc developer scripts (e.g., start/reset scripts) into `scripts/dev/`.
- Keep one-liner helpers (lint/format) in `scripts/utils/` and reference them from package.json or CI as needed.
## Rationale
- Centralizing deployment artifacts under `deploy/` improves discoverability and avoids clutter at the repository root.
- Consolidating scripts under `scripts/` standardizes how CI and developers invoke common tasks, increasing consistency between local and CI environments.