# manikantha-asam/vishnufoods architecture

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

- Interactive diagram: https://gitdiagram.com/manikantha-asam/vishnufoods
- Repository: https://github.com/manikantha-asam/vishnufoods

## Overview

##### Project Type and Purpose
- This is a full-stack web application called “College Canteen Food Preorder System.”
- Frontend: static HTML/CSS pages (home.html, loginpage.html, myorders.html, orders.html, vishnufoods.html) and client-side JavaScript (vishnufoods.js).
- Backend: Node.js + Express.js server that serves pages and may proxy or coordinate requests.
- Data & Auth: Firebase Authentication and Firebase Firestore (key.json holds Firebase config).

##### File Structure
- Top-level files:
- README.md, LICENSE – documentation
- home.html, loginpage.html, myorders.html, orders.html, vishnufoods.html – UI entry points
- vishnufoods.js – client-side logic to interact with Firebase
- key.json – Firebase project credentials/configuration
- No separate “src” folder shown, but Express routes and middleware should be inferred (likely in an unlisted server file).

##### README for Additional Insights
- Features: user registration/login, preorder, order management, real-time updates.
- Tech stack: Node.js, Express, Firebase Auth, Firebase Firestore, HTML/CSS.
- Runtime: npm start → Express server on port 3000.

a. Main Components
- Client Browser (Mobile/Desktop)
- Express.js Server (Node.js)
- Firebase Authentication Service
- Firebase Firestore Database
- Static Assets (HTML/CSS/JS)
b. Relationships & Interactions
1. User→Browser loads HTML pages from Express static routes.
2. Browser (vishnufoods.js) uses Firebase SDK to authenticate (sign-up/sign-in) with Firebase Auth.
3. Authenticated Browser reads/writes order data to Firestore.
4. Admin interface (orders.html) fetches all orders from Firestore; updates status.
c. Architectural Patterns
- Client-server separation: static front end vs. backend server.
- BFF (Backend-for-Frontend): Express serves pages and could enforce security rules.
- Real-time data via Firestore listeners.
d. Key Technologies
- Express.js for serving assets and routing.
- Firebase Auth SDK for authentication flows.
- Firebase Firestore SDK for data persistence and real-time updates.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Files
    subgraph "Project Files"
        direction TB
        Readme["README.md"]:::projectfile
        License["LICENSE"]:::projectfile
        Key["key.json"]:::projectfile
    end

    %% Frontend Layer
    subgraph "Client (Browser)" 
        direction TB
        Home["home.html"]:::frontend
        Login["loginpage.html"]:::frontend
        MyOrders["myorders.html"]:::frontend
        OrdersPage["orders.html"]:::frontend
        VishnuFoodsPage["vishnufoods.html"]:::frontend
        SDK["Firebase SDK & Listeners (vishnufoods.js)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend (Express.js Server)"
        direction TB
        Server["Express Server (Node.js)"]:::backend
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Auth["Firebase Authentication"]:::external
        Firestore["Firebase Firestore"]:::external
    end

    %% Relationships
    Home -->|"GET pages"| Server
    Login -->|"GET pages"| Server
    MyOrders -->|"GET pages"| Server
    OrdersPage -->|"GET pages"| Server
    VishnuFoodsPage -->|"GET pages"| Server

    SDK -->|"signIn/signUp"| Auth
    SDK -->|"read/write orders"| Firestore

    Server -->|"proxy Auth calls"| Auth
    Server -->|"proxy Firestore calls"| Firestore

    %% Click Events
    click Home "https://github.com/manikantha-asam/vishnufoods/blob/main/home.html"
    click Login "https://github.com/manikantha-asam/vishnufoods/blob/main/loginpage.html"
    click MyOrders "https://github.com/manikantha-asam/vishnufoods/blob/main/myorders.html"
    click OrdersPage "https://github.com/manikantha-asam/vishnufoods/blob/main/orders.html"
    click VishnuFoodsPage "https://github.com/manikantha-asam/vishnufoods/blob/main/vishnufoods.html"
    click SDK "https://github.com/manikantha-asam/vishnufoods/blob/main/vishnufoods.js"
    click Key "https://github.com/manikantha-asam/vishnufoods/blob/main/key.json"
    click Readme "https://github.com/manikantha-asam/vishnufoods/blob/main/README.md"
    click License "https://github.com/manikantha-asam/vishnufoods/tree/main/LICENSE"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef backend fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef projectfile fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
