# mahamudu-halic/pice-pizza architecture

> Architecture diagram of the GitHub repository mahamudu-halic/pice-pizza, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahamudu-halic/pice-pizza
- Repository: https://github.com/mahamudu-halic/pice-pizza

## Overview

##### Project type and purpose
- This is a Single-Page Application (SPA) built with React and Vite.
- It implements a pizza-ordering front-end with both customer and admin interfaces.
- Key features:
- Customer flows (landing, menu browsing, order customization, payment, order history)
- Authentication (sign-in, sign-up, password reset, email verification)
- Admin flows (dashboard, orders, menu/toppings management, admin management)
- 3D pizza-ingredient assets served as static files

##### File structure
- Top-level:
- vite.config.js, package.json, index.html – Vite build & dev server
- public/ – static 3D models (.glb) for ingredients
- src/:
- src/main.jsx + index.css – application bootstrap
- src/App.jsx + App.css – root component & styling
- src/components/, src/screens/ – UI building blocks and routed pages
- src/admin/ – admin UI split into components, features, services, styles
- src/services/ – service layer (contexts + API calls) for auth, orders, admin
- src/modules/ – shared small wrappers (e.g., overlay)
- src/assets, src/styles, src/constant.jsx – global assets, CSS, constants

##### README
- It’s the default React+Vite template README.
- No backend is shipped here; all API calls go to external endpoints (not checked in).

##### Elements
- Clear labels: e.g., “React Router”, “AuthContext”, “AdminService”
- From Browser → Vite → React SPA
- Within SPA: UI → Service Layer → External APIs → Service Layer → UI
- Blue rectangles for UI components

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["Browser"]:::browser
    Host["Vite Dev Server / Static Host\n(vite.config.js, index.html)"]:::host
    Browser --> Host
    Host --> SPA["React SPA"]:::spa

    subgraph "React SPA"
        direction TB

        Bootstrap["Application Bootstrap\n(src/main.jsx,\nsrc/index.css)"]:::service
        RootApp["Root Component & Routing\n(src/App.jsx, src/App.css)"]:::router
        Constants["Global Constants\n(src/constant.jsx)"]:::shared
        SharedUI["Shared UI Components\n(src/components/)"]:::shared
        Modules["Shared Modules / Utilities\n(src/modules/)"]:::shared

        subgraph "Customer UI" 
            direction TB
            CustomerScreens["Customer-Facing Screens\n(src/screens/)"]:::ui
        end

        subgraph "Admin UI"
            direction TB
            AdminComponents["Admin UI Components\n(src/admin/components/)"]:::admin
            AdminPages["Admin Feature Pages\n(src/admin/features/)"]:::admin
        end

        subgraph "Service Layer & Context"
            direction TB
            AuthService["Auth Service\n(src/services/auth/auth.service.js)"]:::service
            AuthContext["Auth Context\n(src/services/auth/auth.context.jsx)"]:::context
            OrderService["Order Service\n(src/services/order/order.service.jsx)"]:::service
            OrderContext["Order Context\n(src/services/order/order.context.jsx)"]:::context
            AdminService["Admin Service\n(src/services/admin/admin.service.jsx)"]:::service
            AdminContext["Admin Context\n(src/services/admin/admin.context.jsx)"]:::context
            DashboardContext["Admin Dashboard Context\n(src/admin/services/dashboard/dashboard.context.jsx)"]:::context
        end

        StaticAssets["Public Static Assets\n(public/*.glb)"]:::static

        Host --> Bootstrap
        Bootstrap --> RootApp
        RootApp --> Constants
        RootApp --> SharedUI
        RootApp --> Modules
        RootApp --> CustomerScreens
        RootApp --> AdminComponents
        RootApp --> AdminPages
        RootApp --> AuthContext
        RootApp --> OrderContext
        RootApp --> AdminContext

        CustomerScreens --> AuthService
        CustomerScreens --> OrderService
        AdminComponents --> AdminService
        AdminPages --> AdminService
        AdminPages --> DashboardContext

        AuthContext --> AuthService
        OrderContext --> OrderService
        AdminContext --> AdminService

        AuthService --> AuthAPI
        OrderService --> OrderAPI
        AdminService --> AdminAPI

        StaticAssets --> RootApp
    end

    subgraph "External APIs"
        direction TB
        AuthAPI["Auth API"]:::external
        OrderAPI["Order API"]:::external
        AdminAPI["Admin API"]:::external
        PaymentAPI["Payment Gateway"]:::external
    end

    AuthAPI --> AuthService
    OrderAPI --> OrderService
    AdminAPI --> AdminService
    PaymentAPI --> OrderService
    PaymentAPI --> AdminService

    classDef browser fill:#a2d2ff,stroke:#1d3557;
    classDef host fill:#ade8f4,stroke:#1d3557;
    classDef spa fill:#caf0f8,stroke:#0077b6;
    classDef ui fill:#90e0ef,stroke:#03045e;
    classDef admin fill:#90e0ef,stroke:#03045e;
    classDef shared fill:#90e0ef,stroke:#03045e;
    classDef router fill:#f0efeb,stroke:#495057,stroke-width:2px;
    classDef context fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef service fill:#ffe5b4,stroke:#ff8c00,stroke-width:2px;
    classDef external fill:#ffc8dd,stroke:#d00000,stroke-width:2px;
    classDef static fill:#e0e0e0,stroke:#6c757d;

    click Host "https://github.com/mahamudu-halic/pice-pizza/blob/master/vite.config.js"
    click Bootstrap "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/main.jsx"
    click Bootstrap "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/index.css"
    click RootApp "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/App.jsx"
    click Constants "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/constant.jsx"
    click SharedUI "https://github.com/mahamudu-halic/pice-pizza/tree/master/src/components/"
    click Modules "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/modules/overlay.module.jsx"
    click Modules "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/modules/module.css"
    click CustomerScreens "https://github.com/mahamudu-halic/pice-pizza/tree/master/src/screens/"
    click AdminComponents "https://github.com/mahamudu-halic/pice-pizza/tree/master/src/admin/components/"
    click AdminPages "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/admin/features/dashboard.jsx"
    click AuthContext "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/auth/auth.context.jsx"
    click AuthService "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/auth/auth.service.js"
    click OrderContext "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/order/order.context.jsx"
    click OrderService "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/order/order.service.jsx"
    click AdminContext "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/admin/admin.context.jsx"
    click AdminService "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/services/admin/admin.service.jsx"
    click DashboardContext "https://github.com/mahamudu-halic/pice-pizza/blob/master/src/admin/services/dashboard/dashboard.context.jsx"
    click StaticAssets "https://github.com/mahamudu-halic/pice-pizza/blob/master/public/*.glb"
```
