# pras1978/fitness-journey-analyzer architecture

> Architecture diagram of the GitHub repository pras1978/fitness-journey-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pras1978/fitness-journey-analyzer
- Repository: https://github.com/pras1978/fitness-journey-analyzer

## Overview

The repository is a fitness-analysis application: users submit workout text, optional images, and fitness metrics; the backend stores inputs, runs exercise recognition, text analysis, and forecasting, stores those results, and returns them. A Streamlit dashboard and FastAPI data endpoints provide result views. The sampled backend route explicitly owns calls to storage and analysis services; the Streamlit excerpt shows a separate local processing path. README capabilities such as authentication and dedicated v1 routes are represented, but their implementation and wiring were not sampled.

Main entry points: [`backend/app/routes/process.py`](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/routes/process.py) (Full-entry route), [`frontend/streamlit_app.py`](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/streamlit_app.py) (Streamlit app), [`backend/app/main.py`](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/main.py) (FastAPI app), [`frontend/components/pages_dashboard.py`](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_dashboard.py) (Dashboard views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interfaces"]
  node_streamlit["Streamlit app<br/>[streamlit_app.py]"]
  node_api_client["API client<br/>[api_client.py]"]
  node_dashboard_views["Dashboard views<br/>[pages_dashboard.py]"]
  node_forecast_view["Forecast view<br/>[pages_forecasts.py]"]
  node_upload_view["Upload view<br/>[pages_upload.py]"]
  node_charts["Charts<br/>[charts.py]"]
end

subgraph group_api["API layer"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_entry_route["Full-entry route<br/>[process.py]"]
  node_auth_routes["Authentication routes<br/>[routes_auth.py]"]
  node_cv_routes["CV routes<br/>[routes_cv.py]"]
  node_dashboard_routes["Dashboard routes"]
  node_forecast_routes["Forecast routes<br/>[routes_forecast.py]"]
  node_metrics_routes["Metrics routes<br/>[routes_metrics.py]"]
  node_nlp_routes["NLP routes<br/>[routes_nlp.py]"]
  node_upload_routes["Upload routes<br/>[routes_uploads.py]"]
end

subgraph group_analysis["Analysis services"]
  node_cv_service["Exercise recognition<br/>[cv_service.py]"]
  node_nlp_service["Workout text analysis<br/>[nlp_service.py]"]
  node_forecast_service["Progress forecasting"]
  node_model_training["Model training<br/>[train.py]"]
  node_cv_inference["CV inference<br/>[inference.py]"]
  node_nlp_training["NLP fine-tuning<br/>[fine_tune.py]"]
  node_nlp_inference["NLP inference<br/>[inference.py]"]
  node_ts_training["Forecast training<br/>[train.py]"]
  node_ts_inference["Forecast inference<br/>[inference.py]"]
end

subgraph group_data["Persistence"]
  node_db_service["Fitness data access<br/>[db_service.py]"]
  node_sqlite[("SQLite connection<br/>[db.py]")]
end

node_user(("Fitness user"))

node_user -.->|"enters workouts"| node_streamlit
node_user -.->|"submits entry"| node_entry_route
node_fastapi -->|"registers router"| node_entry_route
node_entry_route -->|"stores inputs"| node_db_service
node_entry_route -->|"analyzes image"| node_cv_service
node_entry_route -->|"analyzes text"| node_nlp_service
node_entry_route -->|"forecasts progress"| node_forecast_service
node_db_service -->|"opens connection"| node_sqlite
node_fastapi -.->|"serves summary"| node_dashboard_routes
node_api_client -.->|"requests data"| node_fastapi
node_streamlit -.->|"renders dashboard"| node_dashboard_views
node_streamlit -.->|"renders upload"| node_upload_view
node_streamlit -.->|"renders forecasts"| node_forecast_view
node_dashboard_views -.->|"plots metrics"| node_charts
node_model_training -.->|"trains for"| node_cv_inference
node_nlp_training -.->|"trains for"| node_nlp_inference
node_ts_training -.->|"trains for"| node_ts_inference

click node_streamlit "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/streamlit_app.py"
click node_api_client "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/api_client.py"
click node_dashboard_views "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_dashboard.py"
click node_forecast_view "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_forecasts.py"
click node_upload_view "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_upload.py"
click node_charts "https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/charts.py"
click node_fastapi "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/main.py"
click node_entry_route "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/routes/process.py"
click node_auth_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_auth.py"
click node_cv_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_cv.py"
click node_dashboard_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_dashboard.py"
click node_forecast_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_forecast.py"
click node_metrics_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_metrics.py"
click node_nlp_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_nlp.py"
click node_upload_routes "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_uploads.py"
click node_cv_service "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/cv_service.py"
click node_nlp_service "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/nlp_service.py"
click node_forecast_service "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/forecast_service.py"
click node_db_service "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/db_service.py"
click node_sqlite "https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/db.py"
click node_model_training "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/cv/train.py"
click node_cv_inference "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/cv/inference.py"
click node_nlp_training "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/nlp/fine_tune.py"
click node_nlp_inference "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/nlp/inference.py"
click node_ts_training "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/ts/train.py"
click node_ts_inference "https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/ts/inference.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit,node_api_client,node_dashboard_views,node_forecast_view,node_upload_view,node_charts,node_user toneBlue
class node_fastapi,node_entry_route,node_auth_routes,node_cv_routes,node_dashboard_routes,node_forecast_routes,node_metrics_routes,node_nlp_routes,node_upload_routes toneAmber
class node_cv_service,node_nlp_service,node_forecast_service,node_model_training,node_cv_inference,node_nlp_training,node_nlp_inference,node_ts_training,node_ts_inference toneMint
class node_db_service,node_sqlite toneRose
```

## Components

### User interfaces

- [Streamlit app](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/streamlit_app.py): `frontend/streamlit_app.py`
- [API client](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/api_client.py): `frontend/components/api_client.py`
- [Dashboard views](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_dashboard.py): `frontend/components/pages_dashboard.py`
- [Forecast view](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_forecasts.py): `frontend/components/pages_forecasts.py`
- [Upload view](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/pages_upload.py): `frontend/components/pages_upload.py`
- [Charts](https://github.com/pras1978/fitness-journey-analyzer/blob/main/frontend/components/charts.py): `frontend/components/charts.py`

### API layer

- [FastAPI app](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/main.py): `backend/app/main.py`
- [Full-entry route](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/routes/process.py): `backend/app/routes/process.py`
- [Authentication routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_auth.py): `backend/app/api/v1/routes_auth.py`
- [CV routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_cv.py): `backend/app/api/v1/routes_cv.py`
- [Dashboard routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_dashboard.py): `backend/app/api/v1/routes_dashboard.py`
- [Forecast routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_forecast.py): `backend/app/api/v1/routes_forecast.py`
- [Metrics routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_metrics.py): `backend/app/api/v1/routes_metrics.py`
- [NLP routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_nlp.py): `backend/app/api/v1/routes_nlp.py`
- [Upload routes](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/api/v1/routes_uploads.py): `backend/app/api/v1/routes_uploads.py`

### Analysis services

- [Exercise recognition](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/cv_service.py): `backend/app/services/cv_service.py`
- [Workout text analysis](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/nlp_service.py): `backend/app/services/nlp_service.py`
- [Progress forecasting](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/forecast_service.py): `backend/app/services/forecast_service.py`
- [Model training](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/cv/train.py): `ml/cv/train.py`
- [CV inference](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/cv/inference.py): `ml/cv/inference.py`
- [NLP fine-tuning](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/nlp/fine_tune.py): `ml/nlp/fine_tune.py`
- [NLP inference](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/nlp/inference.py): `ml/nlp/inference.py`
- [Forecast training](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/ts/train.py): `ml/ts/train.py`
- [Forecast inference](https://github.com/pras1978/fitness-journey-analyzer/blob/main/ml/ts/inference.py): `ml/ts/inference.py`

### Persistence

- [Fitness data access](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/services/db_service.py): `backend/app/services/db_service.py`
- [SQLite connection](https://github.com/pras1978/fitness-journey-analyzer/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Fitness user**

## Connections

- Fitness user → Streamlit app: enters workouts (evidence: `README.md`)
- Fitness user → Full-entry route: submits entry (evidence: `README.md`)
- FastAPI app → Full-entry route: registers router (evidence: `backend/app/main.py`)
- Full-entry route → Fitness data access: stores inputs (evidence: `backend/app/routes/process.py`)
- Full-entry route → Exercise recognition: analyzes image (evidence: `backend/app/routes/process.py`)
- Full-entry route → Workout text analysis: analyzes text (evidence: `backend/app/routes/process.py`)
- Full-entry route → Progress forecasting: forecasts progress (evidence: `backend/app/routes/process.py`)
- Fitness data access → SQLite connection: opens connection (evidence: `backend/app/services/db_service.py`)
- FastAPI app → Dashboard routes: serves summary (evidence: `README.md`)
- API client → FastAPI app: requests data
- Streamlit app → Dashboard views: renders dashboard
- Streamlit app → Upload view: renders upload
- Streamlit app → Forecast view: renders forecasts
- Dashboard views → Charts: plots metrics
- Model training → CV inference: trains for
- NLP fine-tuning → NLP inference: trains for
- Forecast training → Forecast inference: trains for
