# shaikat0079/my-fitlog architecture

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

- Interactive diagram: https://gitdiagram.com/shaikat0079/my-fitlog
- Repository: https://github.com/shaikat0079/my-fitlog

## Overview

FitLog is a workout-tracking web app. Users browse an API-backed workout library, open workout details, then add workouts to today’s plan or save them. The plan view summarizes the day and lets users sort, complete, or remove entries. Shared React context holds plan and saved lists in memory; no persistence is shown. The graph also includes the app shell and documented error handling. Relationships for unsampled error routes are based on README documentation; source excerpts do not show every route or integration.

Main entry points: [`app/workouts/[id]/page.tsx`](https://github.com/shaikat0079/my-fitlog/blob/main/app/workouts/%5Bid%5D/page.tsx) (Workout details), [`context/WorkoutsProvider.tsx`](https://github.com/shaikat0079/my-fitlog/blob/main/context/WorkoutsProvider.tsx) (Workout state), [`app/home/Workouts.tsx`](https://github.com/shaikat0079/my-fitlog/blob/main/app/home/Workouts.tsx) (Workout listing), [`app/layout.tsx`](https://github.com/shaikat0079/my-fitlog/blob/main/app/layout.tsx) (Root layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Workout discovery"]
  node_home["Home route<br/>[page.tsx]"]
  node_banner["Hero banner<br/>[Banner.tsx]"]
  node_workout_list["Workout listing<br/>[Workouts.tsx]"]
  node_workout_card["Workout card<br/>[WorkoutCard.tsx]"]
  node_workout_details["Workout details<br/>[page.tsx]"]
end

subgraph group_planning["Plan and saved lists"]
  node_plan_page["Plan page<br/>[page.tsx]"]
  node_plan_tabs["Plan and saved tabs<br/>[Tabs.tsx]"]
  node_today_button["Add to plan"]
  node_saved_button["Save workout"]
  node_workout_state["Workout state"]
end

subgraph group_shell["Application shell"]
  node_navbar["Navigation bar<br/>[Navbar.tsx]"]
  node_plan_badge["Plan badge<br/>[PlanBadge.tsx]"]
  node_save_badge["Saved badge<br/>[SaveBadge.tsx]"]
  node_app_layout["Root layout<br/>[layout.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_error_routes["Error and not-found routes<br/>[error.tsx]"]
end

subgraph group_domain["Workout domain"]
  node_workout_type["Workout data type<br/>[workout.type.ts]"]
end

node_user(("User"))
node_workout_api["Workout REST API"]

node_user -->|"browses"| node_home
node_user -->|"manages plan"| node_plan_page
node_home -->|"renders"| node_banner
node_home -->|"renders"| node_workout_list
node_workout_list -->|"fetches workouts"| node_workout_api
node_workout_list -->|"renders cards"| node_workout_card
node_workout_card -->|"links to details"| node_workout_details
node_workout_details -->|"fetches workout"| node_workout_api
node_workout_details -->|"renders"| node_today_button
node_workout_details -->|"renders"| node_saved_button
node_plan_page -->|"reads plan"| node_workout_state
node_plan_page -->|"renders"| node_plan_tabs
node_plan_tabs -->|"reads and updates"| node_workout_state
node_today_button -->|"adds workout"| node_workout_state
node_saved_button -->|"saves workout"| node_workout_state
node_navbar -->|"renders"| node_plan_badge
node_navbar -->|"renders"| node_save_badge
node_app_layout -->|"renders"| node_navbar
node_app_layout -->|"renders"| node_footer
node_app_layout -->|"provides context"| node_workout_state
node_workout_details -->|"handles failures"| node_error_routes
node_workout_list -->|"uses workout shape"| node_workout_type
node_workout_details -->|"uses workout shape"| node_workout_type
node_workout_state -->|"stores workouts"| node_workout_type

click node_home "https://github.com/shaikat0079/my-fitlog/blob/main/app/page.tsx"
click node_banner "https://github.com/shaikat0079/my-fitlog/blob/main/app/home/Banner.tsx"
click node_workout_list "https://github.com/shaikat0079/my-fitlog/blob/main/app/home/Workouts.tsx"
click node_workout_card "https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/WorkoutCard.tsx"
click node_workout_details "https://github.com/shaikat0079/my-fitlog/blob/main/app/workouts/%5Bid%5D/page.tsx"
click node_plan_page "https://github.com/shaikat0079/my-fitlog/blob/main/app/my-plan/page.tsx"
click node_plan_tabs "https://github.com/shaikat0079/my-fitlog/blob/main/components/Tabs.tsx"
click node_today_button "https://github.com/shaikat0079/my-fitlog/blob/main/components/workoutButtons/TodayWorkoutsButton.tsx"
click node_saved_button "https://github.com/shaikat0079/my-fitlog/blob/main/components/workoutButtons/SavedWorkoutsButton.tsx"
click node_workout_state "https://github.com/shaikat0079/my-fitlog/blob/main/context/WorkoutsProvider.tsx"
click node_navbar "https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/Navbar.tsx"
click node_plan_badge "https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/PlanBadge.tsx"
click node_save_badge "https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/SaveBadge.tsx"
click node_app_layout "https://github.com/shaikat0079/my-fitlog/blob/main/app/layout.tsx"
click node_footer "https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/Footer.tsx"
click node_error_routes "https://github.com/shaikat0079/my-fitlog/blob/main/app/error.tsx"
click node_workout_type "https://github.com/shaikat0079/my-fitlog/blob/main/Types/workout.type.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_home,node_banner,node_workout_list,node_workout_card,node_workout_details,node_user toneBlue
class node_plan_page,node_plan_tabs,node_today_button,node_saved_button,node_workout_state toneAmber
class node_navbar,node_plan_badge,node_save_badge,node_app_layout,node_footer,node_error_routes,node_workout_api toneMint
class node_workout_type toneRose
```

## Components

### Workout discovery

- [Home route](https://github.com/shaikat0079/my-fitlog/blob/main/app/page.tsx): `app/page.tsx`
- [Hero banner](https://github.com/shaikat0079/my-fitlog/blob/main/app/home/Banner.tsx): `app/home/Banner.tsx`
- [Workout listing](https://github.com/shaikat0079/my-fitlog/blob/main/app/home/Workouts.tsx): `app/home/Workouts.tsx`
- [Workout card](https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/WorkoutCard.tsx): `components/shared/WorkoutCard.tsx`
- [Workout details](https://github.com/shaikat0079/my-fitlog/blob/main/app/workouts/%5Bid%5D/page.tsx): `app/workouts/[id]/page.tsx`

### Plan and saved lists

- [Plan page](https://github.com/shaikat0079/my-fitlog/blob/main/app/my-plan/page.tsx): `app/my-plan/page.tsx`
- [Plan and saved tabs](https://github.com/shaikat0079/my-fitlog/blob/main/components/Tabs.tsx): `components/Tabs.tsx`
- [Add to plan](https://github.com/shaikat0079/my-fitlog/blob/main/components/workoutButtons/TodayWorkoutsButton.tsx): `components/workoutButtons/TodayWorkoutsButton.tsx`
- [Save workout](https://github.com/shaikat0079/my-fitlog/blob/main/components/workoutButtons/SavedWorkoutsButton.tsx): `components/workoutButtons/SavedWorkoutsButton.tsx`
- [Workout state](https://github.com/shaikat0079/my-fitlog/blob/main/context/WorkoutsProvider.tsx): `context/WorkoutsProvider.tsx`

### Application shell

- [Navigation bar](https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/Navbar.tsx): `components/shared/Navbar.tsx`
- [Plan badge](https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/PlanBadge.tsx): `components/shared/PlanBadge.tsx`
- [Saved badge](https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/SaveBadge.tsx): `components/shared/SaveBadge.tsx`
- [Root layout](https://github.com/shaikat0079/my-fitlog/blob/main/app/layout.tsx): `app/layout.tsx`
- [Footer](https://github.com/shaikat0079/my-fitlog/blob/main/components/shared/Footer.tsx): `components/shared/Footer.tsx`
- [Error and not-found routes](https://github.com/shaikat0079/my-fitlog/blob/main/app/error.tsx): `app/error.tsx`

### Workout domain

- [Workout data type](https://github.com/shaikat0079/my-fitlog/blob/main/Types/workout.type.ts): `Types/workout.type.ts`

### Other components

- **User**
- **Workout REST API**

## Connections

- User → Home route: browses (evidence: `README.md`)
- User → Plan page: manages plan (evidence: `README.md`)
- Home route → Hero banner: renders (evidence: `app/page.tsx`)
- Home route → Workout listing: renders (evidence: `app/page.tsx`)
- Workout listing → Workout REST API: fetches workouts (evidence: `app/home/Workouts.tsx`)
- Workout listing → Workout card: renders cards (evidence: `app/home/Workouts.tsx`)
- Workout card → Workout details: links to details (evidence: `README.md`)
- Workout details → Workout REST API: fetches workout (evidence: `app/workouts/[id]/page.tsx`)
- Workout details → Add to plan: renders (evidence: `app/workouts/[id]/page.tsx`)
- Workout details → Save workout: renders (evidence: `app/workouts/[id]/page.tsx`)
- Plan page → Workout state: reads plan (evidence: `app/my-plan/page.tsx`)
- Plan page → Plan and saved tabs: renders (evidence: `app/my-plan/page.tsx`)
- Plan and saved tabs → Workout state: reads and updates (evidence: `components/Tabs.tsx`)
- Add to plan → Workout state: adds workout (evidence: `components/workoutButtons/TodayWorkoutsButton.tsx`)
- Save workout → Workout state: saves workout (evidence: `components/workoutButtons/SavedWorkoutsButton.tsx`)
- Navigation bar → Plan badge: renders (evidence: `components/shared/Navbar.tsx`)
- Navigation bar → Saved badge: renders (evidence: `components/shared/Navbar.tsx`)
- Root layout → Navigation bar: renders (evidence: `app/layout.tsx`)
- Root layout → Footer: renders (evidence: `app/layout.tsx`)
- Root layout → Workout state: provides context (evidence: `app/layout.tsx`)
- Workout details → Error and not-found routes: handles failures (evidence: `README.md`)
- Workout listing → Workout data type: uses workout shape (evidence: `app/home/Workouts.tsx`)
- Workout details → Workout data type: uses workout shape (evidence: `app/workouts/[id]/page.tsx`)
- Workout state → Workout data type: stores workouts (evidence: `context/WorkoutsProvider.tsx`)
