# ekas-7/zing-guru architecture

> Architecture diagram of the GitHub repository ekas-7/zing-guru, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ekas-7/zing-guru
- Repository: https://github.com/ekas-7/zing-guru

## Overview

##### Project type and purpose
- Zing Guru is a full-stack, AI-driven, gamified learning platform that integrates:
- A React-based web frontend (MERN stack)
- Node.js microservices (Notion-Planner service + core API server)
- Python-based ML/GenAI microservices (RAG service, Video Summarizer)
- A Chrome extension for quick access
- External systems: MongoDB Atlas, Ethereum/Polygon blockchain, TensorFlow models

##### File structure
- Top-level “Frontend” directory: React/Vite application with Tailwind CSS, components, pages, config, store.
- “Backend” directory:
- Notion-Planner (Node.js service for saving user notes to Notion)
- server (Node.js/Express core API handling YouTube transcripts)
- “ML-APi” directory: two Python microservices: RAG (FastAPI) and Video-summarizer (Flask or FastAPI)
- “extension”: Chrome extension assets and scripts
- Root config files: package.json, monorepo–style dependencies
- README outlines blockchain integration, AI/ML, and overall architecture

##### README for additional insights
- Tech stack confirms: MERN frontend, FastAPI backend for core API and ML, TensorFlow, Ethereum rewards, MongoDB Atlas
- Key features: AI personalization (calls to ML microservices), gamification (NFT minting via Web3), accessibility (voice assistant)

##### Main components and their relationships
a. Frontend (React app)
- Hosts UI: Landing, Login, Dashboard, Notion editor, VideoSummarizer, VoiceAssistant
- Calls Core API (Node/server) for authentication, user data, transcript processing
- Calls Notion-Planner service for note saving
- Dispatches actions to Redux store, communicates with Firebase (if used for auth) and Navigation config
b. Core API Server (Backend/server)
- Exposes REST endpoints for YouTube transcript fetch & summarization
- Interacts with MongoDB Atlas for user profiles, progress, credentials
- Calls ML microservices (RAG & Video Summarizer) via HTTP
- Bridges frontend requests to blockchain modules (smart contract interactions)
c. Notion-Planner Microservice
- Node.js service that authenticates with Notion API and saves user notes
- Invoked from frontend Dashboard “Notion” component
d. ML Microservices (ML-APi)
- RAG service: receives queries, loads retrieval models, returns AI-driven content
- Video Summarizer: processes video URLs, returns transcript or summary
e. Chrome Extension
- Lightweight UI in browser popup
- Can send URLs or text to Core API or ML services for on-the-fly summarization
f. External systems
- MongoDB Atlas: stores user profiles, paths, progress, credentials
- Ethereum/Polygon blockchain: mints NFTs via Web3 calls (could be embedded in Core API or frontend)
- TensorFlow models loaded in ML services or via external AI endpoints

##### Key architectural patterns and design principles
- Microservices: separate Node.js services (Core API, Notion-Planner) and Python services (RAG, Summarizer)
- Event-driven or request/response between services via HTTP REST
- Single Page Application (SPA) with API gateway (Core API)
- External integrations (Notion, Blockchain, Firebase, MongoDB Atlas)
- Redux for state management, Tailwind for styling, Vite bundler

