# niranjangopalan/mit-connect architecture

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

- Interactive diagram: https://gitdiagram.com/niranjangopalan/mit-connect
- Repository: https://github.com/niranjangopalan/mit-connect

## Overview

##### Project Type and Purpose
- This is a full-stack web application built on Next.js. It leverages Next.js’s App Router (indicated by the “src/app” directory with layout.js and page.js) and is designed to offer multiple features (authentication, chat, charts, file processing/uploading, database connectivity, and external AI integrations such as Google Analytics and geminiConnect). The README hints at the primary development process (npm run dev) and shows that performance improvements (e.g., font optimization) are a consideration.

##### Analyzing the File Structure
- Top-Level Files: Configuration files (.eslintrc.json, next.config.mjs, package.json, etc.) indicate standard project-wide settings and dependency management.
- src/app Folder: Acts as the entry point for the Next.js app. It contains domain-specific folders:
- AI: Contains integrations with external services like GoogleAnalytics and geminiConnect.
- API: Likely holds backend configuration or API endpoint definitions (e.g., Config.js).
- Components: Separated neatly into subdirectories (Authentication, Charts, Chat, DBConnector, FileProcess, FileUpload, UserCharts, Utilities, and custom hook useLocalStorage). This modular breakdown implies an emphasis on reusable UI components and corresponding business logic.
- The presence of directories named “Authentication,” “DBConnector,” and “API” indicates separation of concerns following either an MVC-inspired or component-based design pattern.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend UI"
        U1("Pages (layout.js, page.js)"):::frontend
        U2("Authentication"):::frontend
        U3("Charts"):::frontend
        U4("Chat"):::frontend
        U5("File Process"):::frontend
        U6("File Upload"):::frontend
    end

    subgraph "Business Logic / API"
        B1("API Config"):::business
        B2("DBConnector"):::business
    end

    subgraph "External Services"
        E1("Google Analytics"):::external
        E2("geminiConnect"):::external
    end

    subgraph "Utilities / Shared Services"
        Uti1("useLocalStorage"):::utility
        Uti2("UserForm"):::utility
    end

    DB("Database"):::database

    U1 -->|"calls"| B1
    U2 -->|"authCall"| B1
    U3 -->|"dataRequest"| B1
    U4 -->|"messageSend"| B1
    U5 -->|"processFile"| B1
    U6 -->|"uploadFile"| B1

    B1 -->|"configures"| B2
    B2 -->|"DBops"| DB

    B1 -->|"logsEvent"| E1
    B1 -->|"callsAI"| E2

    U1 -->|"sessionStorage"| Uti1
    U6 -->|"formSubmit"| Uti2

    click U1 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/layout.js"
    click U2 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/Authentication"
    click U3 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/Charts"
    click U4 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/Chat"
    click U5 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/FileProcess"
    click U6 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/FileUpload"
    click B1 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/API/Config.js"
    click B2 "https://github.com/niranjangopalan/mit-connect/tree/main/src/app/Components/DBConnector"
    click E1 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/AI/GoogleAnalytics.js"
    click E2 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/AI/geminiConnect.js"
    click Uti1 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/Components/useLocalStorage/useLocalStorage.js"
    click Uti2 "https://github.com/niranjangopalan/mit-connect/blob/main/src/app/Components/Utilities/UserForm.js"

    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef business fill:#D1E8E2,stroke:#000,stroke-width:1px;
    classDef external fill:#FFDAB9,stroke:#000,stroke-width:1px;
    classDef utility fill:#E6E6FA,stroke:#000,stroke-width:1px;
    classDef database fill:#FFCCCC,stroke:#000,stroke-width:1px;
```
