# youssefatef289/mishwar architecture

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

- Interactive diagram: https://gitdiagram.com/youssefatef289/mishwar
- Repository: https://github.com/youssefatef289/mishwar

## Overview

Mishwar is a Next.js car-rental and fleet-management web app with renter, dealer, and individual-host views. The visible renter journey starts at the car-discovery home page, continues to fleet listings and car details, then exposes booking status and dealer chat through the renter’s bookings page. Dealer and host dashboards manage listings and booking decisions. The sampled runtime persists application data in browser localStorage rather than a server database. Several route capabilities are clear from the tree, but their internals and connections were not sampled.

Main entry points: [`src/utils/storage.ts`](https://github.com/youssefatef289/mishwar/blob/main/src/utils/storage.ts) (Browser data store), [`src/components/Navbar.tsx`](https://github.com/youssefatef289/mishwar/blob/main/src/components/Navbar.tsx) (Role-aware navigation), [`src/app/page.tsx`](https://github.com/youssefatef289/mishwar/blob/main/src/app/page.tsx) (Car discovery), [`src/app/my-bookings/page.tsx`](https://github.com/youssefatef289/mishwar/blob/main/src/app/my-bookings/page.tsx) (Renter bookings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_shell["App shell"]
  node_layout["Shared app layout<br/>[layout.tsx]"]
  node_initializer["Storage initialization<br/>[AppInitializer.tsx]"]
  node_navbar["Role-aware navigation<br/>[Navbar.tsx]"]
  node_storage[("Browser data store<br/>[storage.ts]")]
end

subgraph group_renter["Renter experience"]
  node_home["Car discovery<br/>[page.tsx]"]
  node_fleet["Fleet listings<br/>[page.tsx]"]
  node_car_details["Car details<br/>[page.tsx]"]
  node_bookings["Renter bookings<br/>[page.tsx]"]
  node_booking_admin["Booking management<br/>[page.tsx]"]
end

subgraph group_fleet_ops["Fleet operations"]
  node_dealer_dashboard["Dealer operations<br/>[page.tsx]"]
  node_host_dashboard["Host listings<br/>[page.tsx]"]
  node_dealer_home["Dealer area<br/>[page.tsx]"]
  node_branches["Branch directory<br/>[page.tsx]"]
  node_contracts["Contracts and invoices<br/>[page.tsx]"]
  node_admin["Administration<br/>[page.tsx]"]
end

subgraph group_account_comms["Accounts and communication"]
  node_login["Sign in<br/>[page.tsx]"]
  node_register["Registration<br/>[page.tsx]"]
  node_profile["User profile<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
  node_renter_chat["Renter chat<br/>[page.tsx]"]
  node_dealer_chat["Dealer chat<br/>[page.tsx]"]
end

node_visitor(("Visitor / renter"))
node_dealer_actor(("Dealer"))
node_host_actor(("Car host"))

node_layout -->|"renders"| node_initializer
node_layout -->|"renders"| node_navbar
node_initializer -->|"initializes"| node_storage
node_navbar -->|"reads session"| node_storage
node_navbar -->|"links to"| node_home
node_navbar -->|"links to"| node_fleet
node_navbar -->|"links to"| node_login
node_navbar -->|"links to"| node_register
node_visitor -.->|"browses"| node_home
node_home -->|"reads fleet"| node_storage
node_home -->|"links to"| node_car_details
node_fleet -->|"reads fleet"| node_storage
node_fleet -->|"links to"| node_car_details
node_car_details -->|"reads car"| node_storage
node_bookings -->|"loads bookings"| node_storage
node_bookings -->|"loads car details"| node_storage
node_bookings -->|"links to"| node_renter_chat
node_dealer_dashboard -->|"manages fleet and bookings"| node_storage
node_host_dashboard -->|"manages fleet"| node_storage
node_login -->|"authenticates user"| node_storage
node_register -->|"saves account"| node_storage
node_renter_chat -->|"uses conversations"| node_storage
node_dealer_chat -->|"uses conversations"| node_storage
node_dealer_actor -.->|"manages bookings"| node_dealer_dashboard
node_host_actor -.->|"lists cars"| node_host_dashboard

click node_layout "https://github.com/youssefatef289/mishwar/blob/main/src/app/layout.tsx"
click node_initializer "https://github.com/youssefatef289/mishwar/blob/main/src/components/AppInitializer.tsx"
click node_navbar "https://github.com/youssefatef289/mishwar/blob/main/src/components/Navbar.tsx"
click node_home "https://github.com/youssefatef289/mishwar/blob/main/src/app/page.tsx"
click node_fleet "https://github.com/youssefatef289/mishwar/blob/main/src/app/fleet/page.tsx"
click node_car_details "https://github.com/youssefatef289/mishwar/blob/main/src/app/fleet/%5Bid%5D/page.tsx"
click node_bookings "https://github.com/youssefatef289/mishwar/blob/main/src/app/my-bookings/page.tsx"
click node_booking_admin "https://github.com/youssefatef289/mishwar/blob/main/src/app/bookings/page.tsx"
click node_dealer_dashboard "https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/dashboard/page.tsx"
click node_host_dashboard "https://github.com/youssefatef289/mishwar/blob/main/src/app/host/dashboard/page.tsx"
click node_dealer_home "https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/page.tsx"
click node_branches "https://github.com/youssefatef289/mishwar/blob/main/src/app/branches/page.tsx"
click node_contracts "https://github.com/youssefatef289/mishwar/blob/main/src/app/contracts/page.tsx"
click node_admin "https://github.com/youssefatef289/mishwar/blob/main/src/app/admin/page.tsx"
click node_login "https://github.com/youssefatef289/mishwar/blob/main/src/app/login/page.tsx"
click node_register "https://github.com/youssefatef289/mishwar/blob/main/src/app/register/page.tsx"
click node_profile "https://github.com/youssefatef289/mishwar/blob/main/src/app/profile/page.tsx"
click node_notifications "https://github.com/youssefatef289/mishwar/blob/main/src/app/notifications/page.tsx"
click node_renter_chat "https://github.com/youssefatef289/mishwar/blob/main/src/app/renter/chat/page.tsx"
click node_dealer_chat "https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/chat/page.tsx"
click node_storage "https://github.com/youssefatef289/mishwar/blob/main/src/utils/storage.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_layout,node_initializer,node_navbar,node_storage toneBlue
class node_home,node_fleet,node_car_details,node_bookings,node_booking_admin toneAmber
class node_dealer_dashboard,node_host_dashboard,node_dealer_home,node_branches,node_contracts,node_admin toneMint
class node_login,node_register,node_profile,node_notifications,node_renter_chat,node_dealer_chat toneRose
class node_visitor,node_dealer_actor,node_host_actor toneIndigo
```

## Components

### App shell

- [Shared app layout](https://github.com/youssefatef289/mishwar/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Storage initialization](https://github.com/youssefatef289/mishwar/blob/main/src/components/AppInitializer.tsx): `src/components/AppInitializer.tsx`
- [Role-aware navigation](https://github.com/youssefatef289/mishwar/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Browser data store](https://github.com/youssefatef289/mishwar/blob/main/src/utils/storage.ts): `src/utils/storage.ts`

### Renter experience

- [Car discovery](https://github.com/youssefatef289/mishwar/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Fleet listings](https://github.com/youssefatef289/mishwar/blob/main/src/app/fleet/page.tsx): `src/app/fleet/page.tsx`
- [Car details](https://github.com/youssefatef289/mishwar/blob/main/src/app/fleet/%5Bid%5D/page.tsx): `src/app/fleet/[id]/page.tsx`
- [Renter bookings](https://github.com/youssefatef289/mishwar/blob/main/src/app/my-bookings/page.tsx): `src/app/my-bookings/page.tsx`
- [Booking management](https://github.com/youssefatef289/mishwar/blob/main/src/app/bookings/page.tsx): `src/app/bookings/page.tsx`

### Fleet operations

- [Dealer operations](https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/dashboard/page.tsx): `src/app/dealer/dashboard/page.tsx`
- [Host listings](https://github.com/youssefatef289/mishwar/blob/main/src/app/host/dashboard/page.tsx): `src/app/host/dashboard/page.tsx`
- [Dealer area](https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/page.tsx): `src/app/dealer/page.tsx`
- [Branch directory](https://github.com/youssefatef289/mishwar/blob/main/src/app/branches/page.tsx): `src/app/branches/page.tsx`
- [Contracts and invoices](https://github.com/youssefatef289/mishwar/blob/main/src/app/contracts/page.tsx): `src/app/contracts/page.tsx`
- [Administration](https://github.com/youssefatef289/mishwar/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`

### Accounts and communication

- [Sign in](https://github.com/youssefatef289/mishwar/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Registration](https://github.com/youssefatef289/mishwar/blob/main/src/app/register/page.tsx): `src/app/register/page.tsx`
- [User profile](https://github.com/youssefatef289/mishwar/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Notifications](https://github.com/youssefatef289/mishwar/blob/main/src/app/notifications/page.tsx): `src/app/notifications/page.tsx`
- [Renter chat](https://github.com/youssefatef289/mishwar/blob/main/src/app/renter/chat/page.tsx): `src/app/renter/chat/page.tsx`
- [Dealer chat](https://github.com/youssefatef289/mishwar/blob/main/src/app/dealer/chat/page.tsx): `src/app/dealer/chat/page.tsx`

### Other components

- **Visitor / renter**
- **Dealer**
- **Car host**

## Connections

- Shared app layout → Storage initialization: renders (evidence: `src/app/layout.tsx`)
- Shared app layout → Role-aware navigation: renders (evidence: `src/app/layout.tsx`)
- Storage initialization → Browser data store: initializes (evidence: `src/components/AppInitializer.tsx`)
- Role-aware navigation → Browser data store: reads session (evidence: `src/components/Navbar.tsx`)
- Role-aware navigation → Car discovery: links to (evidence: `src/components/Navbar.tsx`)
- Role-aware navigation → Fleet listings: links to (evidence: `src/components/Navbar.tsx`)
- Role-aware navigation → Sign in: links to (evidence: `src/components/Navbar.tsx`)
- Role-aware navigation → Registration: links to (evidence: `src/components/Navbar.tsx`)
- Visitor / renter → Car discovery: browses
- Car discovery → Browser data store: reads fleet (evidence: `src/app/page.tsx`)
- Car discovery → Car details: links to (evidence: `src/app/page.tsx`)
- Fleet listings → Browser data store: reads fleet (evidence: `src/app/fleet/page.tsx`)
- Fleet listings → Car details: links to (evidence: `src/app/fleet/page.tsx`)
- Car details → Browser data store: reads car (evidence: `src/app/fleet/[id]/page.tsx`)
- Renter bookings → Browser data store: loads bookings (evidence: `src/app/my-bookings/page.tsx`)
- Renter bookings → Browser data store: loads car details (evidence: `src/app/my-bookings/page.tsx`)
- Renter bookings → Renter chat: links to (evidence: `src/app/my-bookings/page.tsx`)
- Dealer operations → Browser data store: manages fleet and bookings (evidence: `src/app/dealer/dashboard/page.tsx`)
- Host listings → Browser data store: manages fleet (evidence: `src/app/host/dashboard/page.tsx`)
- Sign in → Browser data store: authenticates user (evidence: `src/app/login/page.tsx`)
- Registration → Browser data store: saves account (evidence: `src/app/register/page.tsx`)
- Renter chat → Browser data store: uses conversations (evidence: `src/app/renter/chat/page.tsx`)
- Dealer chat → Browser data store: uses conversations (evidence: `src/app/dealer/chat/page.tsx`)
- Dealer → Dealer operations: manages bookings
- Car host → Host listings: lists cars