##### Essential details to capture
- Authentication & authorization flow (Firebase or JWT)
- AI-powered endpoints (highlight RAG & summarizer calls)
- Blockchain reward minting path (frontend ↔ Core API ↔ Web3 ↔ Ethereum)
- Notion integration path
- State management boundary (Redux store)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User & Clients
    subgraph "User & Clients"
        direction TB
        Browser["User Browser"]:::ui
        Extension["Chrome Extension"]:::ui
    end

    %% Frontend SPA
    subgraph "Frontend SPA (React/Vite)" 
        direction TB
        ReactApp["React App"]:::ui
        Redux["Redux Store"]:::ui
        FirebaseCfg["Firebase Config"]:::ui
        NavCfg["Navigation Config"]:::ui
        VS_UI["VideoSummarizer Component"]:::ui
        VA_UI["VoiceAssistant Component"]:::ui
        NotionUI["Notion Editor Components"]:::ui
    end

    %% Core API Server
    subgraph "Core API Server (Node.js/Express)"
        direction TB
        API["Core API Server"]:::api
        Index["index.js"]:::api
        Routes["youtube-transcript.js (Routes)"]:::api
        Controllers["youtube-transcript.js (Controller)"]:::api
        Models["youtube-transcript.js (Model)"]:::api
    end

    %% Microservices
    subgraph "Microservices Tier"
        direction TB
        NotionMS["Notion-Planner Service"]:::micro
        RAG["RAG Service"]:::micro
        VideoSum["Video Summarizer Service"]:::micro
    end

    %% Data & External Systems
    subgraph "Data & External Systems"
        direction TB
        MongoDB[(MongoDB Atlas)]:::db
        Blockchain["Ethereum/Polygon"]:::external
        TensorFlow["TensorFlow Models"]:::external
        NotionAPI["Notion API"]:::external
    end

    %% Connections
    Browser -->|"interacts with"| ReactApp
    Extension -->|uses| API
    ReactApp -->|"API calls"| API
    ReactApp -->|"Dispatch actions"| Redux
    ReactApp -->|"uses"| FirebaseCfg
    ReactApp -->|"uses"| NavCfg
    ReactApp -->|"renders"| VS_UI
    ReactApp -->|"renders"| VA_UI
    ReactApp -->|"renders"| NotionUI

    API -->|"reads/writes"| MongoDB
    API -->|"calls"| NotionMS
    API -->|"calls"| RAG
    API -->|"calls"| VideoSum
    API -->|"Web3 tx"| Blockchain
    NotionMS -->|"auth and save"| NotionAPI
    RAG -->|"loads models"| TensorFlow
    VideoSum -->|"loads models"| TensorFlow

    %% Click Events
    click ReactApp "https://github.com/ekas-7/zing-guru/tree/main/Frontend/"
    click Redux "https://github.com/ekas-7/zing-guru/blob/main/Frontend/src/store/store.js"
    click FirebaseCfg "https://github.com/ekas-7/zing-guru/blob/main/Frontend/src/config/firebase.js"
    click NavCfg "https://github.com/ekas-7/zing-guru/blob/main/Frontend/src/config/navigation.js"
    click VS_UI "https://github.com/ekas-7/zing-guru/blob/main/Frontend/src/Components/Dashboard/VideoSummarizer.jsx"
    click VA_UI "https://github.com/ekas-7/zing-guru/blob/main/Frontend/src/Components/Dashboard/VoiceAssistant.jsx"
    click NotionUI "https://github.com/ekas-7/zing-guru/tree/main/Frontend/src/Components/Dashboard/Notion/"
    click API "https://github.com/ekas-7/zing-guru/tree/main/Backend/server/"
    click Index "https://github.com/ekas-7/zing-guru/blob/main/Backend/server/index.js"
    click Routes "https://github.com/ekas-7/zing-guru/blob/main/Backend/server/routes/youtube-transcript.js"
    click Controllers "https://github.com/ekas-7/zing-guru/blob/main/Backend/server/controllers/youtube-transcript.js"
    click Models "https://github.com/ekas-7/zing-guru/blob/main/Backend/server/models/youtube-transcript.js"
    click NotionMS "https://github.com/ekas-7/zing-guru/tree/main/Backend/Notion-Planner/"
    click RAG "https://github.com/ekas-7/zing-guru/blob/main/ML-APi/RAG/app.py"
    click VideoSum "https://github.com/ekas-7/zing-guru/blob/main/ML-APi/Video-summarizer/main.py"
    click Extension "https://github.com/ekas-7/zing-guru/tree/main/extension/"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#009,stroke-width:1px;
    classDef api fill:#D6F5D6,stroke:#090,stroke-width:1px;
    classDef micro fill:#EBF4FF,stroke:#00F,stroke-width:1px;
    classDef db fill:#F0F0F0,stroke:#666,stroke-width:1px;
    classDef external fill:#FFF4D6,stroke:#DAA520,stroke-width:1px;
```
