How realronaldrump/everystreet-new works
Main Components
• Frontend:
• Backend:
• The backend is built using Python (with FastAPI as the web framework). Place “app.py” as the central entry point.
• Supporting modules (e.g., “bouncie_trip_fetcher.py”, “db.py”, “map_matching.py”, “trip_processing.py”, “tasks.py”, “preprocess_streets.py”, “street_coverage_calculation.py”, etc.) to represent functionalities like data fetching, processing, and map matching.
• Database:
• MongoDB as the primary data store. Note that stored data includes trip details, map matching results, street coverage info, custom places, and task management details.
• Mention that asynchronous access is handled via Motor.
• External APIs & Services:
• Integration with external services:
· Bouncie API — provides vehicle trip data.
· Mapbox Map Matching API — used to snap raw GPS data to road networks.
· Nominatim and Overpass API — used for geocoding and retrieving OpenStreetMap (OSM) data.
• Containerization & Deployment:
• Use the Dockerfile to represent containerization for deployment, indicating how the entire environment can be encapsulated.
Relationships and Data Flow
• Between the Frontend and Backend (e.g., via REST APIs or WebSockets for live trip tracking).
• Between the Backend and MongoDB for data storage and retrieval.
• From the Backend to External APIs, indicating data fetching and map matching operations.
• From background tasks (triggered via APScheduler) to the MongoDB and to external APIs for periodic processing.
• How user interactions on the frontend (e.g., trip editing, data upload) initiate requests processed by the backend application.
Architectural Patterns and Design Principles
• Separation of Concerns: The project cleanly separates frontend templates/static files from backend logic.
• Asynchronous Processing: Emphasize usage of asynchronous calls (aiohttp, Motor) and background task scheduling (APScheduler) to handle heavy geospatial processing and data fetching without blocking.
• Modularization: Note that various functionalities (map matching, trip fetching, street coverage, preprocessing, etc.) are encapsulated in separate Python modules.
• Containerization: The Dockerfile indicates that container deployment is supported, simplifying environment replication.
Instructing the Principal Software Engineer
• The user interface (frontend) and the backend API.
• MongoDB and the external APIs as separate entities that the backend communicates with.
• Drill down further if needed by clustering related backend functionalities (e.g., grouping modules for data manipulation, geospatial processing, and API integrations).
• Component-specific notes for technologies:
• Mention FastAPI for the backend, APScheduler for background tasks, and the set of JavaScript libraries used in the frontend.