How qgis/qgis-hub-website works
Main Components
• Client Side (Browser/User): Represents the end-user interface. It interacts with the server using HTTP/HTTPS.
• Reverse Proxy / Web Server: The dockerize/sites-enabled directory shows several configurations for development, staging, and production. These point to an Nginx container acting as the reverse proxy – routing traffic from external clients to the internal application server.
• Application Server (Django Application):
– uWSGI: The “dockerize/docker/uwsgi.conf” file indicates that uWSGI is used to serve the Django application.
– Django Application: The “qgis-app” folder contains the actual Django project, broken down into multiple Django apps (api, base, geopackages, etc.) following the MVC (model–view–controller, or more accurately MTV in Django) pattern.
• Database: Although the file tree doesn’t explicitly name the database, by convention Django projects use PostgreSQL or another RDBMS. The docker-compose file is likely to include a database container.
• Static File & Asset Storage: The “qgis-app/static” directory and various “templates” directories indicate that static assets (CSS/JS/images) and HTML templates are maintained within the project.
• Docker Containers & Orchestration: The “dockerize” folder, docker-compose YAML, and associated scripts illustrate that the entire deployment is containerized.
Relationships and Interactions
• Client requests are first received by the reverse proxy (Nginx) which routes them to the uWSGI server running inside the Django container.
• The Django application processes these requests by invoking the correct Django “app” logic (models, views, forms, etc.).
• Database communications occur within the Django application when reading or writing data.
• Static content (templates, CSS, JavaScript, media) is served either by Django in development or by a dedicated static server that can be coordinated via Docker.
• Docker-compose orchestrates the containers, ensuring that the web application, database, and any other services run together.
Important Architectural Patterns and Technologies
• MVC/MTV Pattern: The project uses Django’s architecture, separating the Models (database layer), Templates (view layer), and Views (controller logic).
• Containerization: The deployment via docker-compose and Dockerfiles enables isolation – the web server (uWSGI + Django) and reverse proxy (Nginx) are containerized.
• Multi-environment configuration: The file tree includes separate configurations for development, production, and staging (e.g., dev.conf, prod.conf, staging-ssl.conf).
• Continuous Integration/Testing: Files under .github/workflows and testing directories in each Django app highlight an integrated CI and test suite.