How department-for-transport-bods/bods works
Main Components
• Source Code & Core Application: Represent the monolithic Django application (found in “transit_odp”) and list its major modules (API, AVLs, browsing, data quality, fares, notifications, ETL pipelines, etc.). This is the core business logic and service layer.
• CI/CD Pipeline: Indicate the integration of GitHub workflows (and the GitLab CI file) along with the pipelines that use “version.txt” for tagging releases. Show languages or build scripts (Makefile, pyproject.toml) and the ECR container registry where images are stored.
• Environments & Deployment Flow: Capture the multiple deployment stages – dev, test, uat, and prod – along with the “hotfix” process described in the README and the manual approval for prod deployments.
• External Integrations & Services: If present, mark integration points with external services such as the AWS infrastructure (ECR, possibly ECS or similar orchestration), third‐party notification delivery (e.g., Gov.UK Notify), or any external APIs the service may consume.
Relationships and Interactions
• Deployment Flow: Show how the Docker images are pulled from the registry and deployed across the different environments. From there, illustrate that traffic is handled by a reverse proxy (Nginx or Caddy) which routes user requests to the Django backend.
• Internal Communication: Within the application, note that API calls (e.g., those served by transit_odp/api) and inter-app communications (through Celery tasks, ETL worker processes, etc.) handle the core service operations. Data flows from external requests to the Django web server, then gets processed by background workers, with persistent storage via Postgres.
Architectural Patterns and Design Principles
• Containerization and Micro-deployment: Although the core application is monolithic in code, the deployment is split into logical services running in distinct containers.
• Separation of Concerns: The directory structure separates configuration (config/), CI-related files (ci/, .github/), and application logic (transit_odp/), ensuring that each aspect (web service, background tasks, ETL) is independently deployable or scalable.
• Automated CI/CD & Versioning: The pipelines are designed to ensure that branch merges trigger builds which are auto-deployed in non-prod environments and manually reviewed for prod, thereby enforcing stable release management.
Including Specific Technologies and Tools
• Backend: Django (with Gunicorn in prod), Celery for asynchronous task processing.
• Frontend: A collection of JavaScript (found in transit_odp/frontend/assets/js) and SASS stylesheets that support the user interface.
• Database: Postgres for persistent data storage.
• Container Tools: Docker with separate Dockerfiles for various services (Django, Nginx, Postgres, celery workers, etc.).
• CI/CD Tools: GitHub workflows and GitLab CI files, along with Docker Compose files for local/development configurations.
• Deployment Environment Integration: AWS ECR and deployment pipelines tied to branch/version management.
• Monitoring/Notifications: Modules for notifications and logging (e.g., using the configurations found in transit_odp/notifications).
• In the top section, indicate the developer workflow with branching and merge orders which lead through CI/CD.
• In the middle section, present the runtime architecture – containers (Django app, Nginx, Postgres, Celery workers) and their interdependencies.
• In the bottom section, show how external stakeholders (end-users, API consumers, the infrastructure team during prod deployments) interact with the system.
– Clearly labels each component and subcomponent.
– Incorporates annotations that describe deployment environments and CI/CD processes.
This detailed breakdown should allow any principal software engineer to understand and accurately map the architecture of this complex, multi-environment, containerised full-stack application.