# carlcaraan/angular-fitnance architecture

> Architecture diagram of the GitHub repository carlcaraan/angular-fitnance, 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/carlcaraan/angular-fitnance
- Repository: https://github.com/carlcaraan/angular-fitnance

## Overview

FitNance is an Angular personal fitness and finance application. Users enter through login or registration, then use profile setup to provide health, fitness, and finance details; profile management loads and updates their profile and computes targets. The app also exposes food tracking, workout, dashboard, settings, and user-theme capabilities. Pages call domain services, which make HTTP requests to a configured backend; authentication state is kept in browser local storage. Several routes and modules are documented in the tree/index but their implementation was not sampled, so those connections are omitted where call evidence is unavailable.

Main entry points: [`src/app/app.routes.ts`](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/app.routes.ts) (Route dispatch), [`src/app/pages/profile-setup/profile-setup.ts`](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile-setup/profile-setup.ts) (Profile setup), [`src/app/pages/profile/profile.ts`](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile/profile.ts) (Profile management), [`src/app/services/authentication/auth.service.ts`](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/auth.service.ts) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App shell"]
  node_routes["Route dispatch<br/>[app.routes.ts]"]
  node_layout["Main layout<br/>[main-layout.ts]"]
end

subgraph group_identity["Authentication"]
  node_login["Login page<br/>[login.ts]"]
  node_register["Registration page<br/>[register.ts]"]
  node_loginservice["Login service<br/>[login.service.ts]"]
  node_registerservice["Registration service"]
  node_authstate["Auth state<br/>[auth.service.ts]"]
  node_browserstore[("Browser local storage")]
end

subgraph group_health["Profile and setup"]
  node_profile_setup["Profile setup<br/>[profile-setup.ts]"]
  node_setup_services["Setup catalogs"]
  node_setup_service["Setup submission"]
  node_complete_service["Profile completion"]
  node_profile["Profile management<br/>[profile.ts]"]
  node_profile_service["Profile service<br/>[profile.service.ts]"]
  node_loading["Loading state<br/>[loading.service.ts]"]
end

subgraph group_features["Fitness features"]
  node_food["Food tracking<br/>[food.ts]"]
  node_food_service["Food service<br/>[food.service.ts]"]
  node_food_dialog["Food dialog<br/>[food-dialog.ts]"]
  node_dashboard["Dashboard<br/>[dashboard.ts]"]
  node_workout["Workout<br/>[workout.ts]"]
  node_settings["Settings<br/>[settings.ts]"]
  node_settings_service["Settings service"]
  node_theme_service["Theme service"]
end

node_user(("User"))
node_backend{{"FitNance API"}}

node_user -->|"opens routes"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_register
node_routes -->|"renders shell"| node_layout
node_routes -->|"routes to"| node_profile_setup
node_routes -->|"routes to"| node_profile
node_routes -->|"routes to"| node_food
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_workout
node_routes -->|"routes to"| node_settings
node_login -->|"submits credentials"| node_loginservice
node_login -->|"sets session"| node_authstate
node_register -->|"submits registration"| node_registerservice
node_register -->|"uses session"| node_authstate
node_loginservice -->|"sends request"| node_backend
node_registerservice -->|"sends request"| node_backend
node_authstate -->|"reads and writes"| node_browserstore
node_layout -->|"applies theme"| node_theme_service
node_layout -->|"checks session"| node_authstate
node_profile_setup -->|"loads catalogs"| node_setup_services
node_profile_setup -->|"computes setup"| node_setup_service
node_profile_setup -->|"submits profile"| node_complete_service
node_setup_service -->|"sends request"| node_backend
node_complete_service -->|"sends request"| node_backend
node_setup_services -->|"loads options"| node_backend
node_profile -->|"loads catalogs"| node_setup_services
node_profile -->|"loads and updates"| node_profile_service
node_profile -->|"toggles loading"| node_loading
node_profile_service -->|"reads and writes"| node_backend
node_food -->|"manages foods"| node_food_service
node_food -->|"opens dialog"| node_food_dialog
node_food_service -->|"reads and writes"| node_backend
node_settings -->|"changes password"| node_settings_service
node_settings -->|"manages theme"| node_theme_service
node_settings_service -->|"sends request"| node_backend
node_theme_service -->|"loads and updates"| node_backend

