How mubesy/turbopark works
Project Type and Purpose
• Turbo Park is a full-stack web application with a React/Redux frontend and a Flask/Python backend.
• Its goal is to accept a user address, perform geocoding (using Position Stack’s API), and retrieve parking information from INRIX’s Off Street Parking API.
File Structure
• At the project’s root, you see backend files like app.py and resources.py. This indicates that the Flask server handles API requests and response formatting.
• The presence of package.json, package-lock.json, and directories such as public and src (which contain React components, actions, reducers, and services) shows that the frontend is built with React and Redux.
• The src/actions, src/components, src/reducers, and src/services folders indicate a structured separation of concerns adhering to a typical React/Redux architectural pattern.
• Given these directory names, the frontend likely communicates with the backend API endpoints, while the backend performs external calls.
• The additional helper modules (in src/helpers) suggest abstraction for tasks like history or store management.
Main Components
• Frontend (React/Redux):
• User Interface: Represented by components in src/components (e.g., Home, Card, Input).
• State Management: Indicated by src/reducers and src/actions.
• Service Layer: Modules in src/services (like ApiService.js and CommonService.js) to handle API requests from the frontend.
• Static Assets: Served from the public folder (HTML, CSS, images).
• Backend (Flask/Python):
• API Server: Highlight app.py which likely defines endpoints to process user requests.
• Utility Modules: Include resources.py that might help with API integration or resource management.
• API Integration: Internally, the backend calls INRIX’s Off Street Parking API and Position Stack’s Geocoding API.
• External Services:
• INRIX Off Street Parking API for retrieving parking structure details.
• Stack’s Geocoding API for translating user addresses to geographical coordinates.
Relationship & Data Flow
• The user interacts with the interface in the frontend (React).
• Frontend components dispatch actions (using Redux) that call services (via ApiService.js) to fetch or send data.
• The frontend makes HTTP requests to specific endpoints on the Flask backend (as defined in app.py).
• Upon receiving a request, the backend communicates with external APIs (INRIX and Position Stack) to retrieve and possibly transform/aggregate data.
• The backend then sends a response back to the frontend, where the Redux store is updated and UI is rendered accordingly.
Architectural Patterns and Technologies
• Client-Server model: Clearly separating the concerns of client (React) and server (Flask) components.
• The MVC-like approach in the frontend: with actions, reducers, and components handling different aspects of state management and view rendering.
• API Gateway or intermediary pattern in the backend: Aggregating calls to two external services.
• Use of asynchronous operations (e.g., API calls from both the frontend and backend).
• Technologies: React.js, Redux, Flask, Python, HTML/CSS, and supporting libraries for API calls.