How adrianjs2009/proyecto_fct_python works
• Django Project & Settings: Represent the core of the application, including components like settings.py, urls.py, asgi.py, and wsgi.py. This is the entry and configuration point for the entire API.
• API Endpoint Layer (Interfaces): This is represented by the “drones/interfaces” directory. It contains view logic (e.g., view functions or ViewSets) and serializers that map HTTP requests to domain models.
• Business/Application Layer: Shown under “drones/application”. This layer encapsulates the business logic and services that handle flight command executions and drone/matrix management.
• Domain Layer: Under “drones/domain”, which includes domain-specific logic such as repositories and custom exceptions that enforce business rules.
• Data Models & Infrastructure: Found in “drones/models.py” and “drones/infrastructure”. This is the low-level data representation layer that interacts with the database (SQLite as noted in db.sqlite3).
Relationships and Flow
• External API Clients send HTTP requests (using Swagger, ReDoc endpoints, etc.) that are received by the Django project via URL routing defined in AeroMatrix/urls.py.
• Requests reach the API Endpoint Layer (Interfaces) where serializers validate and convert data before handing over to the business/application layer.
• The Application Layer’s services (in drones/application) process the core business logic (e.g., executing command sequences, validating collision/boundaries) and interact with domain logic.
• The Domain Layer (drones/domain) further validates operations and interacts with repositories.
• Data Models (from drones/models.py) and the Infrastructure layer then execute CRUD operations on the persistence layer (SQLite database).
Architectural Patterns and Design Principles
• Layered (or Onion/Hexagonal) Architecture: Separation into presentation (interfaces), application (services), domain, and infrastructure layers indicates a clean separation of concerns.
• Domain Driven Design (DDD) Influence: The use of a distinct domain layer for repositories and custom exceptions to encapsulate business logic.
• Usage of Django and DRF: Leverage built-in capabilities for URL routing, serialization, authentication, and auto-generated API documentation.
Technologies and Frameworks
• Python 3.13, Django 5.1, Django REST Framework, and drf-spectacular for auto-generated documentation.
• SQLite as the persistence mechanism in this project.