# syedminamurrehman/rahguzar architecture

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

- Interactive diagram: https://gitdiagram.com/syedminamurrehman/rahguzar
- Repository: https://github.com/syedminamurrehman/rahguzar

## Overview

1. **Project shape**
   - RahGuzar is a **Next.js 15** front-end application using the **App Router** (`app/`).
   - The repo is primarily a **static, data-driven UI** for Karachi public transport information, not a backend/API service.

2. **Top-level entry points**
   - `app/layout.tsx` defines the global shell: shared metadata, fonts/styling setup, and page-wide structure.
   - `app/page.tsx` is the main landing page and likely composes the primary screen sections in order.

3. **UI composition layer**
   - Most of the experience is assembled from reusable components in `app/components/`:
     - `Navbar.tsx`, `Hero.tsx`, `Footer.tsx` for the page frame
     - `Filters.tsx`, `Search.tsx`, `Routes.tsx` for discovery/browsing
     - `modal.tsx` for route detail display
     - `servicecard.tsx` for route cards or route summaries
     - `banner.tsx`, `bubbles.tsx` for decorative/animated presentation
   - This suggests a mostly **component-driven architecture** with one main page orchestrating the sections.

4. **Data layer**
   - Route information lives in `app/data/routes.ts`.
   - This is the central data source for transport routes, stops, fare ranges, and transport categories.
   - There is no sign of a database, CMS, or external fetch layer in the repo; the app appears to use **local static data** bundled with the frontend.

5. **Primary user flow**
   - The user lands on the home page, sees route discovery controls, and browses transport options.
   - Filters and search refine the visible routes.
   - Selecting a route opens `modal.tsx` to show detailed route information, including stops and fare.
   - This is a **read-only interaction flow** driven by client-side state.

6. **Filtering and search boundaries**
   - `Filters.tsx` likely handles transport-type segmentation such as **BRTS, People Bus, Local Bus, and Chinchi**.
   - `Search.tsx` adds text-based discovery for routes or stops.
   - These components are the main interaction boundary between the user and the route dataset, controlling what appears in the list/grid.

7. **Route presentation**
   - `Routes.tsx` likely maps route data into visual cards or list items, probably using `servicecard.tsx`.
   - The route list is the main “catalog” view; it is where filtered/search results are rendered.
   - The detail modal is separate from the catalog, which keeps summary browsing and deep inspection cleanly split.

8. **Modal and interaction model**
   - `modal.tsx` is a key UX boundary for showing expanded route details without leaving the page.
   - The README indicates support for closing via outside click and Escape key, implying accessible overlay behavior.
   - This keeps navigation lightweight and avoids page transitions for each route.

9. **Styling and visual system**
   - `app/globals.css` holds the global CSS foundation.
   - The README indicates **Tailwind CSS** is used for most styling, with a modern responsive layout and motion-friendly UI.
   - `Framer Motion` is part of the experience for animated transitions and interactive effects.

10. **PWA and client assets**
   - `public/manifest.webmanifest` and `public/service-worker.js` indicate the app is set up as a **Progressive Web App**.
   - `public/images/` contains static assets used by the UI.
   - The service worker suggests offline/cache behavior for static resources, though the architecture remains frontend-only.

11. **Architecture boundaries to capture in a diagram**
   - **Presentation layer:** page/layout + reusable visual components
   - **Data layer:** static route dataset in `app/data/routes.ts`
   - **Interaction layer:** filters/search/modal state driving what the user sees
   - **Asset/runtime layer:** public static files, manifest, and service worker
   - There is no evidence of server-side business logic, authentication, or third-party API integration in the repository.

12. **What is notable for diagram accuracy**
   - The app is best drawn as a **single front-end application** with local data, not as a client/server system.
   - The main dependency chain is: **page → UI components → static route data → filtered route list → route detail modal**.
   - External route information is acknowledged in the README as curated from **mnzil.app / CheelTech**, but that appears to be a content source reference rather than a live integration.

