How lukastrkan/pickup-point-selection-widget works
Main Components
• Frontend: The React application (in the "frontend" directory) which uses Bootstrap, React Leaflet (for mapping), and Apollo Client for GraphQL queries. It includes components for branch selection, map display, point details, and search functionality.
• Backend: The Django application (in "backend") with several key sub-components:
• Main App (“app”): Includes URL routing, views, GraphQL schema and types (found in "backend/app/graphql") to serve as the API layer.
• Branch Data Module (“branchData”): Contains models, migrations, and specific utility functions which load and process delivery data.
• Delivery Widget Project ("backend/deliveryWidget"): Contains Django settings, URL configurations, and WSGI/ASGI files.
• Cluster Microservice: The Node/Express microservice (in "cluster-microservice") which likely handles clustering functionality using the mapbox/supercluster library.
• Database: MariaDB, which will be accessed by the Django backend.
• Infrastructure & Deployment: Docker-related files (Dockerfile, .dockerignore, docker-compose YAML) and scripts for containerization and deployment.
Visualizing Relationships and Data Flow
• Backend ↔ Database: The Django ORM interacts with MariaDB. Indicate data flow from the backend to the database.
• Internal Module Interactions: Within the backend, illustrate interactions between:
• The main “app” that handles URL routing and GraphQL queries.
• The “branchData” module that manages delivery data loading and utility functions.
• The Django settings and deployment components (WSGI/ASGI, management commands, etc).
Architectural Patterns & Design Principles
• Separation of Concerns: Clearly separate the frontend and backend layers, and further modularize the backend into domain-specific apps (GraphQL API, branch data processing).
• Microservices: Highlight the Node-based microservice as a separate component that integrates with the core Django backend.
• Containerization: Emphasize that Docker is used for deployment, ensuring each component (frontend, backend, microservice) can be deployed in isolated containers that communicate as dictated by the docker-compose configuration.
• Extensibility: The structure (especially in “branchData” and GraphQL schema definition) supports potential extension for handling additional delivery services and integrations.