How hazadus/services-exchange works
Main Components
• Web Server Layer: Show the Nginx container (from the docker/nginx directory) that acts as a reverse proxy to the application.
• Application Server: Represent the Django application itself. Within this, denote the core components:
• Django’s WSGI/ASGI entry points (wsgi.py, asgi.py).
• Task Queue: Illustrate the Celery process (present via src/django_project/celery.py) along with its integration with Redis as the broker.
• Database: Although not explicitly seen in the file tree, it’s implied that a relational database (e.g., PostgreSQL) is used with Django migrations in every app.
• Static Assets & Frontend: Show the static assets (src/static & Tailwind CSS configuration) and Django templates (src/templates) as the presentation layer.
• CI/CD: Include elements representing the GitHub workflows (.github/workflows) and Docker deployment (docker-compose.yml and docker-compose.dev.yml) that facilitate continuous integration and deployment.
• Logging & Monitoring: Add Sentry as an external service integrated for error monitoring.
Relationships and Interactions
• Clearly denote directional flows such as:
• Requests from users hitting the Nginx reverse proxy and then forwarding to the Django application.
• The Django application handling HTTP requests through its views and templates, interacting with the database using models and selectors.
• Background tasks initiated from within the Django application (or via user actions) being processed by Celery workers.
• Communication between the Celery workers and Redis.
• The CI/CD pipeline triggering Docker builds, migrations, and deployment actions.
Architectural Patterns & Principles
• Modular Design: Emphasize that the Django project is split into distinct apps where each has its “selectors.py” and “services.py” to abstract data and business logic.
• Separation of Concerns: Note the clear separation between UI (templates, static assets), business logic (Django apps), and background processing (Celery).
• CI/CD Integration: Reflect how changes flow from code commits to live deployment through GitHub workflows.
Relevant Technologies and Frameworks
• Django (as the main backend framework).
• Celery & Redis for background processing.
• Tailwind CSS for styling.
• Docker, Docker Compose, and Nginx for deployment.
• Sentry for error logging.
• Various Django third-party apps like django-allauth for authentication & registration.
• A subordinate component for “Celery Worker”, connected to both the Django application (for task delegation) and “Redis” for message brokering.
• A “Database” component connected bidirectionally with the Django Application.
• Static asset serving using Whitenoise (or by Nginx if that’s how it’s set up) within the Django Application or as part of the Nginx flow.
• Lastly, include notes on the Docker Compose configuration files that drive the orchestration of these containers.