# febrifelis/locatrip-web architecture

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

- Interactive diagram: https://gitdiagram.com/febrifelis/locatrip-web
- Repository: https://github.com/febrifelis/locatrip-web

## Overview

Locatrip is a travel-booking web frontend. The main journey is trip search, trip details, seat/passenger selection and booking confirmation, followed by ticket access; account registration and login establish the authenticated state used across the app. Wallet top-ups, profile management and ticket reviews are additional product areas. The sampled files show page-to-API and page-to-auth-store usage; the backend is represented as an external API service. Some route and API details are unsampled, so their connections are omitted where not evidenced.

Main entry points: [`lib/api.ts`](https://github.com/febrifelis/locatrip-web/blob/master/lib/api.ts) (HTTP API Client), [`store/authStore.ts`](https://github.com/febrifelis/locatrip-web/blob/master/store/authStore.ts) (Auth State), [`components/layout/Navbar.tsx`](https://github.com/febrifelis/locatrip-web/blob/master/components/layout/Navbar.tsx) (Navigation), [`app/auth/login/page.tsx`](https://github.com/febrifelis/locatrip-web/blob/master/app/auth/login/page.tsx) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Trip Discovery"]
  node_home["Home<br/>[page.tsx]"]
  node_search["Trip Search<br/>[page.tsx]"]
  node_trip["Trip Details<br/>[page.tsx]"]
end

subgraph group_booking["Booking &amp; Tickets"]
  node_bookingform["Booking Checkout<br/>[page.tsx]"]
  node_tickets["Tickets &amp; Reviews<br/>[page.tsx]"]
end

subgraph group_account["Account &amp; Wallet"]
  node_login["Login<br/>[page.tsx]"]
  node_register["Registration<br/>[page.tsx]"]
  node_forgot["Password Recovery<br/>[page.tsx]"]
  node_profile["Profile<br/>[page.tsx]"]
  node_wallet["Wallet<br/>[page.tsx]"]
end

subgraph group_shared["Shared Client"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_providers["App Providers<br/>[providers.tsx]"]
  node_authstate["Auth State<br/>[authStore.ts]"]
  node_api["HTTP API Client<br/>[api.ts]"]
end

node_traveler(("Traveler"))
node_backend{{"Locatrip API"}}

node_traveler -->|"searches trips"| node_search
node_search -->|"queries trips"| node_api
node_search -->|"opens trip"| node_trip
node_trip -->|"loads trip"| node_api
node_bookingform -->|"books and confirms"| node_api
node_traveler -->|"signs in"| node_login
node_traveler -->|"registers"| node_register
node_login -->|"authenticates"| node_api
node_register -->|"creates account"| node_api
node_login -->|"sets session"| node_authstate
node_register -->|"sets session"| node_authstate
node_login -->|"links to recovery"| node_forgot
node_profile -->|"logs out"| node_api
node_profile -->|"reads and clears"| node_authstate
node_wallet -->|"reads and tops up"| node_api
node_wallet -->|"reads user"| node_authstate
node_tickets -->|"loads bookings"| node_api
node_tickets -->|"reads user"| node_authstate
node_navbar -->|"reads session"| node_authstate
node_navbar -->|"links to search"| node_search
node_navbar -->|"links to tickets"| node_tickets
node_navbar -->|"links to wallet"| node_wallet
node_providers -->|"renders"| node_navbar
node_api -->|"sends HTTP requests"| node_backend

click node_home "https://github.com/febrifelis/locatrip-web/blob/master/app/page.tsx"
click node_search "https://github.com/febrifelis/locatrip-web/blob/master/app/search/page.tsx"
click node_trip "https://github.com/febrifelis/locatrip-web/blob/master/app/trips/%5Bid%5D/page.tsx"
click node_bookingform "https://github.com/febrifelis/locatrip-web/blob/master/app/trips/%5Bid%5D/book/page.tsx"
click node_tickets "https://github.com/febrifelis/locatrip-web/blob/master/app/tickets/page.tsx"
click node_login "https://github.com/febrifelis/locatrip-web/blob/master/app/auth/login/page.tsx"
click node_register "https://github.com/febrifelis/locatrip-web/blob/master/app/auth/register/page.tsx"
click node_forgot "https://github.com/febrifelis/locatrip-web/blob/master/app/auth/forgot-password/page.tsx"
click node_profile "https://github.com/febrifelis/locatrip-web/blob/master/app/profile/page.tsx"
click node_wallet "https://github.com/febrifelis/locatrip-web/blob/master/app/wallet/page.tsx"
click node_navbar "https://github.com/febrifelis/locatrip-web/blob/master/components/layout/Navbar.tsx"
click node_providers "https://github.com/febrifelis/locatrip-web/blob/master/lib/providers.tsx"
click node_authstate "https://github.com/febrifelis/locatrip-web/blob/master/store/authStore.ts"
click node_api "https://github.com/febrifelis/locatrip-web/blob/master/lib/api.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_trip toneBlue
class node_bookingform,node_tickets toneAmber
class node_login,node_register,node_forgot,node_profile,node_wallet,node_backend toneMint
class node_navbar,node_providers,node_authstate,node_api toneRose
class node_traveler toneIndigo
```

## Components

### Trip Discovery

- [Home](https://github.com/febrifelis/locatrip-web/blob/master/app/page.tsx): `app/page.tsx`
- [Trip Search](https://github.com/febrifelis/locatrip-web/blob/master/app/search/page.tsx): `app/search/page.tsx`
- [Trip Details](https://github.com/febrifelis/locatrip-web/blob/master/app/trips/%5Bid%5D/page.tsx): `app/trips/[id]/page.tsx`

### Booking & Tickets

- [Booking Checkout](https://github.com/febrifelis/locatrip-web/blob/master/app/trips/%5Bid%5D/book/page.tsx): `app/trips/[id]/book/page.tsx`
- [Tickets & Reviews](https://github.com/febrifelis/locatrip-web/blob/master/app/tickets/page.tsx): `app/tickets/page.tsx`

### Account & Wallet

- [Login](https://github.com/febrifelis/locatrip-web/blob/master/app/auth/login/page.tsx): `app/auth/login/page.tsx`
- [Registration](https://github.com/febrifelis/locatrip-web/blob/master/app/auth/register/page.tsx): `app/auth/register/page.tsx`
- [Password Recovery](https://github.com/febrifelis/locatrip-web/blob/master/app/auth/forgot-password/page.tsx): `app/auth/forgot-password/page.tsx`
- [Profile](https://github.com/febrifelis/locatrip-web/blob/master/app/profile/page.tsx): `app/profile/page.tsx`
- [Wallet](https://github.com/febrifelis/locatrip-web/blob/master/app/wallet/page.tsx): `app/wallet/page.tsx`

### Shared Client

- [Navigation](https://github.com/febrifelis/locatrip-web/blob/master/components/layout/Navbar.tsx): `components/layout/Navbar.tsx`
- [App Providers](https://github.com/febrifelis/locatrip-web/blob/master/lib/providers.tsx): `lib/providers.tsx`
- [Auth State](https://github.com/febrifelis/locatrip-web/blob/master/store/authStore.ts): `store/authStore.ts`
- [HTTP API Client](https://github.com/febrifelis/locatrip-web/blob/master/lib/api.ts): `lib/api.ts`

### Other components

- **Traveler**
- **Locatrip API**

## Connections

- Traveler → Trip Search: searches trips (evidence: `app/search/page.tsx`)
- Trip Search → HTTP API Client: queries trips (evidence: `app/search/page.tsx`)
- Trip Search → Trip Details: opens trip (evidence: `app/search/page.tsx`)
- Trip Details → HTTP API Client: loads trip (evidence: `app/trips/[id]/page.tsx`)
- Booking Checkout → HTTP API Client: books and confirms (evidence: `app/trips/[id]/book/page.tsx`)
- Traveler → Login: signs in (evidence: `app/auth/login/page.tsx`)
- Traveler → Registration: registers (evidence: `app/auth/register/page.tsx`)
- Login → HTTP API Client: authenticates (evidence: `app/auth/login/page.tsx`)
- Registration → HTTP API Client: creates account (evidence: `app/auth/register/page.tsx`)
- Login → Auth State: sets session (evidence: `app/auth/login/page.tsx`)
- Registration → Auth State: sets session (evidence: `app/auth/register/page.tsx`)
- Login → Password Recovery: links to recovery (evidence: `app/auth/login/page.tsx`)
- Profile → HTTP API Client: logs out (evidence: `app/profile/page.tsx`)
- Profile → Auth State: reads and clears (evidence: `app/profile/page.tsx`)
- Wallet → HTTP API Client: reads and tops up (evidence: `app/wallet/page.tsx`)
- Wallet → Auth State: reads user (evidence: `app/wallet/page.tsx`)
- Tickets & Reviews → HTTP API Client: loads bookings (evidence: `app/tickets/page.tsx`)
- Tickets & Reviews → Auth State: reads user (evidence: `app/tickets/page.tsx`)
- Navigation → Auth State: reads session (evidence: `components/layout/Navbar.tsx`)
- Navigation → Trip Search: links to search (evidence: `components/layout/Navbar.tsx`)
- Navigation → Tickets & Reviews: links to tickets (evidence: `components/layout/Navbar.tsx`)
- Navigation → Wallet: links to wallet (evidence: `components/layout/Navbar.tsx`)
- App Providers → Navigation: renders (evidence: `app/layout.tsx`)
- HTTP API Client → Locatrip API: sends HTTP requests (evidence: `lib/api.ts`)
