Instruction file imported from wkdgus1164/custom-ocr-service (
.cursor/rules/project-structure.mdc). Copyright stays with the author.
Project Structure Rules
Directory Organization
Organize code by functional role using clear directory structure:
custom-ocr-service/
├── components/ # Reusable components and modules
├── utils/ # Utility functions and helpers
├── lib/ # Core libraries and business logic
├── tests/ # Test files (mirror source structure)
├── docs/ # Project documentation
├── scripts/ # Build and deployment scripts
├── .venv/ # Virtual environment (auto-generated)
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lockfile
└── main.py # Application entry point
File Naming Conventions
- Use
snake_casefor Python files and directories - Use descriptive names that indicate file purpose
- Group related functionality in the same directory
Directory Guidelines
/components
- Reusable Python modules and classes
- Each component should have a single responsibility
- Include
__init__.pyfor proper package structure
/utils
- Helper functions and utility modules
- Common operations used across the project
- Should not contain business logic
/lib
- Core business logic and main functionality
- Domain-specific code
- Main algorithms and processing logic
/tests
- Mirror the source code structure
- Use
test_prefix for test files - Organize tests by component/feature
Import Rules
- Use absolute imports from project root
- Prefer explicit imports over wildcard imports
- Group imports: standard library, third-party, local imports