# arun2728/bigfoot architecture

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

- Interactive diagram: https://gitdiagram.com/arun2728/bigfoot
- Repository: https://github.com/arun2728/bigfoot

## Overview

##### Main Components
- Client Browser: Represents the user’s web browser that accesses the application.
- Flask Web Server (app.py): Acts as the central backend application that handles HTTP requests and routes them accordingly.
- Static Assets: The “static” directory encompasses CSS, JavaScript, images, fonts, and other assets used both for styling and dynamic behavior on the web pages.
- HTML Templates: The “templates” directory holds the HTML files including those for home, ML model-specific pages (Classification, Regression, etc.), and other static pages.
- Machine Learning Models: Within the “templates/Supervised” subdirectories, various ML models are stored (e.g., model pickle files, associated CSVs, and even some Python model scripts). These provide the prediction, classification, and regression functionalities.
- Email/Contact Feature: The application supports a contact form through which users can send queries. This functionality has dedicated JavaScript and PHP scripts (as seen in static/assets/mail) and is responsible for sending verification emails to the client and notification emails to the system administrator.

##### Relationships and Data Flows
- Users interact with the application via their browser by submitting forms or viewing pages.
- The Flask application (app.py) acts as the controller that routes incoming requests to the proper view/template.
- When a user requests machine learning predictions (for classifications or regressions), the app loads the corresponding model files (e.g., .pkl files located within the templates/Supervised folders) to perform computations.
- For the contact functionality, data submitted by the user is processed by the back-end, which then triggers the email sending mechanism.
- Static files (JS, CSS, images) are served to enrich the UI and enhance user experience, while any external calls (like sending emails) may interact with external email services or APIs if configured.

##### Architectural Patterns and Design Principles
- MVC (Model–View–Controller) Patterns: Although the structure is somewhat simplified, the Flask app essentially handles control (routing and request handling), with “templates” serving as the view and ML model files acting as part of the model.
- Separation of Concerns: There is a deliberate separation between frontend (static assets and HTML templates), business logic (in app.py), and the machine learning components (stored in organized subdirectories).
- Modularization: Individual ML tasks (like Classification and Regression) are organized into separate subfolders. This not only makes maintenance easier but also clarifies component responsibilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    browser["Client Browser"]:::client
    flask["Flask Application Server (app.py)"]:::backend
    static_assets["Static Assets (CSS,JS,Images)"]:::static
    html_templates["HTML Templates (e.g., home.html)"]:::static
    email_service["Email Service/Notification"]:::email
    cicd["CI/CD Pipeline"]:::ci

    browser -->|"HTTP_Request"| flask
    flask -->|"Serves_Static"| static_assets
    flask -->|"Renders_Templates"| html_templates
    flask -->|"Invokes_Model"| ml_class
    flask -->|"Invokes_Model"| ml_reg
    flask -->|"Sends_Email"| email_service
    cicd -->|"Deploys"| flask

    subgraph "Machine Learning Models"
        ml_class["Classification Models"]:::ml
        ml_reg["Regression Models"]:::ml
    end

    click flask "https://github.com/arun2728/bigfoot/blob/main/app.py"
    click static_assets "https://github.com/arun2728/bigfoot/tree/main/static"
    click html_templates "https://github.com/arun2728/bigfoot/tree/main/templates"
    click ml_class "https://github.com/arun2728/bigfoot/tree/main/templates/Supervised/Classification"
    click ml_reg "https://github.com/arun2728/bigfoot/tree/main/templates/Supervised/Regression"
    click email_service "https://github.com/arun2728/bigfoot/tree/main/static/assets/mail"
    click cicd "https://github.com/arun2728/bigfoot/tree/main/.github/workflows"

    classDef client fill:#FAD7A0,stroke:#333,stroke-width:2px;
    classDef backend fill:#82E0AA,stroke:#333,stroke-width:2px;
    classDef static fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef ml fill:#D5F5E3,stroke:#333,stroke-width:2px;
    classDef email fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef ci fill:#E8DAEF,stroke:#333,stroke-width:2px;
```