Main entry points: [`app/page.tsx`](https://github.com/syedminamurrehman/rahguzar/blob/main/app/page.tsx) (Home page), [`app/components/Routes.tsx`](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Routes.tsx) (Routes list), [`app/data/routes.ts`](https://github.com/syedminamurrehman/rahguzar/blob/main/app/data/routes.ts) (Routes data), [`app/components/modal.tsx`](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/modal.tsx) (Route modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_shell["App shell"]
  node_n_layout["Layout<br/>nextjs shell<br/>[layout.tsx]"]
  node_n_page["Home page<br/>landing page<br/>[page.tsx]"]
end

subgraph group_g_ui["UI components"]
  node_n_navbar["Navbar<br/>navigation<br/>[Navbar.tsx]"]
  node_n_hero["Hero<br/>intro section<br/>[Hero.tsx]"]
  node_n_filters["Filters<br/>refinement UI<br/>[Filters.tsx]"]
  node_n_search["Search<br/>query UI<br/>[Search.tsx]"]
  node_n_routes["Routes list<br/>catalog view<br/>[Routes.tsx]"]
  node_n_servicecard["Route card<br/>summary card<br/>[servicecard.tsx]"]
  node_n_modal["Route modal<br/>detail overlay<br/>[modal.tsx]"]
  node_n_banner["Banner<br/>decorative ui<br/>[banner.tsx]"]
  node_n_bubbles["Bubbles<br/>animation<br/>[bubbles.tsx]"]
  node_n_footer["Footer<br/>[Footer.tsx]"]
end

subgraph group_g_data["Data"]
  node_n_routes_data["Routes data<br/>static dataset<br/>[routes.ts]"]
end

subgraph group_g_runtime["Public assets"]
  node_n_manifest["Manifest"]
  node_n_sw["Service worker<br/>offline runtime<br/>[service-worker.js]"]
  node_n_images[("Images<br/>static assets")]
end

node_n_layout -->|"renders"| node_n_page
node_n_page -->|"includes"| node_n_navbar
node_n_page -->|"includes"| node_n_hero
node_n_page -->|"includes"| node_n_filters
node_n_page -->|"includes"| node_n_search
node_n_page -->|"includes"| node_n_routes
node_n_page -->|"includes"| node_n_banner
node_n_page -->|"includes"| node_n_bubbles
node_n_page -->|"includes"| node_n_footer
node_n_routes -->|"uses"| node_n_servicecard
node_n_routes -->|"reads"| node_n_routes_data
node_n_filters -->|"filters"| node_n_routes_data
node_n_search -->|"queries"| node_n_routes_data
node_n_modal -->|"shows details"| node_n_routes_data
node_n_routes -->|"opens"| node_n_modal
node_n_page -->|"hosts"| node_n_modal
node_n_page -->|"ships with"| node_n_manifest
node_n_page -->|"ships with"| node_n_sw
node_n_page -->|"uses"| node_n_images

click node_n_layout "https://github.com/syedminamurrehman/rahguzar/blob/main/app/layout.tsx"
click node_n_page "https://github.com/syedminamurrehman/rahguzar/blob/main/app/page.tsx"
click node_n_navbar "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Navbar.tsx"
click node_n_hero "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Hero.tsx"
click node_n_filters "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Filters.tsx"
click node_n_search "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Search.tsx"
click node_n_routes "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Routes.tsx"
click node_n_servicecard "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/servicecard.tsx"
click node_n_modal "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/modal.tsx"
click node_n_banner "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/banner.tsx"
click node_n_bubbles "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/bubbles.tsx"
click node_n_footer "https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Footer.tsx"
click node_n_routes_data "https://github.com/syedminamurrehman/rahguzar/blob/main/app/data/routes.ts"
click node_n_manifest "https://github.com/syedminamurrehman/rahguzar/blob/main/public/manifest.webmanifest"
click node_n_sw "https://github.com/syedminamurrehman/rahguzar/blob/main/public/service-worker.js"
click node_n_images "https://github.com/syedminamurrehman/rahguzar/tree/main/public/images"

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_n_layout,node_n_page toneBlue
class node_n_navbar,node_n_hero,node_n_filters,node_n_search,node_n_routes,node_n_servicecard,node_n_modal,node_n_banner,node_n_bubbles,node_n_footer toneAmber
class node_n_routes_data toneMint
class node_n_manifest,node_n_sw,node_n_images toneRose
```

## Components

### App shell

Global Next.js layout and the main page entrypoint.

- [Layout](https://github.com/syedminamurrehman/rahguzar/blob/main/app/layout.tsx): nextjs shell · Defines the global app chrome, metadata, and shared structure. · `app/layout.tsx`
- [Home page](https://github.com/syedminamurrehman/rahguzar/blob/main/app/page.tsx): landing page · Main App Router page that assembles the transport discovery experience. · `app/page.tsx`

### UI components

Reusable presentation and interaction components for browsing routes.

- [Navbar](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Navbar.tsx): navigation · Top-level site navigation and brand header. · `app/components/Navbar.tsx`
- [Hero](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Hero.tsx): intro section · Primary landing content and visual entry section. · `app/components/Hero.tsx`
- [Filters](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Filters.tsx): refinement UI · Segments routes by transport category and other facets. · `app/components/Filters.tsx`
- [Search](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Search.tsx): query UI · Text-based route and stop discovery. · `app/components/Search.tsx`
- [Routes list](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Routes.tsx): catalog view · Renders the browsable list of routes and filtered results. · `app/components/Routes.tsx`
- [Route card](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/servicecard.tsx): summary card · Compact visual summary for an individual route. · `app/components/servicecard.tsx`
- [Route modal](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/modal.tsx): detail overlay · Shows expanded route details without leaving the page. · `app/components/modal.tsx`
- [Banner](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/banner.tsx): decorative ui · Promotional or visual accent component. · `app/components/banner.tsx`
- [Bubbles](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/bubbles.tsx): animation · Animated background or decorative motion element. · `app/components/bubbles.tsx`
- [Footer](https://github.com/syedminamurrehman/rahguzar/blob/main/app/components/Footer.tsx): site footer · Bottom-of-page informational footer. · `app/components/Footer.tsx`

### Data

Static route dataset bundled with the frontend.

- [Routes data](https://github.com/syedminamurrehman/rahguzar/blob/main/app/data/routes.ts): static dataset · Local transport routes, stops, fares, and categories used by the UI. · `app/data/routes.ts`

### Public assets

PWA metadata, service worker, and static images.

- [Manifest](https://github.com/syedminamurrehman/rahguzar/blob/main/public/manifest.webmanifest): pwa manifest · Web app manifest for installable PWA behavior. · `public/manifest.webmanifest`
- [Service worker](https://github.com/syedminamurrehman/rahguzar/blob/main/public/service-worker.js): offline runtime · Caches and serves static assets for offline-friendly behavior. · `public/service-worker.js`
- [Images](https://github.com/syedminamurrehman/rahguzar/tree/main/public/images): static assets · Image assets used across the UI. · `public/images`

## Connections

- Layout → Home page: renders · Global shell wraps the landing page.
- Home page → Navbar: includes · Page composes the header/navigation.
- Home page → Hero: includes · Page starts with the hero section.
- Home page → Filters: includes · Page exposes route filtering controls.
- Home page → Search: includes · Page exposes text search for route discovery.
- Home page → Routes list: includes · Page renders the route catalog.
- Home page → Banner: includes · Page uses decorative banner content.
- Home page → Bubbles: includes · Page uses animated decorative elements.
- Home page → Footer: includes · Page ends with the footer.
- Routes list → Route card: uses · Route list renders individual route cards.
- Routes list → Routes data: reads · Catalog is built from the bundled route dataset.
- Filters → Routes data: filters · Category controls operate on the shared route data.
- Search → Routes data: queries · Search matches route and stop information in the dataset.
- Route modal → Routes data: shows details · Modal displays expanded information for selected routes.
- Routes list → Route modal: opens · Selecting a route launches the detail overlay.
- Home page → Route modal: hosts · Modal is part of the page-level interaction flow.
- Home page → Manifest: ships with · App includes installable PWA metadata.
- Home page → Service worker: ships with · App includes offline/cache runtime support.
- Home page → Images: uses · Visuals and media are drawn from static image assets.
