# maryammiraei/fitness architecture

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

- Interactive diagram: https://gitdiagram.com/maryammiraei/fitness
- Repository: https://github.com/maryammiraei/fitness

## Overview

This is a React fitness-tracking frontend. Users can sign up or sign in, complete a staged profile setup, and navigate the main app to view dashboard metrics, log food and activity, or manage their profile. Food logging has a visible API-backed path; the configured API client attaches the persisted auth token. The source index documents the page-to-component structure, but several data and activity modules were not sampled, so their internal connections are not asserted.

Main entry points: [`src/App.tsx`](https://github.com/maryammiraei/fitness/blob/main/src/App.tsx) (Route setup), [`src/pages/Activity.tsx`](https://github.com/maryammiraei/fitness/blob/main/src/pages/Activity.tsx) (Activity page), [`src/pages/GetDataUser.tsx`](https://github.com/maryammiraei/fitness/blob/main/src/pages/GetDataUser.tsx) (Profile setup), [`src/pages/Profile.tsx`](https://github.com/maryammiraei/fitness/blob/main/src/pages/Profile.tsx) (Profile page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_router["Route setup<br/>[App.tsx]"]
  node_mainlayout["Main layout<br/>[MainLayout.tsx]"]
  node_sidebar["Sidebar navigation<br/>[SidebarMenu.tsx]"]
  node_bottommenu["Bottom navigation<br/>[BottomMenu.tsx]"]
end

subgraph group_account["Account and onboarding"]
  node_signin["Sign in<br/>[Signin.tsx]"]
  node_signup["Sign up<br/>[Signup.tsx]"]
  node_onboarding["Profile setup<br/>[GetDataUser.tsx]"]
  node_step1["Setup step one"]
  node_step2["Setup step two"]
  node_step3["Goals and targets"]
  node_profilepage["Profile page<br/>[Profile.tsx]"]
  node_profileview["Profile view<br/>[ProfileView.tsx]"]
  node_profileedit["Profile editor<br/>[ProfileEdit.tsx]"]
end

subgraph group_tracking["Fitness tracking"]
  node_home["Dashboard<br/>[Home.tsx]"]
  node_metrics["Body metrics"]
  node_charts["Dashboard charts<br/>[ChartData.tsx]"]
  node_foodpage["Food log page<br/>[Food.tsx]"]
  node_foodlist["Food log list<br/>[AddFoodList.tsx]"]
  node_foodempty["Empty food state"]
  node_foodmodal["Food entry form<br/>[AddFoodModal.tsx]"]
  node_foodbottom["Food entry action<br/>[AddFoodBottom.tsx]"]
  node_activitypage["Activity page<br/>[Activity.tsx]"]
  node_activitylist["Activity list"]
  node_activitymodal["Activity entry form"]
  node_activitybottom["Activity entry action"]
  node_activityempty["Empty activity state"]
end

subgraph group_shared["API and state"]
  node_authapi["Auth API<br/>[auth.ts]"]
  node_foodapi["Food log API<br/>[food.ts]"]
  node_authstore[("Auth state<br/>[useAuthStore.ts]")]
  node_httpclient["HTTP client<br/>[axios.ts]"]
end

node_user(("User"))
node_backend["Strapi API"]

node_user -->|"opens app"| node_router
node_router -->|"routes dashboard"| node_mainlayout
node_router -->|"routes sign-in"| node_signin
node_router -->|"routes sign-up"| node_signup
node_router -->|"routes setup"| node_onboarding
node_router -->|"routes profile"| node_profilepage
node_mainlayout -->|"renders"| node_sidebar
node_mainlayout -->|"renders"| node_bottommenu
node_signin -->|"submits credentials"| node_authapi
node_signup -->|"registers account"| node_authapi
node_signin -->|"stores token"| node_authstore
node_signup -->|"stores token"| node_authstore
node_authapi -->|"sends requests"| node_httpclient
node_httpclient -->|"reads token"| node_authstore
node_httpclient -->|"calls API"| node_backend
node_authapi -->|"auth endpoints"| node_backend
node_onboarding -->|"renders"| node_step1
node_onboarding -->|"renders"| node_step2
node_onboarding -->|"renders"| node_step3
node_home -->|"renders"| node_metrics
node_home -->|"renders"| node_charts
node_foodpage -->|"renders"| node_foodlist
node_foodpage -->|"renders"| node_foodmodal
node_foodpage -->|"renders"| node_foodbottom
node_foodlist -->|"loads and updates"| node_foodapi
node_foodlist -->|"renders empty state"| node_foodempty
node_foodmodal -->|"saves food log"| node_foodapi
node_foodapi -->|"sends requests"| node_httpclient
node_foodapi -->|"reads and writes logs"| node_backend
node_activitypage -->|"renders"| node_activitylist
node_activitypage -->|"renders"| node_activitymodal
node_activitypage -->|"renders"| node_activitybottom
node_activitypage -.->|"empty state use"| node_activityempty
node_profilepage -->|"renders view"| node_profileview
node_profilepage -->|"renders editor"| node_profileedit
node_profilepage -->|"logs out"| node_authstore

click node_router "https://github.com/maryammiraei/fitness/blob/main/src/App.tsx"
click node_mainlayout "https://github.com/maryammiraei/fitness/blob/main/src/layouts/MainLayout.tsx"
click node_sidebar "https://github.com/maryammiraei/fitness/blob/main/src/components/SidebarMenu.tsx"
click node_bottommenu "https://github.com/maryammiraei/fitness/blob/main/src/components/BottomMenu.tsx"
click node_signin "https://github.com/maryammiraei/fitness/blob/main/src/pages/Signin.tsx"
click node_signup "https://github.com/maryammiraei/fitness/blob/main/src/pages/Signup.tsx"
click node_authapi "https://github.com/maryammiraei/fitness/blob/main/src/api/auth.ts"
click node_onboarding "https://github.com/maryammiraei/fitness/blob/main/src/pages/GetDataUser.tsx"
click node_step1 "https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep1.tsx"
click node_step2 "https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep2.tsx"
click node_step3 "https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep3.tsx"
click node_home "https://github.com/maryammiraei/fitness/blob/main/src/pages/Home.tsx"
click node_metrics "https://github.com/maryammiraei/fitness/blob/main/src/components/home/BodyMetricsCard.tsx"
click node_charts "https://github.com/maryammiraei/fitness/blob/main/src/components/home/ChartData.tsx"
click node_foodpage "https://github.com/maryammiraei/fitness/blob/main/src/pages/Food.tsx"
click node_foodlist "https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodList.tsx"
click node_foodempty "https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodListEmpty.tsx"
click node_foodmodal "https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodModal.tsx"
click node_foodbottom "https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodBottom.tsx"
click node_foodapi "https://github.com/maryammiraei/fitness/blob/main/src/api/food.ts"
click node_activitypage "https://github.com/maryammiraei/fitness/blob/main/src/pages/Activity.tsx"
click node_activitylist "https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityList.tsx"
click node_activitymodal "https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityModal.tsx"
click node_activitybottom "https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityBottom.tsx"
click node_activityempty "https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityListEmpty.tsx"
click node_profilepage "https://github.com/maryammiraei/fitness/blob/main/src/pages/Profile.tsx"
click node_profileview "https://github.com/maryammiraei/fitness/blob/main/src/components/profile/ProfileView.tsx"
click node_profileedit "https://github.com/maryammiraei/fitness/blob/main/src/components/profile/ProfileEdit.tsx"
click node_authstore "https://github.com/maryammiraei/fitness/blob/main/src/store/useAuthStore.ts"
click node_httpclient "https://github.com/maryammiraei/fitness/blob/main/src/api/axios.ts"

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_router,node_mainlayout,node_sidebar,node_bottommenu,node_user toneBlue
class node_signin,node_signup,node_onboarding,node_step1,node_step2,node_step3,node_profilepage,node_profileview,node_profileedit toneAmber
class node_home,node_metrics,node_charts,node_foodpage,node_foodlist,node_foodempty,node_foodmodal,node_foodbottom,node_activitypage,node_activitylist,node_activitymodal,node_activitybottom,node_activityempty,node_backend toneMint
class node_authapi,node_foodapi,node_authstore,node_httpclient toneRose
```

## Components

### App navigation

- [Route setup](https://github.com/maryammiraei/fitness/blob/main/src/App.tsx): `src/App.tsx`
- [Main layout](https://github.com/maryammiraei/fitness/blob/main/src/layouts/MainLayout.tsx): `src/layouts/MainLayout.tsx`
- [Sidebar navigation](https://github.com/maryammiraei/fitness/blob/main/src/components/SidebarMenu.tsx): `src/components/SidebarMenu.tsx`
- [Bottom navigation](https://github.com/maryammiraei/fitness/blob/main/src/components/BottomMenu.tsx): `src/components/BottomMenu.tsx`

### Account and onboarding

- [Sign in](https://github.com/maryammiraei/fitness/blob/main/src/pages/Signin.tsx): `src/pages/Signin.tsx`
- [Sign up](https://github.com/maryammiraei/fitness/blob/main/src/pages/Signup.tsx): `src/pages/Signup.tsx`
- [Profile setup](https://github.com/maryammiraei/fitness/blob/main/src/pages/GetDataUser.tsx): `src/pages/GetDataUser.tsx`
- [Setup step one](https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep1.tsx): `src/components/getUserData/GetDataUserStep1.tsx`
- [Setup step two](https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep2.tsx): `src/components/getUserData/GetDataUserStep2.tsx`
- [Goals and targets](https://github.com/maryammiraei/fitness/blob/main/src/components/getUserData/GetDataUserStep3.tsx): `src/components/getUserData/GetDataUserStep3.tsx`
- [Profile page](https://github.com/maryammiraei/fitness/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Profile view](https://github.com/maryammiraei/fitness/blob/main/src/components/profile/ProfileView.tsx): `src/components/profile/ProfileView.tsx`
- [Profile editor](https://github.com/maryammiraei/fitness/blob/main/src/components/profile/ProfileEdit.tsx): `src/components/profile/ProfileEdit.tsx`

### Fitness tracking

- [Dashboard](https://github.com/maryammiraei/fitness/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Body metrics](https://github.com/maryammiraei/fitness/blob/main/src/components/home/BodyMetricsCard.tsx): `src/components/home/BodyMetricsCard.tsx`
- [Dashboard charts](https://github.com/maryammiraei/fitness/blob/main/src/components/home/ChartData.tsx): `src/components/home/ChartData.tsx`
- [Food log page](https://github.com/maryammiraei/fitness/blob/main/src/pages/Food.tsx): `src/pages/Food.tsx`
- [Food log list](https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodList.tsx): `src/components/food/AddFoodList.tsx`
- [Empty food state](https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodListEmpty.tsx): `src/components/food/AddFoodListEmpty.tsx`
- [Food entry form](https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodModal.tsx): `src/components/food/AddFoodModal.tsx`
- [Food entry action](https://github.com/maryammiraei/fitness/blob/main/src/components/food/AddFoodBottom.tsx): `src/components/food/AddFoodBottom.tsx`
- [Activity page](https://github.com/maryammiraei/fitness/blob/main/src/pages/Activity.tsx): `src/pages/Activity.tsx`
- [Activity list](https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityList.tsx): `src/components/activity/AddActivityList.tsx`
- [Activity entry form](https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityModal.tsx): `src/components/activity/AddActivityModal.tsx`
- [Activity entry action](https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityBottom.tsx): `src/components/activity/AddActivityBottom.tsx`
- [Empty activity state](https://github.com/maryammiraei/fitness/blob/main/src/components/activity/AddActivityListEmpty.tsx): `src/components/activity/AddActivityListEmpty.tsx`

### API and state

- [Auth API](https://github.com/maryammiraei/fitness/blob/main/src/api/auth.ts): `src/api/auth.ts`
- [Food log API](https://github.com/maryammiraei/fitness/blob/main/src/api/food.ts): `src/api/food.ts`
- [Auth state](https://github.com/maryammiraei/fitness/blob/main/src/store/useAuthStore.ts): `src/store/useAuthStore.ts`
- [HTTP client](https://github.com/maryammiraei/fitness/blob/main/src/api/axios.ts): `src/api/axios.ts`

### Other components

- **User**
- **Strapi API**

## Connections

- User → Route setup: opens app (evidence: `src/App.tsx`)
- Route setup → Main layout: routes dashboard (evidence: `src/App.tsx`)
- Route setup → Sign in: routes sign-in (evidence: `src/App.tsx`)
- Route setup → Sign up: routes sign-up (evidence: `src/App.tsx`)
- Route setup → Profile setup: routes setup (evidence: `src/App.tsx`)
- Route setup → Profile page: routes profile (evidence: `src/App.tsx`)
- Main layout → Sidebar navigation: renders (evidence: `src/layouts/MainLayout.tsx`)
- Main layout → Bottom navigation: renders (evidence: `src/layouts/MainLayout.tsx`)
- Sign in → Auth API: submits credentials (evidence: `src/pages/Signin.tsx`)
- Sign up → Auth API: registers account (evidence: `src/pages/Signup.tsx`)
- Sign in → Auth state: stores token (evidence: `src/pages/Signin.tsx`)
- Sign up → Auth state: stores token (evidence: `src/pages/Signup.tsx`)
- Auth API → HTTP client: sends requests (evidence: `src/api/auth.ts`)
- HTTP client → Auth state: reads token (evidence: `src/api/axios.ts`)
- HTTP client → Strapi API: calls API (evidence: `src/api/axios.ts`)
- Auth API → Strapi API: auth endpoints (evidence: `src/api/auth.ts`)
- Profile setup → Setup step one: renders (evidence: `src/pages/GetDataUser.tsx`)
- Profile setup → Setup step two: renders (evidence: `src/pages/GetDataUser.tsx`)
- Profile setup → Goals and targets: renders (evidence: `src/pages/GetDataUser.tsx`)
- Dashboard → Body metrics: renders (evidence: `src/pages/Home.tsx`)
- Dashboard → Dashboard charts: renders (evidence: `src/pages/Home.tsx`)
- Food log page → Food log list: renders (evidence: `src/pages/Food.tsx`)
- Food log page → Food entry form: renders (evidence: `src/pages/Food.tsx`)
- Food log page → Food entry action: renders (evidence: `src/pages/Food.tsx`)
- Food log list → Food log API: loads and updates (evidence: `src/components/food/AddFoodList.tsx`)
- Food log list → Empty food state: renders empty state (evidence: `src/components/food/AddFoodList.tsx`)
- Food entry form → Food log API: saves food log (evidence: `src/components/food/AddFoodModal.tsx`)
- Food log API → HTTP client: sends requests (evidence: `src/api/food.ts`)
- Food log API → Strapi API: reads and writes logs (evidence: `src/api/food.ts`)
- Activity page → Activity list: renders (evidence: `src/pages/Activity.tsx`)
- Activity page → Activity entry form: renders (evidence: `src/pages/Activity.tsx`)
- Activity page → Activity entry action: renders (evidence: `src/pages/Activity.tsx`)
- Activity page → Empty activity state: empty state use
- Profile page → Profile view: renders view (evidence: `src/pages/Profile.tsx`)
- Profile page → Profile editor: renders editor (evidence: `src/pages/Profile.tsx`)
- Profile page → Auth state: logs out (evidence: `src/pages/Profile.tsx`)
