# larstp/holidaze architecture

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

- Interactive diagram: https://gitdiagram.com/larstp/holidaze
- Repository: https://github.com/larstp/holidaze

## Overview

Holidaze is a React accommodation-booking platform for visitors, customers, and venue managers. Visitors discover and filter stays, then view venue details and availability; customers authenticate and book stays, while managers list venues and manage bookings. The shared API client connects domain services to the Noroff API, and authenticated profile data supports separate customer and manager dashboards. The README documents the broader feature set; sampled source confirms routing, search-filter state, authentication requests, API transport, and manager overview/venue data access, so other links are omitted where wiring was not sampled.

Main entry points: [`src/App.tsx`](https://github.com/larstp/holidaze/blob/main/src/App.tsx) (Route application), [`src/lib/services/profileService.ts`](https://github.com/larstp/holidaze/blob/main/src/lib/services/profileService.ts) (Profile service), [`src/lib/services/apiClient.ts`](https://github.com/larstp/holidaze/blob/main/src/lib/services/apiClient.ts) (API client), [`src/lib/services/venueService.ts`](https://github.com/larstp/holidaze/blob/main/src/lib/services/venueService.ts) (Venue service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Stay discovery"]
  node_home["Home page<br/>[Home.tsx]"]
  node_search["Venue search<br/>[Search.tsx]"]
  node_searchfilters["Search filters"]
  node_searchhook["Search data hook<br/>[useSearchVenues.ts]"]
  node_venuepage["Venue details<br/>[Venue.tsx]"]
  node_venuehook["Venue data hook<br/>[useVenue.ts]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_authpages["Login and registration<br/>[Login.tsx]"]
  node_authcontext["Session context<br/>[AuthContext.tsx]"]
  node_profilesettings["Profile settings"]
end

subgraph group_management["Booking and management"]
  node_customertrips["Customer trips<br/>[Dashboard.tsx]"]
  node_manageroverview["Manager overview"]
  node_managervenues["Manager venues<br/>[ManagerVenues.tsx]"]
  node_incoming["Incoming bookings"]
  node_venueediting["Venue management<br/>[CreateVenue.tsx]"]
  node_bookingservice["Booking service<br/>[bookingService.ts]"]
end

subgraph group_integration["API integration"]
  node_authservice["Authentication service<br/>[authService.ts]"]
  node_profileservice["Profile service<br/>[profileService.ts]"]
  node_venueservice["Venue service<br/>[venueService.ts]"]
  node_apiclient["API client<br/>[apiClient.ts]"]
end

node_visitor(("Visitor"))
node_customer(("Customer"))
node_manager(("Venue manager"))
node_app["Route application<br/>[App.tsx]"]
node_noroff{{"Noroff Holidaze API"}}

node_visitor -->|"opens"| node_app
node_customer -->|"opens"| node_app
node_manager -->|"opens"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_search
node_app -->|"routes"| node_venuepage
node_app -->|"routes"| node_authpages
node_app -->|"routes"| node_customertrips
node_app -->|"routes"| node_manageroverview
node_app -->|"routes"| node_managervenues
node_app -->|"routes"| node_incoming
node_app -->|"routes"| node_venueediting
node_search -->|"reads and updates"| node_searchfilters
node_search -->|"loads results"| node_searchhook
node_searchhook -->|"searches venues"| node_venueservice
node_venuepage -->|"loads venue"| node_venuehook
node_venuepage -->|"creates booking"| node_bookingservice
node_authpages -->|"registers or logs in"| node_authservice
node_authcontext -->|"authenticates"| node_authservice
node_profilesettings -->|"updates profile"| node_profileservice
node_manageroverview -->|"loads profile data"| node_profileservice
node_managervenues -->|"loads venues"| node_profileservice
node_managervenues -->|"deletes venue"| node_venueservice
node_incoming -->|"loads bookings"| node_profileservice
node_venueediting -->|"manages venue"| node_venueservice
node_authservice -->|"sends requests"| node_apiclient
node_profileservice -->|"sends requests"| node_apiclient
node_venueservice -->|"sends requests"| node_apiclient
node_bookingservice -->|"sends requests"| node_apiclient
node_apiclient -->|"fetches API data"| node_noroff

click node_app "https://github.com/larstp/holidaze/blob/main/src/App.tsx"
click node_home "https://github.com/larstp/holidaze/blob/main/src/pages/Home/Home.tsx"
click node_search "https://github.com/larstp/holidaze/blob/main/src/pages/Search/Search.tsx"
click node_searchfilters "https://github.com/larstp/holidaze/blob/main/src/hooks/useSearchFilters.ts"
click node_searchhook "https://github.com/larstp/holidaze/blob/main/src/hooks/useSearchVenues.ts"
click node_venuepage "https://github.com/larstp/holidaze/blob/main/src/pages/Venue/Venue.tsx"
click node_venuehook "https://github.com/larstp/holidaze/blob/main/src/hooks/useVenue.ts"
click node_authpages "https://github.com/larstp/holidaze/blob/main/src/pages/Login/Login.tsx"
click node_authcontext "https://github.com/larstp/holidaze/blob/main/src/context/AuthContext.tsx"
click node_profilesettings "https://github.com/larstp/holidaze/blob/main/src/pages/ProfileSettings/ProfileSettings.tsx"
click node_customertrips "https://github.com/larstp/holidaze/blob/main/src/pages/Dashboard/Dashboard.tsx"
click node_manageroverview "https://github.com/larstp/holidaze/blob/main/src/pages/ManagerOverview/ManagerOverview.tsx"
click node_managervenues "https://github.com/larstp/holidaze/blob/main/src/pages/ManagerVenues/ManagerVenues.tsx"
click node_incoming "https://github.com/larstp/holidaze/blob/main/src/pages/IncomingBookings/IncomingBookings.tsx"
click node_venueediting "https://github.com/larstp/holidaze/blob/main/src/pages/CreateVenue/CreateVenue.tsx"
click node_bookingservice "https://github.com/larstp/holidaze/blob/main/src/lib/services/bookingService.ts"
click node_authservice "https://github.com/larstp/holidaze/blob/main/src/lib/services/authService.ts"
click node_profileservice "https://github.com/larstp/holidaze/blob/main/src/lib/services/profileService.ts"
click node_venueservice "https://github.com/larstp/holidaze/blob/main/src/lib/services/venueService.ts"
click node_apiclient "https://github.com/larstp/holidaze/blob/main/src/lib/services/apiClient.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_search,node_searchfilters,node_searchhook,node_venuepage,node_venuehook toneBlue
class node_authpages,node_authcontext,node_profilesettings toneAmber
class node_customertrips,node_manageroverview,node_managervenues,node_incoming,node_venueediting,node_bookingservice,node_app,node_noroff toneMint
class node_authservice,node_profileservice,node_venueservice,node_apiclient toneRose
class node_visitor,node_customer,node_manager toneIndigo
```

## Components

### Stay discovery

- [Home page](https://github.com/larstp/holidaze/blob/main/src/pages/Home/Home.tsx): `src/pages/Home/Home.tsx`
- [Venue search](https://github.com/larstp/holidaze/blob/main/src/pages/Search/Search.tsx): `src/pages/Search/Search.tsx`
- [Search filters](https://github.com/larstp/holidaze/blob/main/src/hooks/useSearchFilters.ts): `src/hooks/useSearchFilters.ts`
- [Search data hook](https://github.com/larstp/holidaze/blob/main/src/hooks/useSearchVenues.ts): `src/hooks/useSearchVenues.ts`
- [Venue details](https://github.com/larstp/holidaze/blob/main/src/pages/Venue/Venue.tsx): `src/pages/Venue/Venue.tsx`
- [Venue data hook](https://github.com/larstp/holidaze/blob/main/src/hooks/useVenue.ts): `src/hooks/useVenue.ts`

### Accounts and profiles

- [Login and registration](https://github.com/larstp/holidaze/blob/main/src/pages/Login/Login.tsx): `src/pages/Login/Login.tsx`
- [Session context](https://github.com/larstp/holidaze/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Profile settings](https://github.com/larstp/holidaze/blob/main/src/pages/ProfileSettings/ProfileSettings.tsx): `src/pages/ProfileSettings/ProfileSettings.tsx`

### Booking and management

- [Customer trips](https://github.com/larstp/holidaze/blob/main/src/pages/Dashboard/Dashboard.tsx): `src/pages/Dashboard/Dashboard.tsx`
- [Manager overview](https://github.com/larstp/holidaze/blob/main/src/pages/ManagerOverview/ManagerOverview.tsx): `src/pages/ManagerOverview/ManagerOverview.tsx`
- [Manager venues](https://github.com/larstp/holidaze/blob/main/src/pages/ManagerVenues/ManagerVenues.tsx): `src/pages/ManagerVenues/ManagerVenues.tsx`
- [Incoming bookings](https://github.com/larstp/holidaze/blob/main/src/pages/IncomingBookings/IncomingBookings.tsx): `src/pages/IncomingBookings/IncomingBookings.tsx`
- [Venue management](https://github.com/larstp/holidaze/blob/main/src/pages/CreateVenue/CreateVenue.tsx): `src/pages/CreateVenue/CreateVenue.tsx`
- [Booking service](https://github.com/larstp/holidaze/blob/main/src/lib/services/bookingService.ts): `src/lib/services/bookingService.ts`

### API integration

- [Authentication service](https://github.com/larstp/holidaze/blob/main/src/lib/services/authService.ts): `src/lib/services/authService.ts`
- [Profile service](https://github.com/larstp/holidaze/blob/main/src/lib/services/profileService.ts): `src/lib/services/profileService.ts`
- [Venue service](https://github.com/larstp/holidaze/blob/main/src/lib/services/venueService.ts): `src/lib/services/venueService.ts`
- [API client](https://github.com/larstp/holidaze/blob/main/src/lib/services/apiClient.ts): `src/lib/services/apiClient.ts`

### Other components

- **Visitor**
- **Customer**
- **Venue manager**
- [Route application](https://github.com/larstp/holidaze/blob/main/src/App.tsx): `src/App.tsx`
- **Noroff Holidaze API**

## Connections

- Visitor → Route application: opens
- Customer → Route application: opens
- Venue manager → Route application: opens
- Route application → Home page: routes
- Route application → Venue search: routes
- Route application → Venue details: routes
- Route application → Login and registration: routes
- Route application → Customer trips: routes
- Route application → Manager overview: routes
- Route application → Manager venues: routes
- Route application → Incoming bookings: routes
- Route application → Venue management: routes
- Venue search → Search filters: reads and updates
- Venue search → Search data hook: loads results
- Search data hook → Venue service: searches venues
- Venue details → Venue data hook: loads venue
- Venue details → Booking service: creates booking
- Login and registration → Authentication service: registers or logs in
- Session context → Authentication service: authenticates
- Profile settings → Profile service: updates profile
- Manager overview → Profile service: loads profile data
- Manager venues → Profile service: loads venues
- Manager venues → Venue service: deletes venue
- Incoming bookings → Profile service: loads bookings
- Venue management → Venue service: manages venue
- Authentication service → API client: sends requests
- Profile service → API client: sends requests
- Venue service → API client: sends requests
- Booking service → API client: sends requests
- API client → Noroff Holidaze API: fetches API data
