- 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.
65 lines
1.7 KiB
Markdown
65 lines
1.7 KiB
Markdown
# 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
|
|
|
|
1. Create new domain folders
|
|
2. Move models to domain folders
|
|
3. Create service layer in domain folders
|
|
4. Update imports incrementally
|
|
5. 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
|
|
|