# shreyanshu005/classence-frontened architecture

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

- Interactive diagram: https://gitdiagram.com/shreyanshu005/classence-frontened
- Repository: https://github.com/shreyanshu005/classence-frontened

## Overview

##### Project Type & Purpose
- Classence is an online classroom management platform – much like Google Classroom – that supports both teacher and student functionalities.
- It handles authentication (login, OTP-based verification), dashboards tailored for teachers and students, resource and class management, calendar integration, and even real-time communication features via WebRTC.
- The tech stack comprises React.js, Redux Toolkit, Tailwind CSS, Node.js, MongoDB, Axios for API calls, and additional integrations (WebRTC and toast notifications).

##### Analyzing the File Structure
- The top-level directories (src, public) indicate a React-based single-page application.
- Within src, separate areas exist for:
- Auth-related components and styles (src/auth): Contains login, signup, password reset, OTP verification, policy, and terms pages.
- Platform-specific features (src/platform): This houses the dashboards (teacher/student), assignment management (multiple directories for assignments, submissions, etc.), attendance, calendar, announcements, live lecture (WebRTC integration), reminders, scheduling, settings, and sidebar components.
- Redux integration (src/redux): Contains the central store for state management.
- These directories point to a modular front-end design, where each functional domain (e.g., assignments, attendance, live lectures) is kept in its own component group.

##### Key Components
- Frontend (React SPA):
- Authentication Module: All components for login, signup, OTP, etc.
- Dashboard Module: Separate interfaces and components for teacher dashboards (teacher assignment insights, attendance graphs, performance indicators) and student dashboards.
- Class Management & Resources: Modules for creating/joining classes, class listings, announcements, and resource viewing.
- Assignment & Attendance Modules: Components for managing assignments (creation, submission, review) and attendance (charts, tables, streaks).
- Calendar, Reminder, and Schedule: Pages to organize deadlines and class schedules.
- Live Lecture Integration: Including components for video calling utilizing WebRTC.
- UI/UX Elements: Navigation (sidebar, header), modals, and toast notifications.
- Redux Store: Centralized state management using Redux Toolkit.
- Backend (Node.js & MongoDB):
- While not detailed in the file tree, the README tells us that a Node.js backend coupled with MongoDB is used.
- This backend likely exposes RESTful APIs that are consumed by Axios in the React application.
- External Services:
- WebRTC for real-time chat and video.
- 3rd-party services for notifications (toast notifications).

##### Relationships & Data Flow
- From authentication components to the Node.js auth API endpoints.
- From dashboard/assignment components to various API endpoints handling class, assignment, and attendance data.
- Data flow using Axios, indicating API calls and responses.
- Redux as an interactive layer between the UI components and data from the backend, managing state transitions.

##### Architectural Patterns & Design Principles
- Modular UI Structure: Each feature (auth, assignments, calendar, etc.) is encapsulated in its own folder with dedicated components, styles, and assets.
- Component-Based Architecture: Reflects common React patterns where reusable components exist for modals, forms, dashboards, etc.
- Separation of Concerns: Clearly distinguishes between the authentication logic (src/auth) and the platform features (src/platform).
- Integration Layer: Communication between the frontend and backend is handled via API calls (using Axios), centralized via Redux actions and slices.
- Real-Time Communication: Use of WebRTC components indicates a service-oriented approach for real-time interactions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer (React SPA)
    subgraph "Frontend (React SPA)"
        Auth["Auth Module (Login,Signup,OTP,etc.)"]:::frontend
        TDashboard["Teacher Dashboard"]:::frontend
        SDashboard["Student Dashboard"]:::frontend
        ClassMgmt["Class Management & People"]:::frontend
        Assignment["Assignment Manager"]:::frontend
        Attendance["Attendance Tracker"]:::frontend
        Calendar["Calendar Module"]:::frontend
        LiveLecture["Live Lecture (WebRTC)"]:::frontend
        UIUX["UI/UX Elements (Header,Sidebar,Modals)"]:::frontend
        Redux["Redux Store"]:::frontend
        Announcements["Announcements"]:::frontend
        Reminders["Reminders & Schedules"]:::frontend
        ToDo["To-do List"]:::frontend
        WeekView["Week View"]:::frontend
        Performance["Performance Module"]:::frontend
        Help["Help & Support"]:::frontend
    end

    %% Communication Layer: Axios API Calls
    subgraph "Communication Layer"
        Axios["Axios API Calls"]:::communication
    end

    %% Backend Services
    subgraph "Backend Services"
        NodeAPI["Node.js API Server"]:::backend
        MongoDB["MongoDB Database"]:::backend
    end

    %% External Integrations
    subgraph "External Integrations"
        extWebRTC["WebRTC Service"]:::external
        extToast["Toast Notifications"]:::external
    end

    %% Data Flow Connections
    Auth -->|"api_call"| Axios
    TDashboard -->|"api_call"| Axios
    SDashboard -->|"api_call"| Axios
    ClassMgmt -->|"api_call"| Axios
    Assignment -->|"api_call"| Axios
    Attendance -->|"api_call"| Axios
    Calendar -->|"api_call"| Axios
    Announcements -->|"api_call"| Axios
    Reminders -->|"api_call"| Axios
    ToDo -->|"api_call"| Axios
    WeekView -->|"api_call"| Axios
    Performance -->|"api_call"| Axios
    Help -->|"api_call"| Axios

    UIUX -->|"state_update"| Redux
    Redux -->|"dispatch"| Axios

    Axios -->|"REST_API"| NodeAPI
    NodeAPI -->|"CRUD"| MongoDB

    LiveLecture -->|"stream"| extWebRTC
    UIUX -->|"notify"| extToast

    %% Styling Classes
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#B9770E,stroke-width:2px;
    classDef communication fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef external fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;

    %% Click Events for Component Mapping
    click Auth "https://github.com/shreyanshu005/classence-frontened/tree/main/src/auth"
    click TDashboard "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/teacherdashboard"
    click SDashboard "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/dashboard"
    click ClassMgmt "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/yourClasses"
    click Assignment "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/assignmentMain"
    click Attendance "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/attendance"
    click Calendar "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/calenderPage"
    click LiveLecture "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/liveLec"
    click UIUX "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/header"
    click Redux "https://github.com/shreyanshu005/classence-frontened/tree/main/src/redux"
    click Announcements "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/announcement"
    click Reminders "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/reminder"
    click ToDo "https://github.com/shreyanshu005/classence-frontened/blob/main/src/platform/todolist/todolist.jsx"
    click WeekView "https://github.com/shreyanshu005/classence-frontened/blob/main/src/platform/week/week.jsx"
    click Performance "https://github.com/shreyanshu005/classence-frontened/blob/main/src/platform/performance/performance.jsx"
    click Help "https://github.com/shreyanshu005/classence-frontened/tree/main/src/platform/helpandsupport"
```
