How rockeybhai19511-ctrl/fitness-tracker works
PulseTrack is an admin-only fitness journal. The user signs in, records steps and water manually or saves a live walk, then reviews derived activity metrics, history, goals, workouts and settings. The backend validates requests, applies domain calculations, and persists entries and preferences in MongoDB. The graph follows the shown route/API and controller calls; several UI capabilities and route details are documented but their implementations were not sampled, so those links are omitted where source evidence is unavailable.
Main entry points: App.tsx Page routing · api.ts API client · server.js HTTP server · dashboardController.js Metric aggregation
Components 34
Fitness journal
- Page routing
frontend/src/App.tsx - Admin login
frontend/src/pages/Login.tsx - Metrics dashboard
frontend/src/pages/Dashboard.tsx - Activity logging
frontend/src/pages/LogActivity.tsx - Journey badges
frontend/src/components/JourneyTrail.tsx - Goals
frontend/src/pages/Goals.tsx - Workout guide
frontend/src/pages/Workouts.tsx - Fitness settings
frontend/src/pages/Settings.tsx
Client state and API
- Walk sensing
frontend/src/utils/useGpsStepTracker.ts - Metric calculations
frontend/src/utils/calculations.ts - Auth state
frontend/src/stores/authStore.ts - API client
frontend/src/utils/api.ts
Backend services
- HTTP server
backend/src/server.js - Auth routes
backend/src/routes/auth.js - Admin authentication
backend/src/controllers/authController.js - JWT protection
backend/src/middleware/auth.js - Entry routes
backend/src/routes/entries.js - Entry handling
backend/src/controllers/entriesController.js - Dashboard routes
backend/src/routes/dashboard.js - Metric aggregation
backend/src/controllers/dashboardController.js - Settings routes
backend/src/routes/settings.js - Settings handling
backend/src/controllers/settingsController.js - Goals and workout routes
backend/src/routes/extras.js - Goals and workouts
backend/src/controllers/extrasController.js - Request validation
backend/src/utils/validate.js - Fitness calculations
backend/src/utils/calculations.js
MongoDB records
- Mongo connection
backend/src/config/db.js - Admin record
backend/src/models/Admin.js - Step entries
backend/src/models/StepEntry.js - Water entries
backend/src/models/WaterEntry.js - Settings record
backend/src/models/Settings.js - Goal records
backend/src/models/Goal.js - Workout templates
backend/src/models/WorkoutTemplate.js
Other components
- Admin
Connections 48
- Admin → Page routing: opens app
- Page routing → Admin login: routes guest
frontend/src/App.tsx - Page routing → Metrics dashboard: routes page
frontend/src/App.tsx - Page routing → Activity logging: routes page
frontend/src/App.tsx - Page routing → Goals: routes page
frontend/src/App.tsx - Page routing → Workout guide: routes page
frontend/src/App.tsx - Page routing → Fitness settings: routes page
frontend/src/App.tsx - Admin login → API client: submits credentials
frontend/src/pages/Login.tsx - Admin login → Auth state: stores session
frontend/src/pages/Login.tsx - Page routing → Auth state: checks token
frontend/src/App.tsx - Activity logging → Walk sensing: tracks walk
frontend/src/pages/LogActivity.tsx - Activity logging → API client: sends entries
frontend/src/pages/LogActivity.tsx - Activity logging → Journey badges: renders milestones
frontend/src/pages/LogActivity.tsx - Activity logging → Metric calculations: uses date helper
frontend/src/pages/LogActivity.tsx - Metrics dashboard → API client: loads metrics
frontend/src/pages/Dashboard.tsx - Metrics dashboard → Metric calculations: uses calculations
frontend/src/pages/Dashboard.tsx - Goals → API client: manages goals
frontend/src/pages/Goals.tsx - Workout guide → API client: loads templates
frontend/src/pages/Workouts.tsx - Workout guide → Metric calculations: estimates energy
frontend/src/pages/Workouts.tsx - Fitness settings → API client: loads settings
- API client → Auth state: reads token
frontend/src/utils/api.ts - API client → HTTP server: sends API requests
- HTTP server → Mongo connection: connects database
backend/src/server.js - HTTP server → Auth routes: mounts routes
backend/src/server.js - HTTP server → Dashboard routes: mounts routes
backend/src/server.js - HTTP server → Entry routes: mounts routes
backend/src/server.js - HTTP server → Settings routes: mounts routes
backend/src/server.js - HTTP server → Goals and workout routes: mounts routes
backend/src/server.js - Auth routes → Admin authentication: dispatches
backend/src/routes/auth.js - Auth routes → JWT protection: protects endpoint
backend/src/routes/auth.js - Admin authentication → Admin record: looks up admin
backend/src/controllers/authController.js - Admin authentication → Request validation: validates login
backend/src/controllers/authController.js - Entry routes → Entry handling: dispatches
backend/src/routes/entries.js - Entry routes → JWT protection: protects endpoints
backend/src/routes/entries.js - Entry handling → Request validation: validates payloads
backend/src/controllers/entriesController.js - Entry handling → Fitness calculations: calculates ranges
backend/src/controllers/entriesController.js - Entry handling → Step entries: creates and queries
backend/src/controllers/entriesController.js - Entry handling → Water entries: creates and queries
backend/src/controllers/entriesController.js - Dashboard routes → Metric aggregation: dispatches
- Metric aggregation → Step entries: reads entries
backend/src/controllers/dashboardController.js - Metric aggregation → Water entries: reads entries
backend/src/controllers/dashboardController.js - Metric aggregation → Settings record: reads settings
backend/src/controllers/dashboardController.js - Metric aggregation → Goal records: reads goals
backend/src/controllers/dashboardController.js - Metric aggregation → Fitness calculations: derives metrics
backend/src/controllers/dashboardController.js - Settings routes → Settings handling: dispatches
backend/src/routes/settings.js - Settings routes → JWT protection: protects endpoints
backend/src/routes/settings.js - Settings handling → Request validation: validates updates
backend/src/controllers/settingsController.js - Settings handling → Settings record: reads and updates
backend/src/controllers/settingsController.js