# harshjii/biriyani_delivery_web- architecture

> Architecture diagram of the GitHub repository harshjii/biriyani_delivery_web-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshjii/biriyani_delivery_web-
- Repository: https://github.com/harshjii/biriyani_delivery_web-

## Overview

##### Project Type & Purpose
- This is a full-stack—primarily front-end—web application for ordering Biriyani, built in React/TypeScript with Vite. It includes a Capacitor config, so it’s also deployable as a hybrid mobile app.
- Its purpose: provide users with a smooth ordering experience via a modern UI and external backend services (order management, payments, etc.).

##### File Structure
- Top-level files:
- package.json, bun.lockb, tsconfig.* → Node/TypeScript build
- vite.config.ts, postcss.config.js, tailwind.config.ts → build tooling and styling
- capacitor.config.ts → mobile app bridge
- public/ → static assets (robots.txt, index.html)
- src/
- App.tsx, main.tsx, index.css → entrypoints
- components/ui/ → 70+ reusable UI primitives (buttons, dialogs, tables, etc.)
- hooks/ → custom hooks (useMobile, useToast)
- lib/utils.ts → shared utilities
- pages/ → routeable views (Index, SlotSelection, NotFound)
- No back-end code here, so assume reliance on external REST/GraphQL APIs.

##### Pull In README Insights
- Modern, fast ordering experience with a live URL.
- No self-hosted backend in this repo → external microservices handle orders, user profiles, payments.
- Hybrid mobile support via Capacitor.

##### Main Components & Boundaries
a. Front-end UI (React + TypeScript)
- Component Library (shadcn/ui, Tailwind CSS)
- Pages & Routing (Vite + React Router or similar)
- State & Hooks (React Context, custom hooks)
- Build Toolchain (Vite, PostCSS, Tailwind)
b. Hybrid Mobile Wrapper (Capacitor)
- Native Plugins (e.g., push notifications, camera)
c. CDN/Static Host
- Netlify, Vercel, or S3 + CloudFront for serving built static assets
d. External Services (third-party or in your infra)
- Authentication Service (Auth0 / custom API)
- Order Management API (create, view orders)
- Payment Gateway (Stripe / PayPal)
- Notification Service (Firebase / OneSignal)
- Analytics (Google Analytics / other)
e. Developer Tooling & CI/CD
- GitHub Actions / Netlify CI for build and deploy

##### Relationships & Data Flows
- User Device (Browser or Mobile) → HTTPS → CDN/Static Host → served index.html + JS bundle
- JS Bundle → renders React UI → user actions call:
- Auth API → user tokens
- Order API → fetch menu, place orders
- Payment API → payment processing
- Notification API → push notifications (mobile)
- Build Pipeline (Git push → CI/CD → Vite build → deploy to CDN/Store)

##### Architectural Patterns & Principles
- Component-based UI (atomic/shadcn pattern)
- Separation of concerns: UI vs. data layer (hooks + lib/utils)
- Hybrid deployment: one codebase for web and mobile (Capacitor)
- Static-first hosting with dynamic API calls

