# viditagrawal56/metricly_hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/viditagrawal56/metricly_hackathon
- Repository: https://github.com/viditagrawal56/metricly_hackathon

## Overview

##### Project Type and Purpose
- Project Type: Full-stack analytics application.
- Purpose: To provide intelligent insights and graphical visualizations of social media data via a responsive UI, while leveraging AI (Generative AI, Groq LLM) and a serverless database (Astra DB) for dynamic analysis.

##### File Structure
- The project is divided into a frontend (located in the “src” directory) and a backend (the “backend” directory).
- The frontend uses React, TypeScript, and modern UI libraries (Framer Motion for animations, react-chartjs-2/chart.js for graphs, etc.) and contains many UI components (Navbar, Hero, Features, Chat, etc.).
- The backend, built with Node/Express and written in TypeScript, is purpose-built for API operations, possibly handling WebSocket connections, data fetching, and interfacing with external services (e.g., Langflow and the serverless database).
- Additional configuration files (Vite, tsconfig, vercel.json) indicate modern tooling and deployment practices.

##### README for Additional Insights
- The README highlights key technical features like Intelligent Insights using Generative AI, Graphical Visualization, and a serverless database.
- It explicitly mentions integration with “Langflow” for vectorizing data and interacting with Groq LLM, indicating external AI-driven processing components.
- The README spells out a clear component overview (Navbar, Features, Pricing, Chat, etc.) suggesting a heavily componentized UI.
- The presence of separate links for the live demo and backend suggests distinct, interacting services.

a. Main Components to Include:
- Frontend (React UI):
- UI Components (Navbar, Hero, Features, Chat, Pricing, Team, Footer, etc.)
- Routing/Page Components (Home, Analytics, Chat)
- Animation & Visualization Modules (Framer Motion, chart libraries, etc.)
- Backend (Express Server):
- API Endpoints for handling application logic, including chat and analytics data
- WebSocket connection layer for real-time communications
- Integration with AI services (Langflow & Groq LLM)
- Database Layer:
- Serverless database (Astra DB) for storing social media and user data
- External Services:
- Langflow integration (for dataset vectorizing and loading, feeding input to Groq LLM)
- Generative AI services

b. Relationships and Interactions:
- The Frontend sends HTTP (or WebSocket) requests to the Backend.
- The Backend processes these requests, retrieves data from the Serverless Database, and may invoke AI services (through Langflow) for data insights.
- Data flows back to the Frontend, where visualization components (e.g., charts and graphs) display the results.

c. Architectural Patterns & Design Principles:
- Separation of Concerns: Distinct boundaries between the presentation layer (React UI), business logic (backend APIs/WS), and data management (Astra DB).
- Componentization: Frontend is composed of multiple reusable UI components.
- Real-Time Data Flow: WebSocket connections in the backend for live chat and dynamic updates.
- Modern Deployment: Use of Vite for frontend bundling and serverless database architecture for scalability.

d. Technologies, Frameworks, and External Tools:
- Frontend: React.js, TypeScript, Vite, Framer Motion, chart.js/react-chartjs-2, CSS3 (with modern effects like glassmorphism)
- Backend: Node.js, Express, TypeScript, Websocket
- External: Astra DB (serverless database), Langflow, Groq LLM for AI processing

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend (React)"
        FE1("React App"):::frontend
        FE2("Navbar"):::frontend
        FE3("Hero"):::frontend
        FE4("Features"):::frontend
        FE5("Chat Functionality"):::frontend
        FE6("Pricing"):::frontend
        FE7("Team"):::frontend
        FE8("Footer"):::frontend
        FE9("Graph Visualization Module"):::frontend
    end

    subgraph "Backend"
        BE1("Express API & WebSocket"):::backend
    end

    subgraph "External Services"
        EXT1("Astra DB (Serverless)"):::db
        EXT2("Langflow / Groq LLM Integration"):::external
    end

    FE1 -->|"renders"| FE2
    FE1 -->|"renders"| FE3
    FE1 -->|"renders"| FE4
    FE1 -->|"renders"| FE5
    FE1 -->|"renders"| FE6
    FE1 -->|"renders"| FE7
    FE1 -->|"renders"| FE8
    FE1 -->|"renders"| FE9

    FE1 -->|"HTTP/WebSocket"| BE1
    BE1 -->|"Response"| FE1

    BE1 -->|"Query/Update"| EXT1
    BE1 -->|"AI Invocation"| EXT2
    EXT2 -->|"AI Response"| BE1

    classDef frontend fill:#b3d9ff,stroke:#333,stroke-width:2px;
    classDef backend fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef db fill:#ffcc99,stroke:#333,stroke-width:2px;
    classDef external fill:#ffe6cc,stroke:#333,stroke-width:2px;

    click FE1 "https://github.com/viditagrawal56/metricly_hackathon/tree/master/src/"
    click FE2 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Navbar/Navbar.tsx"
    click FE3 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Hero/Hero.tsx"
    click FE4 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Features/Features.tsx"
    click FE5 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/pages/Chat.tsx"
    click FE5 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/ChatArea/ChatArea.tsx"
    click FE6 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Pricing/Pricing.tsx"
    click FE7 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Team/Team.tsx"
    click FE8 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Footer/Footer.tsx"
    click FE9 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/src/components/Graph/Graphs.tsx"
    click BE1 "https://github.com/viditagrawal56/metricly_hackathon/blob/master/backend/src/index.ts"
```
