--- description: Project structure and file organization standards globs: ["**/*"] alwaysApply: true --- # Project Structure Standards ## Directory Organization ### Service Structure ``` services/[service-name]/ ├── src/ # Source code ├── tests/ # Test files ├── docs/ # Service-specific documentation ├── README.md # Service documentation ├── CLEAN_CODE.md # Clean code implementation ├── package.json/pom.xml # Dependencies └── Dockerfile # Container configuration ``` ### Frontend Structure ``` frontend/ ├── src/ │ ├── components/ # React components │ │ ├── common/ # Reusable components │ │ └── dashboard/ # Dashboard-specific components │ ├── hooks/ # Custom hooks │ ├── services/ # API services │ ├── utils/ # Utility functions │ ├── constants/ # Configuration constants │ └── [app files] # Main application files ├── public/ # Static assets ├── README.md # Frontend documentation ├── CLEAN_CODE.md # Clean code implementation ├── RESILIENCE.md # Offline mode features └── package.json # Dependencies ``` ## File Naming ### Service Files - Source files: Follow language conventions - Documentation: README.md, CLEAN_CODE.md - Configuration: package.json, pom.xml, requirements.txt - Docker: Dockerfile, Dockerfile.dev ### Frontend Files - Components: PascalCase (e.g., `Dashboard.js`) - Hooks: camelCase with 'use' prefix (e.g., `useServiceStatus.js`) - Utilities: camelCase (e.g., `errorHandling.js`) - Constants: camelCase (e.g., `index.js`) ## Documentation Structure ### Required Documentation - **README.md**: Service overview and setup - **CLEAN_CODE.md**: Clean code implementation - **Progress tracking**: In docs/progress.md - **Structure updates**: In docs/structure.txt ### Documentation Updates - Update when adding new files or directories - Update when completing tasks or milestones - Update when modifying functionality - Update when adding new features or services ## Configuration Files ### Environment Configuration - Use .env files for environment variables - Provide .env.example templates - Document all required variables - Use consistent naming conventions ### Docker Configuration - Multi-stage builds for production - Development-specific Dockerfiles - Health checks in containers - Proper base image selection ## Git Structure ### Branching Strategy - main: Production-ready code - develop: Integration branch - feature/*: Feature development - hotfix/*: Critical fixes ### Commit Messages - Use conventional commit format - Include scope when relevant - Provide clear descriptions - Reference issues when applicable ## Quality Gates ### Pre-commit Checks - Code formatting - Linting - Type checking - Test execution ### Pre-merge Checks - Code review approval - Test coverage requirements - Documentation updates - Security scans