How fdilmr/running_companion works
Project Overview and Identification
• This is a full-stack application that serves as a personalized running companion. Its core functionality includes integrating with Strava to import running data, authenticating users, and providing predictive race analytics.
• The README and file tree indicate that the system combines a Python backend (using FastAPI or a similar framework), a JavaScript-based frontend (React), and additional modules (in the “second_part” directory) for data analytics, model training, and visualization.
High-Level Components
a. Frontend:
• The “frontend” directory shows the implementation of the user interface built with React.
• Key elements include public assets, React components, and services (API, auth, and Strava integrations) that provide connectivity to the backend.
b. Backend:
• The “backend” directory includes the FastAPI application (evidenced by files like app/main.py and utility modules).
• This portion handles:
• User Authentication (routes/auth.py),
• Strava data integration and other specialized endpoints (lambda_strava, lambda_user, and others),
• Data access and model management (models directory) and database interactions (see dynamodb.py in the database folder).
• It also has an extensive tests setup, build scripts, and configuration files (e.g., Procfile and requirements.txt).
c. Data Processing and Analytics:
• The “second_part” directory contains scripts and Jupyter notebooks for:
• Fetching and processing athlete data,
• Transforming and analyzing running activities,
• Race predictions and model training (race_prediction.py, train_model.py, etc.).
• This module integrates with external data sources (e.g., JSON files, SQL methods) and utilizes notebooks for iterative model development and visualization.
d. Additional Services and Cloud Integration:
• The README and configuration files (docker-compose.yml, dockerfile, buildspec.yml) imply deployment on AWS.
• Components to include:
• AWS EC2 or container service for backend deployment,
• AWS Lambda or SageMaker for model serving,
• AWS S3 for storing raw data and possibly hosting the frontend static assets,
• AWS services such as API Gateway and Cognito for authentication and routing if applicable.
Relationships and Interactions
• Connection between the backend and external services:
• The backend interacts with a NoSQL/SQL database (possibly PostgreSQL) and DynamoDB (as seen in dynamodb.py).
• Interactions with AWS Lambda for model predictions.
Architectural Patterns and Design Principles
• Separation of concerns by clearly segmenting the frontend, backend, and analytics modules.
• Use a microservices or modular architecture pattern where the backend services (authentication, Strava data processing, prediction) are represented as independent route modules.
• Optionally, show integration points for CI/CD pipelines (e.g., GitHub workflows, Docker configurations) and deployment automation onto AWS.