# kphanipavan/iiitb_menu architecture

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

- Interactive diagram: https://gitdiagram.com/kphanipavan/iiitb_menu
- Repository: https://github.com/kphanipavan/iiitb_menu

## Overview

##### Main Components
- Core Application (Flutter Code): The heart of the project is the Flutter application, with its main logic and UI defined in the lib directory. Here you find constants (constants.dart), models (globalModel.dart, imageSearch.dart, initialPageIndexFunction.dart), views (homePage.dart, about.dart, bus.dart, etc.) and reusable widgets.
- Cross-Platform Native Integrations: Directories for Android, iOS, Linux, macOS, and Windows show that platform-specific integrations (build scripts, configurations) are maintained separately but share the core Flutter code.
- Web/PWA Delivery: The web folder contains PWA configuration files (index.html, manifest.json), enabling the app to be installed as a PWA on devices. Additionally, scripts (pwaOffline.patch, fixOfflinePWA.sh) indicate customizations to support offline functionality.
- CI/CD Pipeline: The .github/workflows folder shows automated build and deployment setups (e.g., gh-pages.yml), which are crucial for continuous deployment to GitHub Pages.
- Data and Automation Scripts: The scripts directory houses utilities like scrapeToJson.py, menu.csv, and others, indicating an automated mechanism to update or process menu data.

##### Interactions and Relationships
- The Flutter Core interacts with the respective platform layers. Emphasize that although the UI and business logic are shared, each platform folder (android, ios, etc.) provides specific configurations and integrations.
- CI/CD Integration: Represent the CI/CD tools and GitHub Actions workflows. Show how commits trigger testing and build processes, which eventually deploy to GitHub Pages or update native app packages.
- Data Updating Process: Highlight the flow from raw menu data (provided in CSV/script files) through automated scripts (scrapeToJson.py) to the Flutter application, possibly via JSON files that the app consumes.

##### Architectural Patterns and Design Principles
- Cross-Platform Development: The design leverages Flutter’s “write once, run anywhere” principle. Clearly separate the shared code (lib directory) from platform-specific configurations.
- Progressive Web App (PWA) Principles: For the web/PWA part, note the emphasis on offline support and installation mechanisms – include components that manage caching and manifest-based configurations.
- Continuous Integration/Continuous Deployment (CI/CD): The architecture includes automated workflows for building, testing, and deploying the app. Show pipelines as separate but integrated processes interacting with the main code repository.
- Modular and Reusable Code: With distinct directories for models, views, and widgets, it follows a modular design approach that enhances maintainability.

##### Final Detailed Elements
- Every component is labeled – from “lib (core logic)” to “android (native integration)” and “web (PWA configuration)”.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Define Core and Platform components
    subgraph "Core Application Layer"
        Core["lib (Business Logic & UI - Views, Widgets & Models)"]:::core
    end

    subgraph "Platform-Specific Layers"
        Android["Android Native Integration"]:::platform
        iOS["iOS Native Integration"]:::platform
        Linux["Linux Native Integration"]:::platform
        macOS["macOS Native Integration"]:::platform
        Windows["Windows Native Integration"]:::platform
    end

    subgraph "Web/PWA Delivery"
        Web["web (PWA configuration: index.html, manifest.json, icons)"]:::pwa
    end

    subgraph "CI/CD Pipeline"
        CICD["CI/CD (GitHub Actions)"]:::cicd
    end

    subgraph "Data & Automation"
        Data["Data & Automation Scripts"]:::data
    end

    %% Define relationships and flows
    CICD -->|"build&test" | Core
    CICD -->|"deploy to" | Web
    Data -->|"menu data update" | Core

    Core -->|"integrates with" | Android
    Core -->|"integrates with" | iOS
    Core -->|"integrates with" | Linux
    Core -->|"integrates with" | macOS
    Core -->|"integrates with" | Windows

    %% Styles
    classDef core fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef platform fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef pwa fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef cicd fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef data fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;

    %% Click Events
    click Core "https://github.com/kphanipavan/iiitb_menu/tree/master/lib"
    click Android "https://github.com/kphanipavan/iiitb_menu/tree/master/android"
    click iOS "https://github.com/kphanipavan/iiitb_menu/tree/master/ios"
    click Linux "https://github.com/kphanipavan/iiitb_menu/tree/master/linux"
    click macOS "https://github.com/kphanipavan/iiitb_menu/tree/master/macos"
    click Windows "https://github.com/kphanipavan/iiitb_menu/tree/master/windows"
    click Web "https://github.com/kphanipavan/iiitb_menu/tree/master/web"
    click CICD "https://github.com/kphanipavan/iiitb_menu/tree/master/.github/workflows"
    click Data "https://github.com/kphanipavan/iiitb_menu/tree/master/scripts"
```
