Skip to content

LMS Frontend

Aneesh Rao edited this page Dec 11, 2024 · 1 revision

Frontend Documentation

This document provides a detailed guide to the frontend structure, organization, and key functionalities of the project.


Project Overview

The frontend project is built using React and is designed to provide a seamless user experience for both students and administrators. The key technologies used include:

  • React Router DOM for routing.
  • Redux for state management.
  • Tailwind CSS and ShadCN UI for UI design.
  • Embedded AI features for enhanced functionalities.
  • Transcript functionality integrated across the application.
  • Courses page where students watch videos with embedded assessment popups.

Folder Structure

1. Routes

  • Path: src/routes/index.ts
  • Purpose: Manages routing for the application using createBrowserRouter from react-router-dom.
  • Description: All routes are defined in the index.ts file located in the routes folder. The routing is structured to separate student and admin pages.

2. Components

  • Path: src/components
  • Purpose: Contains reusable UI and functional components.
  • Key Subfolders:
    • Proctoring Components: Contains components for AI features related to proctoring and real-time monitoring.
    • Courses Component: A page where students watch videos and participate in assessments via popups.

3. Pages

  • Path: src/pages
  • Purpose: Contains the main pages for the application, organized into two subfolders:
    • Student: Pages for the student interface.
    • Admin: Pages for the admin interface.

Example Structure:

src/pages
├── student
│   ├── Dashboard.tsx
│   ├── Exam.tsx
│   ├── Courses.tsx  <-- New Page
│   └── Results.tsx
└── admin
    └── AdminDashboard.tsx

4. Store

  • Path: src/store
  • Purpose: Handles global state management using Redux.
  • Slices Folder: Contains Redux slices for handling each functionality, especially for API calls and state updates.
    • Example: src/store/slices/studentSlice.ts, src/store/slices/adminSlice.ts.

5. Styling

  • Tools:
    • Tailwind CSS: Used for utility-first styling.
    • ShadCN UI: Provides prebuilt components for design consistency and easy styling.
  • Structure:
    • Global styles are managed in src/styles/tailwind.css (if applicable).
    • Custom ShadCN components are styled within their respective files.

6. AI Features

  • Path: src/components/proctoring
  • Purpose: Embedded AI functionalities for real-time monitoring, proctoring, and behavior analysis.
  • Description: These components are used in various parts of the application, particularly for exams and assessments.

7. Transcript Integration

  • Purpose: Enables the generation and display of student transcripts.
  • Implementation: The transcript feature is integrated across relevant student pages, interacting with the Redux store for data management.

8. Courses Page

  • Path: src/pages/student/Courses.tsx
  • Purpose: Allows students to watch course videos and take assessments.
  • Features:
    • Video Playback: Students can watch the video content.
    • Assessment Popups: Interactive assessment popups appear during the video for student participation.
    • State Management: Utilizes Redux for fetching video data, tracking assessment progress, and storing results.

Development Guidelines

1. Adding New Routes

  • Define the new route in src/routes/index.ts using the createBrowserRouter method.
  • Ensure the route points to the correct component in the pages folder.

2. Creating New Pages

  • Add the new page component in the appropriate folder under src/pages (student or admin).
  • If necessary, connect the page to Redux slices for data fetching and state management.

3. Creating New AI Features

  • Add new AI components under the Proctoring Components folder.
  • Ensure proper integration with existing AI features and Redux state if needed.

4. Styling

  • Use Tailwind CSS classes for custom designs and layout.
  • Leverage ShadCN UI components to ensure consistency and UI component reuse.

5. State Management

  • Use Redux for managing API calls and application state.
  • Create slices in src/store/slices for handling data fetching, updates, and any necessary logic.

6. Error Handling

  • Ensure proper error handling for all API calls and Redux states.
  • Implement fallback UI where necessary.

Development Notes

  • Routing: Ensure that new routes do not conflict with existing ones.
  • Reusability: Reuse existing components and functions wherever possible to keep the codebase DRY.
  • Tailwind Utilities: Stick to Tailwind's utility-first classes and avoid inline styles.
  • Testing: Thoroughly test all new components and features before deployment to ensure compatibility and smooth functioning.

Clone this wiki locally