# sametesen/vacationplanner architecture

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

- Interactive diagram: https://gitdiagram.com/sametesen/vacationplanner
- Repository: https://github.com/sametesen/vacationplanner

## Overview

VacationPlanner is an Angular vacation-planning UI backed by an Express API and MongoDB. Employees sign in, review their balance and calendar, and submit or edit requests; managers and HR review requests and administer users and company holidays. The API enforces session and role checks, calculates workdays, and supports email notifications and HR email actions. The README documents same-site API proxying and MongoDB-backed sessions; some route and holiday-provider details are unsampled, so those links are omitted or marked unverified.

Main entry points: [`server/src/app.ts`](https://github.com/sametesen/vacationplanner/blob/master/server/src/app.ts) (Express API), [`server/src/routes/requests.routes.ts`](https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/requests.routes.ts) (Request workflow), [`client/src/app/features`](https://github.com/sametesen/vacationplanner/tree/master/client/src/app/features) (Planner views), [`client/src/app/core/services/api.service.ts`](https://github.com/sametesen/vacationplanner/blob/master/client/src/app/core/services/api.service.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_app_shell["App shell<br/>[app.ts]"]
  node_feature_views["Planner views"]
  node_admin_view["Admin view<br/>[admin.component.ts]"]
  node_auth_view["Sign-in and password"]
  node_user_state["User session state"]
  node_api_client["API client<br/>[api.service.ts]"]
end

subgraph group_server["API and access"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_middleware["Session and access checks<br/>[auth.middleware.ts]"]
  node_auth_routes["Authentication<br/>[auth.routes.ts]"]
  node_user_routes["User administration<br/>[users.routes.ts]"]
end

subgraph group_vacation["Vacation domain"]
  node_request_routes["Request workflow<br/>[requests.routes.ts]"]
  node_holiday_routes["Holiday management<br/>[holidays.routes.ts]"]
  node_workday["Workday and balance calculation<br/>[workday.service.ts]"]
  node_holiday_service["Holiday lookup<br/>[holiday.service.ts]"]
  node_email_service["Email notifications<br/>[email.service.ts]"]
end

subgraph group_persistence["MongoDB data"]
  node_user_model[("User records<br/>[User.ts]")]
  node_request_model[("Vacation request records<br/>[HolidayRequest.ts]")]
  node_company_holiday_model[("Company holiday records<br/>[CompanyHoliday.ts]")]
end

node_employee(("Employee"))
node_manager_hr(("Manager / HR"))
node_mongo[("MongoDB")]

node_employee -->|"uses planner"| node_feature_views
node_manager_hr -->|"manages users"| node_admin_view
node_manager_hr -->|"reviews requests"| node_feature_views
node_app_shell -->|"routes to"| node_feature_views
node_app_shell -->|"reads session"| node_user_state
node_auth_view -->|"calls"| node_api_client
node_auth_view -->|"updates session"| node_user_state
node_feature_views -->|"requests data"| node_api_client
node_admin_view -->|"manages accounts"| node_api_client
node_api_client -->|"sends /api calls"| node_api_app
node_api_app -->|"attaches and checks"| node_auth_middleware
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_user_routes
node_api_app -->|"mounts"| node_request_routes
node_api_app -->|"mounts"| node_holiday_routes
node_auth_routes -->|"reads and updates"| node_user_model
node_auth_routes -->|"requires authenticated user"| node_auth_middleware
node_user_routes -->|"manages users"| node_user_model
node_request_routes -->|"reads and updates"| node_request_model
node_request_routes -->|"loads user data"| node_user_model
node_request_routes -->|"counts workdays"| node_workday
node_request_routes -->|"sends notifications"| node_email_service
node_holiday_routes -->|"gets holidays"| node_holiday_service
node_workday -->|"excludes holidays"| node_holiday_service
node_holiday_service -->|"reads company dates"| node_company_holiday_model
node_api_app -->|"connects and stores sessions"| node_mongo
node_user_model -.->|"persists records"| node_mongo
node_request_model -.->|"persists records"| node_mongo
node_company_holiday_model -.->|"persists records"| node_mongo

click node_app_shell "https://github.com/sametesen/vacationplanner/blob/master/client/src/app/app.ts"
click node_feature_views "https://github.com/sametesen/vacationplanner/tree/master/client/src/app/features"
click node_admin_view "https://github.com/sametesen/vacationplanner/blob/master/client/src/app/features/admin/admin.component.ts"
click node_auth_view "https://github.com/sametesen/vacationplanner/tree/master/client/src/app/features/auth"
click node_user_state "https://github.com/sametesen/vacationplanner/blob/master/client/src/app/core/services/user-state.service.ts"
click node_api_client "https://github.com/sametesen/vacationplanner/blob/master/client/src/app/core/services/api.service.ts"
click node_api_app "https://github.com/sametesen/vacationplanner/blob/master/server/src/app.ts"
click node_auth_middleware "https://github.com/sametesen/vacationplanner/blob/master/server/src/middleware/auth.middleware.ts"
click node_auth_routes "https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/auth.routes.ts"
click node_user_routes "https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/users.routes.ts"
click node_request_routes "https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/requests.routes.ts"
click node_holiday_routes "https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/holidays.routes.ts"
click node_workday "https://github.com/sametesen/vacationplanner/blob/master/server/src/services/workday.service.ts"
click node_holiday_service "https://github.com/sametesen/vacationplanner/blob/master/server/src/services/holiday.service.ts"
click node_email_service "https://github.com/sametesen/vacationplanner/blob/master/server/src/services/email.service.ts"
click node_user_model "https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/User.ts"
click node_request_model "https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/HolidayRequest.ts"
click node_company_holiday_model "https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/CompanyHoliday.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_app_shell,node_feature_views,node_admin_view,node_auth_view,node_user_state,node_api_client toneBlue
class node_api_app,node_auth_middleware,node_auth_routes,node_user_routes,node_mongo toneAmber
class node_request_routes,node_holiday_routes,node_workday,node_holiday_service,node_email_service toneMint
class node_user_model,node_request_model,node_company_holiday_model toneRose
class node_employee,node_manager_hr toneIndigo
```

## Components

### Angular client

- [App shell](https://github.com/sametesen/vacationplanner/blob/master/client/src/app/app.ts): `client/src/app/app.ts`
- [Planner views](https://github.com/sametesen/vacationplanner/tree/master/client/src/app/features): `client/src/app/features`
- [Admin view](https://github.com/sametesen/vacationplanner/blob/master/client/src/app/features/admin/admin.component.ts): `client/src/app/features/admin/admin.component.ts`
- [Sign-in and password](https://github.com/sametesen/vacationplanner/tree/master/client/src/app/features/auth): `client/src/app/features/auth`
- [User session state](https://github.com/sametesen/vacationplanner/blob/master/client/src/app/core/services/user-state.service.ts): `client/src/app/core/services/user-state.service.ts`
- [API client](https://github.com/sametesen/vacationplanner/blob/master/client/src/app/core/services/api.service.ts): `client/src/app/core/services/api.service.ts`

### API and access

- [Express API](https://github.com/sametesen/vacationplanner/blob/master/server/src/app.ts): `server/src/app.ts`
- [Session and access checks](https://github.com/sametesen/vacationplanner/blob/master/server/src/middleware/auth.middleware.ts): `server/src/middleware/auth.middleware.ts`
- [Authentication](https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/auth.routes.ts): `server/src/routes/auth.routes.ts`
- [User administration](https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/users.routes.ts): `server/src/routes/users.routes.ts`

### Vacation domain

- [Request workflow](https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/requests.routes.ts): `server/src/routes/requests.routes.ts`
- [Holiday management](https://github.com/sametesen/vacationplanner/blob/master/server/src/routes/holidays.routes.ts): `server/src/routes/holidays.routes.ts`
- [Workday and balance calculation](https://github.com/sametesen/vacationplanner/blob/master/server/src/services/workday.service.ts): `server/src/services/workday.service.ts`
- [Holiday lookup](https://github.com/sametesen/vacationplanner/blob/master/server/src/services/holiday.service.ts): `server/src/services/holiday.service.ts`
- [Email notifications](https://github.com/sametesen/vacationplanner/blob/master/server/src/services/email.service.ts): `server/src/services/email.service.ts`

### MongoDB data

- [User records](https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/User.ts): `server/src/entities/User.ts`
- [Vacation request records](https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/HolidayRequest.ts): `server/src/entities/HolidayRequest.ts`
- [Company holiday records](https://github.com/sametesen/vacationplanner/blob/master/server/src/entities/CompanyHoliday.ts): `server/src/entities/CompanyHoliday.ts`

### Other components

- **Employee**
- **Manager / HR**
- **MongoDB**

## Connections

- Employee → Planner views: uses planner (evidence: `README.md`)
- Manager / HR → Admin view: manages users (evidence: `README.md`)
- Manager / HR → Planner views: reviews requests (evidence: `README.md`)
- App shell → Planner views: routes to
- App shell → User session state: reads session (evidence: `client/src/app/app.ts`)
- Sign-in and password → API client: calls (evidence: `client/src/app/features/auth/login.component.ts`)
- Sign-in and password → User session state: updates session (evidence: `client/src/app/features/auth/login.component.ts`)
- Planner views → API client: requests data (evidence: `client/src/app/features/calendar/calendar.component.ts`)
- Admin view → API client: manages accounts (evidence: `client/src/app/features/admin/admin.component.ts`)
- API client → Express API: sends /api calls (evidence: `README.md`)
- Express API → Session and access checks: attaches and checks (evidence: `server/src/app.ts`)
- Express API → Authentication: mounts (evidence: `server/src/app.ts`)
- Express API → User administration: mounts (evidence: `server/src/app.ts`)
- Express API → Request workflow: mounts (evidence: `server/src/app.ts`)
- Express API → Holiday management: mounts (evidence: `server/src/app.ts`)
- Authentication → User records: reads and updates (evidence: `server/src/routes/auth.routes.ts`)
- Authentication → Session and access checks: requires authenticated user (evidence: `server/src/routes/auth.routes.ts`)
- User administration → User records: manages users (evidence: `server/src/routes/users.routes.ts`)
- Request workflow → Vacation request records: reads and updates (evidence: `server/src/routes/requests.routes.ts`)
- Request workflow → User records: loads user data (evidence: `server/src/routes/requests.routes.ts`)
- Request workflow → Workday and balance calculation: counts workdays (evidence: `server/src/routes/requests.routes.ts`)
- Request workflow → Email notifications: sends notifications (evidence: `server/src/routes/requests.routes.ts`)
- Holiday management → Holiday lookup: gets holidays (evidence: `server/src/routes/holidays.routes.ts`)
- Workday and balance calculation → Holiday lookup: excludes holidays (evidence: `server/src/services/workday.service.ts`)
- Holiday lookup → Company holiday records: reads company dates (evidence: `server/src/services/holiday.service.ts`)
- Express API → MongoDB: connects and stores sessions (evidence: `server/src/app.ts`)
- User records → MongoDB: persists records
- Vacation request records → MongoDB: persists records
- Company holiday records → MongoDB: persists records
