# priyanshugagiya/order_management_tic_tac_toe architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshugagiya/order_management_tic_tac_toe
- Repository: https://github.com/priyanshugagiya/order_management_tic_tac_toe

## Overview

Step 1: Identify the project type and purpose
- This is a purely front-end, static order-management site (“Order_Management_Tic_Tac_Toe”) hosted on GitHub Pages.
- It collects orders via a Google Form, stores them in a Google Sheet, and displays order statuses through static HTML/CSS/JS pages.

Step 2: Analyze the file structure
- Top-level HTML pages (index.html, live-order.html, cancel.html, complete.html, product.html, profile.html) each present a different view/state of an order.
- Corresponding JavaScript modules (placed.js, status.js, accepted.js, cancelled.js, Dispatched.js, Dilivered.js, dispatched.html, placed.html) implement page-specific logic: fetching data, filtering by status, rendering.
- style3.css, styles.css, styles2.css provide visual theming; script.js and table.js contain shared UI and data-table routines.
- No dedicated “backend” or server directory—data access is handled client-side via Google Forms/Sheets.

Step 3: Examine the README for additional insights
- Orders come in through a published Google Form URL.
- An admin updates order statuses directly in a Google Sheet (access via Spreadsheet link).
- The “Live Website” is simply the static pages on GitHub Pages.

a. Main components:
- Client Browser (Customer UI)
- Static Site Host (GitHub Pages OR any CDN)
- Google Forms Service (Order Intake API)
- Google Sheets Service (Data Storage & Admin UI)
- Admin User (Spreadsheet Editor)

b. Relationships & data flows:
1. Customer → Browser loads HTML/CSS/JS from Static Host
2. Browser → Google Form endpoint (POST) when placing an order
3. Google Form → Appends a row in Google Sheet
4. Admin User → Edits status fields in the Google Sheet
5. Browser → Reads sheet data (via Sheets API or published CSV) to populate status pages

c. Architectural patterns/design principles:
- Client-side integration only (no custom backend)
- Modular JS per page (each .js file handles one status/view)
- Progressive enhancement: static fallback pages with dynamic data injection

d. Key technologies/frameworks/libraries:
- HTML5 + CSS3 + plain JavaScript
- Google Forms API (form submission endpoint)
- Google Sheets API or published Sheet feed
- GitHub Pages or any static-file host

- That it is a static front-end project with no server-side code.
- That the “database” is actually a Google Sheet.

- Blue for static artifacts (HTML/CSS/JS)
- Green for external services (Forms/Sheets)
- Orange for human actors (Customer, Admin)

Step 7: Detail and completeness
- Do not over-simplify: break out each page-module if necessary to show how the client chooses which JS runs.

## Diagram (Mermaid)

```mermaid
flowchart TB
    ActorCustomer["Customer"]:::actor
    ActorAdmin["Admin User"]:::actor

    subgraph "Client App (Browser)"
        direction TB
        Dashboard["Main Dashboard<br>(index.html + script.js)"]:::static
        LiveOrders["Live Orders View<br>(live-order.html + status.js)"]:::static
        PlacedOrders["Placed Orders View<br>(placed.html + placed.js)"]:::static
        AcceptedLogic["Accepted Orders Logic<br>(accepted.js)"]:::static
        DispatchedOrders["Dispatched Orders View<br>(dispatched.html + Dispatched.js)"]:::static
        DeliveredOrders["Complete Orders View<br>(complete.html + Dilivered.js)"]:::static
        CancelledOrders["Cancelled Orders View<br>(cancel.html + cancelled.js)"]:::static

        subgraph "Shared UI Utilities"
            direction TB
            TableJS["Table Rendering<br>(table.js)"]:::static
            Helpers["General Helpers<br>(abcd.js)"]:::static
        end

        subgraph "Shared Styling"
            direction TB
            stylesCSS["styles.css"]:::static
            styles2CSS["styles2.css"]:::static
            style3CSS["style3.css"]:::static
        end
    end

    Repo["GitHub Repo"]:::static
    StaticHost["GitHub Pages<br>(Static Host)"]:::static
    FormService["Google Form Service<br>(Order Intake API)"]:::external
    SheetService["Google Sheets Service<br>(Data Storage & Admin UI)"]:::external

    %% Data Flows
    ActorCustomer -->|opens page| Dashboard
    StaticHost -->|serves pages| Dashboard
    StaticHost -->|serves pages| LiveOrders
    StaticHost -->|serves pages| PlacedOrders
    StaticHost -->|serves pages| AcceptedLogic
    StaticHost -->|serves pages| DispatchedOrders
    StaticHost -->|serves pages| DeliveredOrders
    StaticHost -->|serves pages| CancelledOrders

    Dashboard -->|POST /formResponse| FormService
    FormService -->|appends row| SheetService
    ActorAdmin -->|edits statuses| SheetService

    LiveOrders -->|GET sheet data| SheetService
    PlacedOrders -->|GET sheet data| SheetService
    AcceptedLogic -->|GET sheet data| SheetService
    DispatchedOrders -->|GET sheet data| SheetService
    DeliveredOrders -->|GET sheet data| SheetService
    CancelledOrders -->|GET sheet data| SheetService

    Repo -->|CI/CD push| StaticHost

    %% Click Events
    click Dashboard "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/index.html"
    click Dashboard "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/script.js"
    click LiveOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/live-order.html"
    click LiveOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/status.js"
    click PlacedOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/placed.html"
    click PlacedOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/placed.js"
    click AcceptedLogic "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/accepted.js"
    click DispatchedOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/dispatched.html"
    click DispatchedOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/Dispatched.js"
    click DeliveredOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/complete.html"
    click DeliveredOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/Dilivered.js"
    click CancelledOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/cancel.html"
    click CancelledOrders "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/cancelled.js"
    click TableJS "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/table.js"
    click Helpers "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/abcd.js"
    click stylesCSS "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/styles.css"
    click styles2CSS "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/styles2.css"
    click style3CSS "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/style3.css"
    click Repo "https://github.com/priyanshugagiya/order_management_tic_tac_toe/blob/main/README.md"

    %% Styles
    classDef actor fill:#f9c784,stroke:#e89b3b,stroke-width:2px
    classDef external fill:#a2d5ab,stroke:#4a8f52,stroke-width:2px
    classDef static fill:#9ec1cf,stroke:#497c92,stroke-width:2px
```
