How murlokfs/django-api works
Main Components
• Frontend/API Layer: Although the project is mostly backend-focused, it exposes REST API endpoints (see main/api/v2) that serve as the interface for client requests.
• Django Core: Represented by the “core” directory. This includes essential configurations such as settings, URL routing (core/urls.py), WSGI/ASGI, and Celery configurations (core/celery.py).
• Application (Business Logic) Layer: Represented by the “main” app which contains models, views, serializers, tasks for asynchronous processing, and Django admin configuration.
• Database: Although SQLite is the default (as per settings in core/settings.py), this component represents the project’s data storage.
• External Services: Redis acts as the message broker which is essential for Celery’s operation.
Relationships & Interactions
• API to Business Logic: From the API endpoints, represent the interaction with the “main” application components (views, models, and serializers).
• Database Interaction: Show that the Django application (both API endpoints and potentially the Django admin) communicates with the Database.
• Message Broker: Connect both Celery Worker and Celery Beat with Redis (broker) to indicate that it is the underlying service handling the task queues.
• Optional Monitoring: Optionally, include Flower connected to Redis for monitoring or debugging task processing.
Architectural Patterns & Design
• Use of the MVC (or MTV in Django’s context) pattern within the “main” app – models, views, and templates are clearly present.
• Separation of concerns: The core configuration and Celery integration are isolated in the “core” directory, while business logic is handled in the “main” app.
• Asynchronous task processing via Celery introduces a decoupled approach for handling tasks that may be time-consuming or scheduled.
Relevant Technologies
• Django and Django REST framework for web API and application management.
• Celery for asynchronous and scheduled tasks.
• Redis, used as the message broker.
• SQLite (or an alternative configured database) for persistence.
• Optionally, Flower for monitoring task status.