# montasir132/fit-log-app architecture

> Architecture diagram of the GitHub repository montasir132/fit-log-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/montasir132/fit-log-app
- Repository: https://github.com/montasir132/fit-log-app

## Overview

FITLOG lets users discover exercises, inspect details, add them to today’s plan or save them, then manage, sort, and act on those lists in My Plan. Exercise data comes from an external API; plan and saved-list state is held in React context. The README documents moving saved exercises into the plan and completion/removal actions. Some route and component wiring is based on README capabilities because those source files were not sampled; no persistent store is shown.

Main entry points: [`src/context/exerciseContext.tsx`](https://github.com/montasir132/fit-log-app/blob/main/src/context/exerciseContext.tsx) (Exercise state), [`src/app/my-plan/page.tsx`](https://github.com/montasir132/fit-log-app/blob/main/src/app/my-plan/page.tsx) (My Plan page), [`src/app/[id]/page.tsx`](https://github.com/montasir132/fit-log-app/blob/main/src/app/%5Bid%5D/page.tsx) (Exercise detail route), [`src/components/workouts/ExerciseLibDetailsCard.tsx`](https://github.com/montasir132/fit-log-app/blob/main/src/components/workouts/ExerciseLibDetailsCard.tsx) (Exercise details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Exercise discovery"]
  node_home["Workout page<br/>[page.tsx]"]
  node_library["Exercise library<br/>[Library.tsx]"]
  node_detailroute["Exercise detail route<br/>[page.tsx]"]
  node_detailcard["Exercise details"]
end

subgraph group_planning["Plan management"]
  node_addbutton["Add to plan"]
  node_savebutton["Save for later"]
  node_planroute["My Plan page<br/>[page.tsx]"]
  node_plancard["Plan exercise card<br/>[myPlanCard.tsx]"]
  node_planheader["Plan header<br/>[myPlanHeader.tsx]"]
  node_counter["Plan statistics<br/>[counter.tsx]"]
end

subgraph group_shared["Shared UI and state"]
  node_context["Exercise state"]
  node_navigation["Navigation<br/>[Navigation.tsx]"]
  node_layout["Application layout<br/>[layout.tsx]"]
end

subgraph group_integration["Data integration"]
  node_api["Exercise fetch<br/>[apiFetch.tsx]"]
  node_exerciseapi{{"Exercise API"}}
  node_toast{{"Toast notifications"}}
end

node_user(("User"))

node_user -->|"browses"| node_home
node_home -->|"renders"| node_library
node_user -->|"opens exercise"| node_detailroute
node_detailroute -->|"requests exercises"| node_api
node_api -->|"fetches data"| node_exerciseapi
node_detailroute -->|"renders exercise"| node_detailcard
node_detailcard -->|"offers action"| node_addbutton
node_detailcard -->|"offers action"| node_savebutton
node_addbutton -->|"updates plan"| node_context
node_savebutton -->|"updates saved list"| node_context
node_user -->|"manages lists"| node_planroute
node_planroute -->|"reads and updates"| node_context
node_planroute -->|"renders exercises"| node_plancard
node_planroute -->|"provides exercises"| node_counter
node_planroute -->|"renders"| node_planheader
node_plancard -->|"dispatches actions"| node_context
node_navigation -->|"reads list counts"| node_context
node_layout -->|"provides state"| node_context
node_layout -->|"renders"| node_navigation
node_context -.->|"shows feedback"| node_toast
node_savebutton -.->|"shows feedback"| node_toast

click node_home "https://github.com/montasir132/fit-log-app/blob/main/src/app/page.tsx"
click node_library "https://github.com/montasir132/fit-log-app/blob/main/src/components/workouts/Library.tsx"
click node_detailroute "https://github.com/montasir132/fit-log-app/blob/main/src/app/%5Bid%5D/page.tsx"
click node_detailcard "https://github.com/montasir132/fit-log-app/blob/main/src/components/workouts/ExerciseLibDetailsCard.tsx"
click node_api "https://github.com/montasir132/fit-log-app/blob/main/src/components/api/apiFetch.tsx"
click node_addbutton "https://github.com/montasir132/fit-log-app/blob/main/src/components/btnInteraction/addTodayPlanBtn.tsx"
click node_savebutton "https://github.com/montasir132/fit-log-app/blob/main/src/components/btnInteraction/saveForLaterBtn.tsx"
click node_planroute "https://github.com/montasir132/fit-log-app/blob/main/src/app/my-plan/page.tsx"
click node_plancard "https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/myPlanCard.tsx"
click node_planheader "https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/myPlanHeader.tsx"
click node_counter "https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/counter.tsx"
click node_context "https://github.com/montasir132/fit-log-app/blob/main/src/context/exerciseContext.tsx"
click node_navigation "https://github.com/montasir132/fit-log-app/blob/main/src/components/universal/Navigation.tsx"
click node_layout "https://github.com/montasir132/fit-log-app/blob/main/src/app/layout.tsx"

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_home,node_library,node_detailroute,node_detailcard,node_user toneBlue
class node_addbutton,node_savebutton,node_planroute,node_plancard,node_planheader,node_counter toneAmber
class node_context,node_navigation,node_layout toneMint
class node_api,node_exerciseapi,node_toast toneRose
```

## Components

### Exercise discovery

- [Workout page](https://github.com/montasir132/fit-log-app/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Exercise library](https://github.com/montasir132/fit-log-app/blob/main/src/components/workouts/Library.tsx): `src/components/workouts/Library.tsx`
- [Exercise detail route](https://github.com/montasir132/fit-log-app/blob/main/src/app/%5Bid%5D/page.tsx): `src/app/[id]/page.tsx`
- [Exercise details](https://github.com/montasir132/fit-log-app/blob/main/src/components/workouts/ExerciseLibDetailsCard.tsx): `src/components/workouts/ExerciseLibDetailsCard.tsx`

### Plan management

- [Add to plan](https://github.com/montasir132/fit-log-app/blob/main/src/components/btnInteraction/addTodayPlanBtn.tsx): `src/components/btnInteraction/addTodayPlanBtn.tsx`
- [Save for later](https://github.com/montasir132/fit-log-app/blob/main/src/components/btnInteraction/saveForLaterBtn.tsx): `src/components/btnInteraction/saveForLaterBtn.tsx`
- [My Plan page](https://github.com/montasir132/fit-log-app/blob/main/src/app/my-plan/page.tsx): `src/app/my-plan/page.tsx`
- [Plan exercise card](https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/myPlanCard.tsx): `src/components/myPlan/myPlanCard.tsx`
- [Plan header](https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/myPlanHeader.tsx): `src/components/myPlan/myPlanHeader.tsx`
- [Plan statistics](https://github.com/montasir132/fit-log-app/blob/main/src/components/myPlan/counter.tsx): `src/components/myPlan/counter.tsx`

### Shared UI and state

- [Exercise state](https://github.com/montasir132/fit-log-app/blob/main/src/context/exerciseContext.tsx): `src/context/exerciseContext.tsx`
- [Navigation](https://github.com/montasir132/fit-log-app/blob/main/src/components/universal/Navigation.tsx): `src/components/universal/Navigation.tsx`
- [Application layout](https://github.com/montasir132/fit-log-app/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### Data integration

- [Exercise fetch](https://github.com/montasir132/fit-log-app/blob/main/src/components/api/apiFetch.tsx): `src/components/api/apiFetch.tsx`
- **Exercise API**
- **Toast notifications**

### Other components

- **User**

## Connections

- User → Workout page: browses
- Workout page → Exercise library: renders
- User → Exercise detail route: opens exercise
- Exercise detail route → Exercise fetch: requests exercises
- Exercise fetch → Exercise API: fetches data
- Exercise detail route → Exercise details: renders exercise
- Exercise details → Add to plan: offers action
- Exercise details → Save for later: offers action
- Add to plan → Exercise state: updates plan
- Save for later → Exercise state: updates saved list
- User → My Plan page: manages lists
- My Plan page → Exercise state: reads and updates
- My Plan page → Plan exercise card: renders exercises
- My Plan page → Plan statistics: provides exercises
- My Plan page → Plan header: renders
- Plan exercise card → Exercise state: dispatches actions
- Navigation → Exercise state: reads list counts
- Application layout → Exercise state: provides state
- Application layout → Navigation: renders
- Exercise state → Toast notifications: shows feedback
- Save for later → Toast notifications: shows feedback