click node_routes "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/app.routes.ts"
click node_layout "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/layouts/main-layout/main-layout.ts"
click node_login "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/auth/login/login.ts"
click node_register "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/auth/register/register.ts"
click node_loginservice "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/login.service.ts"
click node_registerservice "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/register.service.ts"
click node_authstate "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/auth.service.ts"
click node_profile_setup "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile-setup/profile-setup.ts"
click node_setup_services "https://github.com/carlcaraan/angular-fitnance/tree/main/src/app/services/setup"
click node_setup_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile-setup/profile-setup.service.ts"
click node_complete_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile-setup/complete-profile.service.ts"
click node_profile "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile/profile.ts"
click node_profile_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile/profile.service.ts"
click node_loading "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/loading/loading.service.ts"
click node_food "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/food/food.ts"
click node_food_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/food/food.service.ts"
click node_food_dialog "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/components/dialogs/food-dialog/food-dialog.ts"
click node_dashboard "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/dashboard/dashboard.ts"
click node_workout "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/workout/workout.ts"
click node_settings "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/settings/settings.ts"
click node_settings_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/settings/settings.service.ts"
click node_theme_service "https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/theme/user-theme.service.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_routes,node_layout,node_user toneBlue
class node_login,node_register,node_loginservice,node_registerservice,node_authstate,node_browserstore toneAmber
class node_profile_setup,node_setup_services,node_setup_service,node_complete_service,node_profile,node_profile_service,node_loading,node_backend toneMint
class node_food,node_food_service,node_food_dialog,node_dashboard,node_workout,node_settings,node_settings_service,node_theme_service toneRose
```

## Components

### App shell

- [Route dispatch](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Main layout](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/layouts/main-layout/main-layout.ts): `src/app/layouts/main-layout/main-layout.ts`

### Authentication

- [Login page](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/auth/login/login.ts): `src/app/pages/auth/login/login.ts`
- [Registration page](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/auth/register/register.ts): `src/app/pages/auth/register/register.ts`
- [Login service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/login.service.ts): `src/app/services/authentication/login.service.ts`
- [Registration service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/register.service.ts): `src/app/services/authentication/register.service.ts`
- [Auth state](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/authentication/auth.service.ts): `src/app/services/authentication/auth.service.ts`
- **Browser local storage**

### Profile and setup

- [Profile setup](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile-setup/profile-setup.ts): `src/app/pages/profile-setup/profile-setup.ts`
- [Setup catalogs](https://github.com/carlcaraan/angular-fitnance/tree/main/src/app/services/setup): `src/app/services/setup`
- [Setup submission](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile-setup/profile-setup.service.ts): `src/app/services/profile-setup/profile-setup.service.ts`
- [Profile completion](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile-setup/complete-profile.service.ts): `src/app/services/profile-setup/complete-profile.service.ts`
- [Profile management](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/profile/profile.ts): `src/app/pages/profile/profile.ts`
- [Profile service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/profile/profile.service.ts): `src/app/services/profile/profile.service.ts`
- [Loading state](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/loading/loading.service.ts): `src/app/services/loading/loading.service.ts`

### Fitness features

- [Food tracking](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/food/food.ts): `src/app/pages/food/food.ts`
- [Food service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/food/food.service.ts): `src/app/services/food/food.service.ts`
- [Food dialog](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/components/dialogs/food-dialog/food-dialog.ts): `src/app/components/dialogs/food-dialog/food-dialog.ts`
- [Dashboard](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/dashboard/dashboard.ts): `src/app/pages/dashboard/dashboard.ts`
- [Workout](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/workout/workout.ts): `src/app/pages/workout/workout.ts`
- [Settings](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/pages/settings/settings.ts): `src/app/pages/settings/settings.ts`
- [Settings service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/settings/settings.service.ts): `src/app/services/settings/settings.service.ts`
- [Theme service](https://github.com/carlcaraan/angular-fitnance/blob/main/src/app/services/theme/user-theme.service.ts): `src/app/services/theme/user-theme.service.ts`

### Other components

- **User**
- **FitNance API**

## Connections

- User → Route dispatch: opens routes (evidence: `src/app/app.routes.ts`)
- Route dispatch → Login page: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Registration page: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Main layout: renders shell (evidence: `src/app/app.routes.ts`)
- Route dispatch → Profile setup: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Profile management: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Food tracking: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Dashboard: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Workout: routes to (evidence: `src/app/app.routes.ts`)
- Route dispatch → Settings: routes to (evidence: `src/app/app.routes.ts`)
- Login page → Login service: submits credentials (evidence: `src/app/pages/auth/login/login.ts`)
- Login page → Auth state: sets session (evidence: `src/app/pages/auth/login/login.ts`)
- Registration page → Registration service: submits registration (evidence: `src/app/pages/auth/register/register.ts`)
- Registration page → Auth state: uses session (evidence: `src/app/pages/auth/register/register.ts`)
- Login service → FitNance API: sends request (evidence: `src/app/services/authentication/login.service.ts`)
- Registration service → FitNance API: sends request (evidence: `src/app/services/authentication/register.service.ts`)
- Auth state → Browser local storage: reads and writes (evidence: `src/app/services/authentication/auth.service.ts`)
- Main layout → Theme service: applies theme (evidence: `src/app/layouts/main-layout/main-layout.ts`)
- Main layout → Auth state: checks session (evidence: `src/app/layouts/main-layout/main-layout.ts`)
- Profile setup → Setup catalogs: loads catalogs (evidence: `src/app/pages/profile-setup/profile-setup.ts`)
- Profile setup → Setup submission: computes setup (evidence: `src/app/pages/profile-setup/profile-setup.ts`)
- Profile setup → Profile completion: submits profile (evidence: `src/app/pages/profile-setup/profile-setup.ts`)
- Setup submission → FitNance API: sends request (evidence: `src/app/services/profile-setup/profile-setup.service.ts`)
- Profile completion → FitNance API: sends request (evidence: `src/app/services/profile-setup/complete-profile.service.ts`)
- Setup catalogs → FitNance API: loads options (evidence: `src/app/services/setup/nutrition-goals.service.ts`)
- Profile management → Setup catalogs: loads catalogs (evidence: `src/app/pages/profile/profile.ts`)
- Profile management → Profile service: loads and updates (evidence: `src/app/pages/profile/profile.ts`)
- Profile management → Loading state: toggles loading (evidence: `src/app/pages/profile/profile.ts`)
- Profile service → FitNance API: reads and writes (evidence: `src/app/services/profile/profile.service.ts`)
- Food tracking → Food service: manages foods (evidence: `src/app/pages/food/food.ts`)
- Food tracking → Food dialog: opens dialog (evidence: `src/app/pages/food/food.ts`)
- Food service → FitNance API: reads and writes (evidence: `src/app/services/food/food.service.ts`)
- Settings → Settings service: changes password (evidence: `src/app/pages/settings/settings.ts`)
- Settings → Theme service: manages theme (evidence: `src/app/pages/settings/settings.ts`)
- Settings service → FitNance API: sends request (evidence: `src/app/services/settings/settings.service.ts`)
- Theme service → FitNance API: loads and updates (evidence: `src/app/services/theme/user-theme.service.ts`)
