This project is a REST API built with Django and Django REST Framework, structured using a layered architecture inspired by Clean Architecture principles. The goal is to create a scalable, maintainable, and well-organized backend system.
The system is divided into the following layers:
presentation → application → domain → infrastructure
Responsibility:
- Handles HTTP requests
- Parses input data
- Calls application use cases
- Returns JSON responses
Example: def create_product(request): use_case.execute(data)
Responsibility:
- Contains application business logic
- Implements Use Cases
- Defines interfaces (contracts)
Examples:
- CreateProductUseCase
- GetProductsUseCase
- UpdateProductUseCase
Responsibility:
- Contains core business entities
- Defines business rules
- Independent of frameworks or infrastructure
Examples:
- Product
- Category
Responsibility:
- Database access using Django ORM
- Repository implementations
- Data persistence logic
Example: ProductModel.objects.create(...)
HTTP Request ↓ View (Presentation Layer) ↓ Use Case (Application Layer) ↓ Repository (Infrastructure Layer) ↓ Database ↓ JSON Response
- Python 3
- Django
- Django REST Framework
- SQLite / PostgreSQL
- Layered Architecture (Clean Architecture style)
application -> domain -> infrastructure / presentation
Products
- GET /api/products/
- POST /api/products/create/
- PUT /api/products/{id}/
- DELETE /api/products/{id}/
- GET /api/products/{id}/
Categories
- GET /api/categories/
- POST /api/categories/create/
- PUT /api/categories/{id}/
- DELETE /api/categories/{id}/
- GET /api/categories/{id}/
- Separation of concerns
- Layered architecture
- Business logic isolated from framework
- Maintainability and scalability
- Dependency inversion via interfaces
This project demonstrates backend engineering skills including:
- REST API development with Django
- Clean and scalable architecture design
- Separation of business logic and infrastructure
- Use of repository and use case patterns
- Production-ready backend structure