# d1gger1/pullup_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/d1gger1/pullup_tracker
- Repository: https://github.com/d1gger1/pullup_tracker

## Overview

REP / TRACK is a pull-up workout tracker with account registration and login, protected access, set recording, and daily and weekly totals. The evidenced workflow is registration or login through the client, token issuance, and token-gated pull-up API operations that store or query sets and return totals. The tree identifies a home page, but its implementation was not sampled, so its specific display and API wiring are not asserted. The README is empty; the map is based on the supplied tree and source excerpts.

Main entry points: [`client/src/pages/AuthPage.tsx`](https://github.com/d1gger1/pullup_tracker/blob/main/client/src/pages/AuthPage.tsx) (Auth page), [`index.js`](https://github.com/d1gger1/pullup_tracker/blob/main/index.js) (Server entry), [`controllers/authControllers.js`](https://github.com/d1gger1/pullup_tracker/blob/main/controllers/authControllers.js) (Auth controller), [`routes/pullups.js`](https://github.com/d1gger1/pullup_tracker/blob/main/routes/pullups.js) (Pull-up routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_auth_page["Auth page<br/>[AuthPage.tsx]"]
  node_app["App routing<br/>[App.tsx]"]
  node_protected_route["Protected route<br/>[ProtectedRoute.tsx]"]
  node_home_page["Home page<br/>[HomePage.tsx]"]
end

subgraph group_api["API"]
  node_server["Server entry<br/>[index.js]"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_auth_controller["Auth controller<br/>[authControllers.js]"]
  node_token_middleware["Token middleware<br/>[auth.js]"]
  node_pullup_routes["Pull-up routes<br/>[pullups.js]"]
  node_pullup_controller["Set and stats logic"]
end

subgraph group_data["Persistence"]
  node_user_model["User model<br/>[User.js]"]
  node_set_model["Pull-up set model<br/>[PullupSet.js]"]
  node_db_connection["DB connection<br/>[db.js]"]
end

node_user(("Tracker user"))
node_mongo[("MongoDB")]
node_jwt["JWT library"]

node_user -->|"submits credentials"| node_auth_page
node_auth_page -->|"posts auth request"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"queries and saves"| node_user_model
node_auth_controller -->|"signs token"| node_jwt
node_auth_page -->|"navigates after login"| node_app
node_app -->|"guards home route"| node_protected_route
node_protected_route -->|"redirects without token"| node_auth_page
node_server -->|"mounts auth API"| node_auth_routes
node_server -->|"mounts pull-up API"| node_pullup_routes
node_pullup_routes -->|"guards requests"| node_token_middleware
node_pullup_routes -->|"dispatches"| node_pullup_controller
node_token_middleware -->|"verifies token"| node_jwt
node_pullup_controller -->|"creates and queries sets"| node_set_model
node_server -->|"connects at startup"| node_db_connection
node_user_model -->|"persists users"| node_mongo
node_set_model -->|"persists sets"| node_mongo
node_db_connection -->|"opens connection"| node_mongo

click node_auth_page "https://github.com/d1gger1/pullup_tracker/blob/main/client/src/pages/AuthPage.tsx"
click node_app "https://github.com/d1gger1/pullup_tracker/blob/main/client/src/App.tsx"
click node_protected_route "https://github.com/d1gger1/pullup_tracker/blob/main/client/src/components/ProtectedRoute.tsx"
click node_home_page "https://github.com/d1gger1/pullup_tracker/blob/main/client/src/pages/HomePage.tsx"
click node_server "https://github.com/d1gger1/pullup_tracker/blob/main/index.js"
click node_auth_routes "https://github.com/d1gger1/pullup_tracker/blob/main/routes/auth.js"
click node_auth_controller "https://github.com/d1gger1/pullup_tracker/blob/main/controllers/authControllers.js"
click node_token_middleware "https://github.com/d1gger1/pullup_tracker/blob/main/middleware/auth.js"
click node_pullup_routes "https://github.com/d1gger1/pullup_tracker/blob/main/routes/pullups.js"
click node_pullup_controller "https://github.com/d1gger1/pullup_tracker/blob/main/controllers/pullupController.js"
click node_user_model "https://github.com/d1gger1/pullup_tracker/blob/main/models/User.js"
click node_set_model "https://github.com/d1gger1/pullup_tracker/blob/main/models/PullupSet.js"
click node_db_connection "https://github.com/d1gger1/pullup_tracker/blob/main/config/db.js"

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_auth_page,node_app,node_protected_route,node_home_page,node_user toneBlue
class node_server,node_auth_routes,node_auth_controller,node_token_middleware,node_pullup_routes,node_pullup_controller,node_mongo toneAmber
class node_user_model,node_set_model,node_db_connection toneMint
class node_jwt toneIndigo
```

## Components

### Client

- [Auth page](https://github.com/d1gger1/pullup_tracker/blob/main/client/src/pages/AuthPage.tsx): `client/src/pages/AuthPage.tsx`
- [App routing](https://github.com/d1gger1/pullup_tracker/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Protected route](https://github.com/d1gger1/pullup_tracker/blob/main/client/src/components/ProtectedRoute.tsx): `client/src/components/ProtectedRoute.tsx`
- [Home page](https://github.com/d1gger1/pullup_tracker/blob/main/client/src/pages/HomePage.tsx): `client/src/pages/HomePage.tsx`

### API

- [Server entry](https://github.com/d1gger1/pullup_tracker/blob/main/index.js): `index.js`
- [Auth routes](https://github.com/d1gger1/pullup_tracker/blob/main/routes/auth.js): `routes/auth.js`
- [Auth controller](https://github.com/d1gger1/pullup_tracker/blob/main/controllers/authControllers.js): `controllers/authControllers.js`
- [Token middleware](https://github.com/d1gger1/pullup_tracker/blob/main/middleware/auth.js): `middleware/auth.js`
- [Pull-up routes](https://github.com/d1gger1/pullup_tracker/blob/main/routes/pullups.js): `routes/pullups.js`
- [Set and stats logic](https://github.com/d1gger1/pullup_tracker/blob/main/controllers/pullupController.js): `controllers/pullupController.js`

### Persistence

- [User model](https://github.com/d1gger1/pullup_tracker/blob/main/models/User.js): `models/User.js`
- [Pull-up set model](https://github.com/d1gger1/pullup_tracker/blob/main/models/PullupSet.js): `models/PullupSet.js`
- [DB connection](https://github.com/d1gger1/pullup_tracker/blob/main/config/db.js): `config/db.js`

### Other components

- **Tracker user**
- **MongoDB**
- **JWT library**

## Connections

- Tracker user → Auth page: submits credentials
- Auth page → Auth routes: posts auth request
- Auth routes → Auth controller: dispatches
- Auth controller → User model: queries and saves
- Auth controller → JWT library: signs token
- Auth page → App routing: navigates after login
- App routing → Protected route: guards home route
- Protected route → Auth page: redirects without token
- Server entry → Auth routes: mounts auth API
- Server entry → Pull-up routes: mounts pull-up API
- Pull-up routes → Token middleware: guards requests
- Pull-up routes → Set and stats logic: dispatches
- Token middleware → JWT library: verifies token
- Set and stats logic → Pull-up set model: creates and queries sets
- Server entry → DB connection: connects at startup
- User model → MongoDB: persists users
- Pull-up set model → MongoDB: persists sets
- DB connection → MongoDB: opens connection
