How zyla/ceburilo works
• API Server: Represent the “app/server” as the primary service handling incoming /route queries. This is where client requests are processed.
• Precomputation Service: Represent “app/precompute” which likely computes and caches graph data, precomputed routes, or station arrangements for performance.
• Configuration & Assets: Show the “config” folder (and its routes file), “graphhopper” folder (with its configuration file and nextbike data), and scripts (deployment scripts, service configuration) as components that supply parameters, external data, and deployment configuration.
• External Data/Services: Since the README example response includes station data along with routing information, incorporate external data sources (like NextBike data provided via the XML file) as inputs to the precomputation and/or API logic.
Relationships and data-flow
• “Precomputation Service” to the “Core Modules” to show that it pre-calculates routes and possibly stores/caches the computed data (this might feed directly or indirectly into the API response).
• Optionally, add a component for “Deployment & Scripts” (taking cues from the scripts directory and get_paths.sh, get_stations.sh, etc.) to reflect how different parts are deployed and managed in production.
Important architectural patterns
• Separation between the API layer (handling HTTP requests) and the precomputation layer (offline computation and data preparation). This separation improves performance and scalability.
• Module-based design within “src”, which points to encapsulation of the domain logic (graph and geographic computations) within distinct Haskell modules.
• The use of configuration files and external data (graphhopper configs, NextBike XML) suggests a design that externalizes environment-specific parameters to simplify maintenance and deployment.
Details on technologies and design principles
• Haskell/Cabal/Stack: Since the cabal file and stack.yaml exist, note that the project is built and managed using the Haskell toolchain.
• RESTful API: The API server is designed to handle RESTful GET requests (illustrated in the README). Indicate that the design focuses on stateless, parameterized requests.
• Batch/Background Processing: The precomputation subsystem is likely designed to run as a separate service (or via cron/deployment scripts), feeding optimized data into the API.
What
• Each component should be clearly labeled (e.g., “API Server (app/server)”, “Precomputation Service (app/precompute)”, “Core Route & Geo Logic (src/Ceburilo)”).
• Inbound client requests coming into the API server.
• Data flow from the API server to the core modules.
• Data precomputed by the Precomputation Service feeding into the server logic.
• External configurations and data influencing both layers.
• Interactions among components with brief notes (e.g., “uses configuration”, “generates precomputed data”, “serves JSON response”).