# sunny8080/study-notion-mern-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sunny8080/study-notion-mern-frontend
- Repository: https://github.com/sunny8080/study-notion-mern-frontend

## Overview

##### Project Type and Purpose
- This is the frontend of a full-stack MERN Edtech application (“StudyNotion”) where:
– Instructors upload and manage courses.
– Students browse, purchase, and view course content.
- Key technologies (from README): React, Redux, Tailwind CSS, JavaScript, HTML.
- Frontend hosts as a SPA on Netlify (or similar), communicating with a Node/Express API backend.

##### File Structure
- Top-level:
– public/ – static HTML and manifest for the SPA
– src/
· components/ – organized into common UI widgets and “core” feature modules (Auth, Dashboard, Course, etc.)
· pages/ – React Router pages (Home, CategoryCourses, CourseDetails, Dashboard, etc.)
· redux/ – store configuration, rootReducer, feature slices (auth, cart, profile, viewCourse, addCourse)
· services/ – API connector, endpoint definitions, and per‐feature service operations (authServices, courseServices, paymentServices, etc.)
· hooks/, utils/, data/ – shared logic, constants, assets
- Config files:
– example.env → .env (environment variables, API base URL)
– netlify.toml (deployment settings)
– tailwind.config.js

##### README for Additional Insights
- Confirms SPA on port 3000 (dev) / Netlify in prod
- Backend lives separately on port 4000 / hosted API
- Usage flow: user → React UI → REST API → MongoDB

##### Diagramming Conventions
- Clear labels on every component (e.g., “React Router”, “AuthSlice”, “CourseServices”)
– UI → Redux → Services → Backend API → Database
– Payment flow: Backend → Stripe
– Blue rectangles for frontend modules
– Green rectangles for backend modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        direction TB
        CDN["Netlify/CDN"]:::external
        Browser["Browser (Student/Instructor)"]:::external
        SPA["React SPA"]:::frontend
        subgraph "Static Assets"
            direction TB
            HTML["index.html"]:::frontend
            Manifest["manifest.json"]:::frontend
            Robots["robots.txt"]:::frontend
        end
        subgraph "Root Application"
            direction TB
            AppJS["App.js"]:::frontend
            AppCSS["App.css"]:::frontend
        end
        subgraph "Pages (React Router)"
            direction TB
            Home["Home.js"]:::frontend
            Category["CategoryCourses.jsx"]:::frontend
            CourseDetails["CourseDetails.jsx"]:::frontend
            DashboardPage["DashBoard.jsx"]:::frontend
            LogIn["LogIn.js"]:::frontend
            SignUp["SignUp.js"]:::frontend
            ForgotPW["ForgotPassword.js"]:::frontend
            ResetPW["ResetPassword.js"]:::frontend
            VerifyEmail["VerifyEmail.js"]:::frontend
        end
        subgraph "UI Components"
            direction TB
            Common["Common Components"]:::frontend
            Core["Core Feature Components"]:::frontend
        end
        subgraph "State Management"
            direction TB
            Store["Redux Store"]:::frontend
            Slices["Feature Slices"]:::frontend
        end
        subgraph "API Layer"
            direction TB
            ApiCon["apiConnector.js"]:::frontend
            Apis["apis.js"]:::frontend
            Ops["Service Operations"]:::frontend
        end
    end

    subgraph "Backend Layer"
        direction TB
        API["Express API"]:::backend
        Controllers["Controllers"]:::backend
        ServicesBL["Business Services"]:::backend
        DB["MongoDB"]:::database
    end

    subgraph "External Services"
        direction TB
        Stripe["Stripe"]:::external
        Email["Email Provider"]:::external
        Storage["File Storage"]:::external
    end

    CDN --> Browser
    Browser --> SPA
    SPA --> HTML
    SPA --> Manifest
    SPA --> Robots
    SPA --> AppJS
    SPA --> AppCSS
    SPA --> PagesGroup{"Pages"}
    PagesGroup --> Home
    PagesGroup --> Category
    PagesGroup --> CourseDetails
    PagesGroup --> DashboardPage
    PagesGroup --> LogIn
    PagesGroup --> SignUp
    PagesGroup --> ForgotPW
    PagesGroup --> ResetPW
    PagesGroup --> VerifyEmail

    SPA --> Common
    SPA --> Core
    SPA --> Store
    SPA --> ApiCon
    Common -->|dispatch actions| Store
    Core -->|dispatch actions| Store
    Store --> Slices
    Store --> ApiCon
    ApiCon --> Apis
    Apis --> Ops
    Ops -->|"HTTP calls"| API

    API --> Controllers
    Controllers --> ServicesBL
    ServicesBL --> DB
    API --> Stripe
    API --> Email
    API --> Storage

    click HTML "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/public/index.html"
    click Manifest "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/public/manifest.json"
    click Robots "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/public/robots.txt"
    click AppJS "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/App.js"
    click AppCSS "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/App.css"
    click Home "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/Home.js"
    click Category "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/CategoryCourses.jsx"
    click CourseDetails "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/CourseDetails.jsx"
    click DashboardPage "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/DashBoard.jsx"
    click LogIn "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/LogIn.js"
    click SignUp "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/SignUp.js"
    click ForgotPW "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/ForgotPassword.js"
    click ResetPW "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/ResetPassword.js"
    click VerifyEmail "https://github.com/sunny8080/study-notion-mern-frontend/blob/main/src/pages/VerifyEmail.js"

    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef backend fill:#DFF2D8,stroke:#333,stroke-width:1px
    classDef database fill:#FFF4CE,stroke:#333,stroke-width:1px
    classDef external fill:none,stroke-dasharray: 5 5,stroke:#888,fill:#F8F8F8,stroke-width:1px
```
