# 04-varsha/fitlog architecture

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

- Interactive diagram: https://gitdiagram.com/04-varsha/fitlog
- Repository: https://github.com/04-varsha/fitlog

## Overview

FitLog is a workout tracker: users create, browse, filter, edit, and delete workouts, then review weekly totals, workout-type breakdowns, and streaks. The React app routes these workflows to API-backed pages; the Express API handles workout CRUD and weekly aggregation through a Mongoose model, while the weekly goal is stored in the browser. README capabilities such as responsive layout and motivational quotes are included; backend details beyond the sampled routes and model are limited to the shown source.

Main entry points: [`client/src/App.jsx`](https://github.com/04-varsha/fitlog/blob/main/client/src/App.jsx) (App routing), [`client/src/pages/Stats.jsx`](https://github.com/04-varsha/fitlog/blob/main/client/src/pages/Stats.jsx) (Weekly statistics), [`client/src/api.js`](https://github.com/04-varsha/fitlog/blob/main/client/src/api.js) (Axios API client), [`client/src/pages/ExerciseForm.jsx`](https://github.com/04-varsha/fitlog/blob/main/client/src/pages/ExerciseForm.jsx) (Workout form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React application"]
  node_app["App routing<br/>[App.jsx]"]
  node_navbar["Navigation bar<br/>[NavBar.jsx]"]
  node_quote["Motivational quote"]
end

subgraph group_workouts["Workout workflows"]
  node_form["Workout form<br/>[ExerciseForm.jsx]"]
  node_listing["Workout list<br/>[ExerciseList.jsx]"]
  node_card["Workout card<br/>[ExerciseCard.jsx]"]
  node_utils["Date and streak utilities<br/>[utils.js]"]
end

subgraph group_insights["Progress insights"]
  node_stats["Weekly statistics<br/>[Stats.jsx]"]
  node_goal["Weekly goal bar<br/>[GoalBar.jsx]"]
  node_statcard["Stat cards<br/>[StatCard.jsx]"]
end

subgraph group_backend["API and persistence"]
  node_api["Axios API client<br/>[api.js]"]
  node_server["Express server<br/>[server.js]"]
  node_routes["Workout API routes<br/>[exercises.js]"]
  node_model["Exercise model<br/>[Exercise.js]"]
end

node_user(("Tracker user"))
node_mongo[("MongoDB")]
node_localstorage[("Browser local storage")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_quote
node_app -->|"routes to"| node_listing
node_app -->|"routes to"| node_form
node_app -->|"routes to"| node_stats
node_form -->|"sends requests"| node_api
node_listing -->|"loads and deletes"| node_api
node_listing -->|"renders"| node_card
node_form -->|"uses date helpers"| node_utils
node_stats -->|"loads summaries"| node_api
node_stats -->|"calculates streaks"| node_utils
node_stats -->|"renders"| node_goal
node_stats -->|"renders"| node_statcard
node_stats -->|"reads and writes goal"| node_localstorage
node_api -.->|"calls API"| node_server
node_server -->|"mounts routes"| node_routes
node_server -->|"connects"| node_mongo
node_routes -->|"queries and updates"| node_model
node_model -.->|"persists documents"| node_mongo

click node_app "https://github.com/04-varsha/fitlog/blob/main/client/src/App.jsx"
click node_navbar "https://github.com/04-varsha/fitlog/blob/main/client/src/components/NavBar.jsx"
click node_quote "https://github.com/04-varsha/fitlog/blob/main/client/src/components/MotivationQuote.jsx"
click node_form "https://github.com/04-varsha/fitlog/blob/main/client/src/pages/ExerciseForm.jsx"
click node_listing "https://github.com/04-varsha/fitlog/blob/main/client/src/pages/ExerciseList.jsx"
click node_card "https://github.com/04-varsha/fitlog/blob/main/client/src/components/ExerciseCard.jsx"
click node_utils "https://github.com/04-varsha/fitlog/blob/main/client/src/utils.js"
click node_api "https://github.com/04-varsha/fitlog/blob/main/client/src/api.js"
click node_server "https://github.com/04-varsha/fitlog/blob/main/server/server.js"
click node_routes "https://github.com/04-varsha/fitlog/blob/main/server/routes/exercises.js"
click node_model "https://github.com/04-varsha/fitlog/blob/main/server/models/Exercise.js"
click node_stats "https://github.com/04-varsha/fitlog/blob/main/client/src/pages/Stats.jsx"
click node_goal "https://github.com/04-varsha/fitlog/blob/main/client/src/components/GoalBar.jsx"
click node_statcard "https://github.com/04-varsha/fitlog/blob/main/client/src/components/StatCard.jsx"

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_app,node_navbar,node_quote,node_user toneBlue
class node_form,node_listing,node_card,node_utils,node_mongo,node_localstorage toneAmber
class node_stats,node_goal,node_statcard toneMint
class node_api,node_server,node_routes,node_model toneRose
```

## Components

### React application

- [App routing](https://github.com/04-varsha/fitlog/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Navigation bar](https://github.com/04-varsha/fitlog/blob/main/client/src/components/NavBar.jsx): `client/src/components/NavBar.jsx`
- [Motivational quote](https://github.com/04-varsha/fitlog/blob/main/client/src/components/MotivationQuote.jsx): `client/src/components/MotivationQuote.jsx`

### Workout workflows

- [Workout form](https://github.com/04-varsha/fitlog/blob/main/client/src/pages/ExerciseForm.jsx): `client/src/pages/ExerciseForm.jsx`
- [Workout list](https://github.com/04-varsha/fitlog/blob/main/client/src/pages/ExerciseList.jsx): `client/src/pages/ExerciseList.jsx`
- [Workout card](https://github.com/04-varsha/fitlog/blob/main/client/src/components/ExerciseCard.jsx): `client/src/components/ExerciseCard.jsx`
- [Date and streak utilities](https://github.com/04-varsha/fitlog/blob/main/client/src/utils.js): `client/src/utils.js`

### Progress insights

- [Weekly statistics](https://github.com/04-varsha/fitlog/blob/main/client/src/pages/Stats.jsx): `client/src/pages/Stats.jsx`
- [Weekly goal bar](https://github.com/04-varsha/fitlog/blob/main/client/src/components/GoalBar.jsx): `client/src/components/GoalBar.jsx`
- [Stat cards](https://github.com/04-varsha/fitlog/blob/main/client/src/components/StatCard.jsx): `client/src/components/StatCard.jsx`

### API and persistence

- [Axios API client](https://github.com/04-varsha/fitlog/blob/main/client/src/api.js): `client/src/api.js`
- [Express server](https://github.com/04-varsha/fitlog/blob/main/server/server.js): `server/server.js`
- [Workout API routes](https://github.com/04-varsha/fitlog/blob/main/server/routes/exercises.js): `server/routes/exercises.js`
- [Exercise model](https://github.com/04-varsha/fitlog/blob/main/server/models/Exercise.js): `server/models/Exercise.js`

### Other components

- **Tracker user**
- **MongoDB**
- **Browser local storage**

## Connections

- Tracker user → App routing: uses (evidence: `README.md`)
- App routing → Navigation bar: renders (evidence: `client/src/App.jsx`)
- App routing → Motivational quote: renders (evidence: `client/src/App.jsx`)
- App routing → Workout list: routes to (evidence: `client/src/App.jsx`)
- App routing → Workout form: routes to (evidence: `client/src/App.jsx`)
- App routing → Weekly statistics: routes to (evidence: `client/src/App.jsx`)
- Workout form → Axios API client: sends requests (evidence: `client/src/pages/ExerciseForm.jsx`)
- Workout list → Axios API client: loads and deletes (evidence: `client/src/pages/ExerciseList.jsx`)
- Workout list → Workout card: renders (evidence: `client/src/pages/ExerciseList.jsx`)
- Workout form → Date and streak utilities: uses date helpers (evidence: `client/src/pages/ExerciseForm.jsx`)
- Weekly statistics → Axios API client: loads summaries (evidence: `client/src/pages/Stats.jsx`)
- Weekly statistics → Date and streak utilities: calculates streaks (evidence: `client/src/pages/Stats.jsx`)
- Weekly statistics → Weekly goal bar: renders (evidence: `client/src/pages/Stats.jsx`)
- Weekly statistics → Stat cards: renders (evidence: `client/src/pages/Stats.jsx`)
- Weekly statistics → Browser local storage: reads and writes goal (evidence: `client/src/pages/Stats.jsx`)
- Axios API client → Express server: calls API
- Express server → Workout API routes: mounts routes (evidence: `server/server.js`)
- Express server → MongoDB: connects (evidence: `server/server.js`)
- Workout API routes → Exercise model: queries and updates (evidence: `server/routes/exercises.js`)
- Exercise model → MongoDB: persists documents
