# gauravmkale/projects architecture

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

- Interactive diagram: https://gitdiagram.com/gauravmkale/projects
- Repository: https://github.com/gauravmkale/projects

## Overview

##### File Structure Analysis
- Top-level:
- app.py – the main Flask application entrypoint
- helpers.py – shared utility functions (e.g., DB helpers, form validators)
- flask_session/ – filesystem session store (server-side session files)
- users.db – SQLite database for user accounts
- static/ – CSS, uploads directory for user-submitted files
- templates/ – Jinja2 HTML templates (layout, index, login, register, buy, sell, etc.)
- No separate “frontend” folder: static assets are served by Flask.
- No containerization or multi-service directories—this is a single Python service.

##### README Insights
- The README simply labels this as a “Development and Coding project” without architectural details.

a. Main Components
- Client (Web Browser)
- HTTP Server / Reverse Proxy (e.g., nginx or built-in Flask dev server)
- WSGI Application Server (e.g., Gunicorn or uWSGI)
- Flask App (app.py + helpers.py + Jinja2 templates)
- Session Store (flask_session directory on disk)
- SQLite Database (users.db)
- Static File Store (static directory, including uploads)
- (Optional) External SMTP service for contact form
b. Interactions
- Browser → HTTP(S) → Reverse Proxy → WSGI → Flask routes
- Flask reads/writes sessions to flask_session files
- Flask queries/updates users.db for authentication/CRUD
- Static assets served directly from static/ by the server
- File uploads written to static/uploads and later served as static files
- Contact form triggers outbound SMTP request
c. Architectural Patterns
- MVC-style separation: Controllers (Flask route handlers), Views (Jinja2 templates), Models (SQLite accessed via helpers.py)
- Server-side session management (filesystem)
- Single deployable unit (monolith)
d. Key Technologies
- Python 3.x, Flask microframework, Jinja2 templating
- SQLite for persistence
- Filesystem-based sessions (Flask-Session)
- CSS in static/, optional JS if extended

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["Web Browser"]:::browser
    end

    %% Server Layer
    subgraph "Server Layer"
        Proxy["Reverse Proxy / WSGI Server"]:::compute
        App["Flask Application"]:::compute
    end

    %% Flask Application Components
    subgraph "Flask Application"
        subgraph "Controllers (Routes)"
            AppRoutes["app.py"]:::compute
        end
        subgraph "Models & Utils"
            Helpers["helpers.py"]:::compute
        end
        subgraph "Views (Jinja2 Templates)"
            TL["layout.html"]:::compute
            IDX["index.html"]:::compute
            HOME["home.html"]:::compute
            ABOUT["about.html"]:::compute
            LOGIN["login.html"]:::compute
            REGISTER["register.html"]:::compute
            ACCOUNT["account.html"]:::compute
            MY["my.html"]:::compute
            PASSWORD["password.html"]:::compute
            BUY["buy.html"]:::compute
            SELL["sell.html"]:::compute
            CONTACT["contact.html"]:::compute
        end
    end

    %% Data & Static Layers
    subgraph "Data Layer"
        Sessions["Session Store (flask_session/)"]:::storage
        DB["SQLite Database (users.db)"]:::storage
        Uploads["Uploads Store (static/uploads/)"]:::storage
    end
    subgraph "Static Assets"
        Styles["styles.css & styles2.css"]:::storage
    end

    %% External Services
    subgraph "External Services"
        SMTP["SMTP Email Service"]:::external
    end

    %% Connections
    Browser -->|HTTP/HTTPS| Proxy
    Proxy -->|WSGI Call| AppRoutes
    AppRoutes -->|uses| Helpers
    AppRoutes -->|renders| TL & IDX & HOME & ABOUT & LOGIN & REGISTER & ACCOUNT & MY & PASSWORD & BUY & SELL & CONTACT
    AppRoutes -->|read/write| Sessions
    AppRoutes -->|SQL Queries| DB
    AppRoutes -->|file I/O| Uploads
    Proxy -->|serves| Styles
    Browser -->|requests| Styles
    AppRoutes -->|sends email via SMTP| SMTP

    %% Click Events
    click AppRoutes "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/app.py"
    click Helpers "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/helpers.py"
    click TL "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/layout.html"
    click IDX "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/index.html"
    click HOME "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/home.html"
    click ABOUT "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/about.html"
    click LOGIN "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/login.html"
    click REGISTER "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/register.html"
    click ACCOUNT "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/account.html"
    click MY "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/my.html"
    click PASSWORD "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/password.html"
    click BUY "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/buy.html"
    click SELL "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/sell.html"
    click CONTACT "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/templates/contact.html"
    click Styles "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/static/styles.css"
    click Uploads "https://github.com/gauravmkale/projects/tree/main/AcademicConnect/static/uploads/"
    click Sessions "https://github.com/gauravmkale/projects/tree/main/AcademicConnect/flask_session/"
    click DB "https://github.com/gauravmkale/projects/blob/main/AcademicConnect/users.db"

    %% Styles
    classDef browser fill:#f9f,stroke:#333,stroke-width:1px;
    classDef compute fill:#bbf,stroke:#333,stroke-width:1px;
    classDef storage fill:#bfb,stroke:#333,stroke-width:1px;
    classDef external fill:#ccc,stroke:#333,stroke-width:1px;
```
