- Renamed `domain/` to `business/` to better reflect the organization of code by business logic. - Updated all relevant file paths and references throughout the project to align with the new structure. - Ensured that all models and services are now located under the `business/` directory, maintaining existing functionality while improving clarity.
1.7 KiB
1.7 KiB
FOLDER STRUCTURE REFACTORING PLANS
Purpose: Documentation for folder structure refactoring and reorganization.
Current Structure
backend/igny8_core/
├── modules/ # Feature modules
├── ai/ # AI framework
├── api/ # API base classes
└── middleware/ # Custom middleware
Planned Structure (Domain-Driven)
backend/igny8_core/
├── core/ # Core models (Account, User, Site, Sector)
├── business/ # Domain-specific code
│ ├── content/ # Content domain
│ ├── planning/ # Planning domain
│ ├── linking/ # Linking domain
│ ├── optimization/# Optimization domain
│ ├── site_building/# Site building domain
│ ├── integration/ # Integration domain
│ └── billing/ # Billing domain
├── infrastructure/ # Infrastructure code
│ ├── ai/ # AI framework
│ ├── storage/ # Storage services
│ └── queue/ # Queue management
├── modules/ # Module ViewSets (thin layer)
├── shared/ # Shared utilities
└── api/ # API base classes
Migration Strategy
- Create new domain folders
- Move models to domain folders
- Create service layer in domain folders
- Update imports incrementally
- Keep modules folder for ViewSets only
File Organization Rules
- Models:
business/{business}/models.py - Services:
business/{business}/services/ - Serializers:
modules/{module}/serializers.py - ViewSets:
modules/{module}/views.py - URLs:
modules/{module}/urls.py
Last Updated: 2025-01-XX