How ninanor/nina-catalogue works
The project is a full-stack web application built with Django and packaged with Docker, using a multi-container architecture. It combines “metadata_catalogue” as the main Django application (with separate apps for datasets, maps, users, etc.) and additional components like “bruno” which appears to manage catalogue services (CSW endpoints) and interoperability with different standards (ISO, QGIS, pycsw). There are also layers for infrastructure with directories dedicated to Nginx, Varnish, Docker Compose, and setup scripts, showing that the system is designed for both local development and production deployment with a strong emphasis on containerization.
Main Components
• Frontend / Client Layer:
– Although the project is primarily server-side rendered, include web browsers (clients) accessing the application.
• Reverse Proxy & Load Balancer:
– Represent Nginx, which is configured via its own directory and Dockerfiles.
• Caching Layer:
– Include Varnish (with its own Dockerfile and configuration) as the caching component.
• Django Application Server:
– Represent the main application contained in the “metadata_catalogue” directory. Break this component into its constituent Django “apps”:
▪ Core/Datasets/Maps/Users – these represent different business functionalities.
▪ Also note the “config” directory that contains the Django settings and routing logic.
• Catalogue Services:
– Represent the “bruno” component that seems dedicated to implementing catalogue functionalities using CSW standard (with multiple variants: ISO, QGIS, pycsw). Illustrate this as a microservice or sub-system that may interact with the main Django app via integration APIs or shared configurations.
• Auxiliary Processes and Tools:
– Include development and automation helpers indicated by files such as “helpers.sh”, pre-commit configuration, testing (pytest, coverage), and Docker Compose orchestration.
– Represent the “setup” container/process that is used for initial configuration (creation of secrets, etc.).
• External Data Sources / Database:
– While the file tree does not specify the database directory, it’s customary to represent a relational database (likely PostgreSQL or similar) used by Django. Include a database component and show its integration with the Django application.
• Documentation & Testing:
Relationships and Data Flows
– Client requests flowing through Nginx to the Varnish caching layer and finally to the Django backend.
– Communication between Django and the database.
– Interaction from the Django services to the “bruno” catalogue microservice (if they are designed to work as distributed components).
– Data flow from external services (or data harvesters) into the Catalogue (as seen in the “pycsw” and harvest scripts).
• How API calls (like CSW GetCapabilities, GetRecords, etc.) traverse between the catalogue service components and the main application.
Architectural Patterns & Design Principles
• Containerized Deployment:
– Emphasize the Docker-based orchestration (with Dockerfiles, docker-compose.yml in root and subdirectories, along with CI workflows in .github/workflows).
• Separation of Concerns:
– Clearly label components separating presentation (templates, static assets), business logic (Django apps in metadata_catalogue), catalogue service interfaces (bruno), and infrastructure services.
• Microservice-Oriented / Modular Design:
– Show the boundaries of the “bruno” service (a cataloguing engine with CSW endpoints) as a module that could be scaled independently or replaced.
• Configurability and Environment Specific Configuration:
– Indicate the “config/settings” folder that holds different settings (base, production, local, test) to show that environment-based configuration is a key design element.
Relevant Technologies, Frameworks, and Tools
• Django web framework, implying use of Django ORM, middleware, and template rendering.
• Docker and Docker Compose for containerized builds and deployments.
• Nginx and Varnish for reverse proxy and cache management.
• CI/CD tools as indicated by GitHub Actions (.github/workflows/* files).
• Testing and type checking (pytest, coverage, mypy).
• Additional scripts like “helpers.sh” to interact with the Docker/Django CLI.