##### Final Checklist
- Components: UI Library, Pages, Hooks, Utils, Build Tools, Capacitor
- External APIs: Auth, Orders, Payments, Notifications, Analytics
- Infrastructure: CDN/Hosting, CI/CD pipeline
- Annotations: tech labels (React TS, Vite, Tailwind, Capacitor)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Device
    User["User Device<br/>(Browser)"]:::user

    %% CDN / Static Host
    CDN["CDN / Static Host"]:::infra
    User -->|"HTTPS GET"| CDN

    %% Web App Container
    subgraph "Web App (React TS)" 
        direction TB
        %% Static Assets
        HTML["HTML Template<br/>index.html"]:::frontend
        PublicAssets["Public Assets<br/>public/"]:::frontend
        HTML --> PublicAssets

        %% Entrypoints
        subgraph "Entrypoints"
            direction TB
            Main["main.tsx"]:::frontend
            AppComponent["App.tsx"]:::frontend
        end

        %% Core Modules
        subgraph "Core Modules"
            direction TB
            UI["UI Primitives"]:::frontend
            subgraph "Pages & Routing"
                direction TB
                IndexPage["Index Page"]:::frontend
                SlotSelectionPage["SlotSelection Page"]:::frontend
                NotFoundPage["NotFound Page"]:::frontend
            end
            subgraph "Custom Hooks"
                direction TB
                UseMobile["use-mobile.tsx"]:::frontend
                UseToast["use-toast.ts"]:::frontend
            end
            Utils["utils.ts"]:::frontend
        end

        %% Build Tools
        subgraph "Build Toolchain"
            direction TB
            ViteConfig["vite.config.ts"]:::infra
            TailwindConfig["tailwind.config.ts"]:::infra
            PostCSSConfig["postcss.config.js"]:::infra
        end

        %% Relationships within Web App
        CDN -->|serves assets| HTML
        HTML -->|loads entrypoint| Main
        Main -->|renders| AppComponent
        AppComponent --> UI
        AppComponent --> IndexPage
        AppComponent --> SlotSelectionPage
        AppComponent --> NotFoundPage
        AppComponent --> UseMobile
        AppComponent --> UseToast
        AppComponent --> Utils
        ViteConfig -->|build| CDN
        TailwindConfig -->|style| CDN
        PostCSSConfig -->|process| CDN
    end

    %% Mobile App Container
    subgraph "Mobile App (Capacitor)"
        direction TB
        CapacitorConfig["capacitor.config.ts"]:::infra
    end
    AppComponent -->|wraps in Capacitor| CapacitorConfig

    %% External Services
    subgraph "External Services"
        direction TB
        AuthAPI["Authentication API"]:::external
        OrderAPI["Order Management API"]:::external
        PaymentAPI["Payment Gateway API"]:::external
        NotificationAPI["Notification Service"]:::external
        AnalyticsAPI["Analytics Service"]:::external
    end
    AppComponent -->|calls| AuthAPI
    AppComponent -->|calls| OrderAPI
    AppComponent -->|calls| PaymentAPI
    AppComponent -->|calls| NotificationAPI
    AppComponent -->|tracks| AnalyticsAPI

    %% CI/CD Pipeline
    DevPush["Git Push"]:::infra
    CI["CI/CD Pipeline"]:::infra
    DevPush --> CI
    CI --> ViteConfig

    %% Project Metadata
    subgraph "Project Metadata"
        direction TB
        PackageJSON["package.json"]:::infra
        Readme["README.md"]:::infra
    end

    %% Click Events
    click UI "https://github.com/harshjii/biriyani_delivery_web-/tree/main/src/components/ui/"
    click IndexPage "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/pages/Index.tsx"
    click SlotSelectionPage "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/pages/SlotSelection.tsx"
    click NotFoundPage "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/pages/NotFound.tsx"
    click UseMobile "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/lib/utils.ts"
    click Main "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/main.tsx"
    click AppComponent "https://github.com/harshjii/biriyani_delivery_web-/blob/main/src/App.tsx"
    click ViteConfig "https://github.com/harshjii/biriyani_delivery_web-/blob/main/vite.config.ts"
    click TailwindConfig "https://github.com/harshjii/biriyani_delivery_web-/blob/main/tailwind.config.ts"
    click PostCSSConfig "https://github.com/harshjii/biriyani_delivery_web-/blob/main/postcss.config.js"
    click CapacitorConfig "https://github.com/harshjii/biriyani_delivery_web-/blob/main/capacitor.config.ts"
    click HTML "https://github.com/harshjii/biriyani_delivery_web-/blob/main/index.html"
    click PublicAssets "https://github.com/harshjii/biriyani_delivery_web-/tree/main/public/"
    click PackageJSON "https://github.com/harshjii/biriyani_delivery_web-/blob/main/package.json"
    click Readme "https://github.com/harshjii/biriyani_delivery_web-/blob/main/README.md"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#00796B,color:#004D40
    classDef external fill:#E8F5E9,stroke:#2E7D32,color:#1B5E20
    classDef infra fill:#FFF3E0,stroke:#F57C00,color:#E65100
    classDef user fill:#E3F2FD,stroke:#1565C0,color:#0D47A1
```
