Running Training Analyzer is a web application for importing, storing, and analyzing running workouts. It provides a Django backend API and a React single-page frontend. Optional integrations include Strava OAuth (connect/sync account) and Stripe (payments/plans).
- Frontend (React): user interface, calls backend endpoints via HTTP.
- Backend (Django): API endpoints, auth/session handling, data processing, and persistence.
- Database:
- PostgreSQL is the primary (recommended) database.
- SQLite is supported for quick local development.
-
backend/manage.py– Django entry pointrequirements.txt– Python dependenciespytest.ini– pytest configurationrunning_analyzer/– project config (settings/urls/wsgi/asgi)users/– registration/login + user profile + Strava OAuth endpointsworkouts/– workouts storage and import endpointsworkout_analysis/– analysis utilities/endpointsevents/+events_scraper.py– events feature and scraping logicpayments/– Stripe checkout/payment flowsocial/– social feed models/endpointssample_workouts/– example workout files used for local testing
-
frontend/package.json– JS dependencies and scriptspublic/– CRA public assetssrc/App.jsx– main app componentcomponents/– UI componentsstyles/– stylingutils/– helper functions
- Auth: register/login, sessions/cookies.
- Workouts: upload/import workout data → store → display → analyze.
- Workout analysis: compute summary stats and derived metrics based on stored data.
- Events: show upcoming running events (data sourced from a public listing via a scraper; if you publish this repository, ensure you comply with the source’s ToS and provide attribution if required).
- Strava (optional): connect account via OAuth and use credentials provided via environment variables.
- Payments (optional): create a Stripe Checkout session and confirm payments.
- Backend: Python, Django
- Frontend: React, JavaScript (Create React App)
- Database: SQLite / PostgreSQL
- Maps/UI (frontend): Leaflet / react-leaflet (if enabled by the UI)
- Testing:
- Backend: pytest
- Frontend: Cypress (E2E)
Backend (backend/requirements.txt):
- Django 5.2.7
- psycopg[binary] 3.2.12
- django-cors-headers 4.x
- requests 2.x
- fitparse 1.x
- stripe 10.x
- Pillow 10.x
Frontend (frontend/package.json):
- React 18.2
- react-scripts 5.0.1
- Leaflet 1.9.4
- react-leaflet 4.2.1
- Cypress 15.x (dev dependency)
- Python 3.x
- Node.js + npm
- (Optional) PostgreSQL for Postgres-based setup
Recommended for a smooth local dev experience:
- PostgreSQL installed and running locally if you set
USE_POSTGRES=1 - Otherwise use SQLite (default)
Backend:
cd backend
python -m pip install -r requirements.txt
python manage.py migrate
python manage.py runserver 8000Frontend:
cd frontend
npm install
npm startPorts (defaults):
- Frontend: http://127.0.0.1:3000/
- Backend: http://127.0.0.1:8000/
