A comprehensive, production-ready Learning Management System built with React and Firebase for HYT Global Institute. The platform supports multi-role authentication (Admin, Trainer, Student, Supervisor) with full course management, assessment handling, real-time notifications, and collaborative communication features.
- Features
- Technology Stack
- Project Structure
- Installation & Setup
- Quick Start
- Authentication
- Key Features Guide
- Component Architecture
- Database Schema
- API Integration
- Styling & Design
- Performance Optimizations
- Troubleshooting
- Contributing
- Admin: Full system management, user administration, sector creation, system monitoring
- Trainer: Class management, content creation, assignment/assessment posting, student management
- Student: Course enrollment, assignment submission, quiz participation, progress tracking
- Supervisor: Course oversight, report generation, student performance monitoring
- Course creation and enrollment
- Module organization with sequential progression
- Interactive lesson topics with descriptions
- Learning materials library with file uploads
- Real-time content updates and synchronization
- Material versioning and archival
- Form builder for creating custom assessments
- Multiple question types support
- Point-based grading system
- Automatic score calculation
- Quiz attempt history tracking
- Pass/fail status determination
- Submission deadline management
- Retry capabilities with score tracking
- Real-time announcements system
- Comment threads on announcements
- Inline editing of announcements
- File attachments with download support
- User mentions and notifications
- Inline comment deletion (author only)
- Timestamp tracking (absolute and relative)
- Student performance dashboards
- Quiz completion rates
- Average score calculations
- Best score tracking
- Activity feed with real-time updates
- Progress visualization
- Detailed attempt history
- Responsive design (mobile, tablet, desktop)
- Intuitive navigation with tabbed interfaces
- Real-time loading states and spinners
- Toast notifications for user feedback
- Dark/Light mode support (foundation)
- Accessibility-first design
- Smooth animations and transitions
- Real-time assignment/assessment notifications
- Announcement updates
- Comment notifications
- System alerts
- User preference controls
- React 18+ - UI framework
- React Router v6 - Client-side routing
- Tailwind CSS - Utility-first styling
- Lucide React - Icon library
- Vite - Build tool and dev server
- Firebase/Firestore - Real-time database
- Firebase Auth - Authentication & authorization
- Firebase Storage - File storage
- Firebase Rules - Security rules
- PostCSS - CSS processing
- ESLint - Code linting
- Git - Version control
HYTech/
βββ public/
β βββ 404.html
β βββ index.html
βββ src/
β βββ components/
β β βββ auth/ # Authentication routes
β β β βββ AuthenticatedRoute.jsx
β β β βββ PublicOnlyRoute.jsx
β β β βββ RoleProtectedRoute.jsx
β β β βββ SignIn.jsx
β β β βββ SignUp.jsx
β β βββ dashboard/ # Dashboard components
β β β βββ Dashboard.jsx
β β βββ layout/ # Layout components
β β β βββ AdminDashboardLayout.jsx
β β β βββ DashboardLayout.jsx
β β β βββ SupervisorDashboardLayout.jsx
β β β βββ Navbar.jsx
β β β βββ AdminNavbar.jsx
β β β βββ SupervisorNavbar.jsx
β β β βββ Sidebar.jsx
β β β βββ AdminSidebar.jsx
β β β βββ SupervisorSidebar.jsx
β β βββ student/ # Student-specific components
β β β βββ StudentHome.jsx
β β β βββ StudentCourse.jsx
β β β βββ StudentDashboardLayout.jsx
β β β βββ StudentNavbar.jsx
β β β βββ StudentSidebar.jsx
β β β βββ StudentCalendar.jsx
β β β βββ StudentTasks.jsx
β β β βββ StudentCertificates.jsx
β β β βββ StudentSettings.jsx
β β β βββ StudentArchivedCourses.jsx
β β βββ trainer/ # Trainer-specific components
β β β βββ TrainerHome.jsx
β β β βββ ClassDetail.jsx
β β β βββ TrainerSectors.jsx
β β β βββ SectorDetail.jsx
β β β βββ Course.jsx
β β β βββ ArchivedCourses.jsx
β β β βββ Tasks.jsx
β β β βββ TrainerSettings.jsx
β β βββ supervisor/ # Supervisor-specific components
β β β βββ SupervisorHome.jsx
β β β βββ SupervisorStudents.jsx
β β β βββ SupervisorTrainers.jsx
β β β βββ SupervisorCourses.jsx
β β β βββ SupervisorReports.jsx
β β β βββ SupervisorSettings.jsx
β β βββ users/ # User management
β β β βββ UserManagement.jsx
β β βββ logs/ # System logs
β β β βββ SystemLogs.jsx
β β βββ sectors/ # Sector management
β β β βββ Sectors.jsx
β β βββ settings/ # Settings
β β β βββ Settings.jsx
β β βββ shared/ # Shared components
β β β βββ FlappyBirdGame.jsx
β β β βββ NotificationDropdown.jsx
β β β βββ NotificationsPage.jsx
β β βββ landing/ # Landing page
β β β βββ LandingPage.jsx
β β βββ hytbot/ # AI Assistant
β β βββ HytBot.jsx
β βββ context/
β β βββ AuthContext.jsx # Authentication state
β β βββ ToastContext.jsx # Toast notifications
β β βββ useProfileAvatar.js # Avatar management hook
β β βββ useRoleNotifications.js # Notifications hook
β β βββ useUserSettings.js # User settings hook
β βββ utils/
β β βββ authRole.js # Role-based access utilities
β β βββ avatarStorage.js # Avatar handling
β β βββ firestoreService.js # Firebase/Firestore operations
β βββ App.jsx # Main app component
β βββ firebase.js # Firebase config
β βββ index.js # App entry point
β βββ main.jsx # Vite entry point
β βββ index.css # Global styles
βββ build/ # Production build output
βββ firebase.json # Firebase config
βββ firestore.rules # Firestore security rules
βββ firestore.indexes.json # Firestore indexes
βββ package.json
βββ tailwind.config.js
βββ postcss.config.js
βββ vite.config.js
βββ README.md
- Node.js 16+ and npm/yarn
- Firebase project setup
- Git for version control
# Clone the repository
git clone <repository-url>
cd HYTech
# Install dependencies
npm install- Create a Firebase project at firebase.google.com
- Create a
.env.localfile in the project root:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_app_id- Update
src/firebase.jswith your Firebase configuration
# Deploy Firestore rules and indexes
firebase deploy --only firestore:rules,firestore:indexesnpm run devThe application will be available at http://localhost:5174
Use these credentials to test different roles:
| Role | Password | |
|---|---|---|
| Admin | admin@hyt.com | admin123 |
| Trainer | trainer@hyt.com | trainer123 |
| Student | student@hyt.com | student123 |
| Supervisor | supervisor@hyt.com | supervisor123 |
- Sign In: Use test credentials above
- Navigate Dashboard: Based on your role
- Create Content: (Trainer/Admin) Create courses, assignments, assessments
- Enroll Students: (Admin/Trainer) Add students to courses
- Submit Assignments: (Student) Complete and submit assignments
- View Analytics: Track progress and scores
- Sign Up: New users register with email/password
- Email Verification: Optional verification step
- Profile Setup: Complete user profile
- Role Assignment: Assign user role by admin
- Dashboard Access: Role-based dashboard routing
/admin/*- Admin only/trainer/*- Trainer only/student/*- Student only/supervisor/*- Supervisor only/auth/*- Public routes (Sign In, Sign Up)
- Firebase Auth handles sessions automatically
- Session persists across browser restarts
- Logout clears session and redirects to login
- View enrolled courses
- Track progress per course
- Access course materials
- See assignments and deadlines
- Total Assessments: Count of all available quizzes
- Completed: Number of finished assessments
- Pending: Assessments not yet started
- Average Score: Mean score across all assessments
- Take Quiz: Start or retake assessments
- View Scores: See attempt history
- Download course materials
- Access learning resources
- File type filtering
- Upload date tracking
- Real-time announcements
- Assignment updates
- Assessment releases
- Comment notifications
- Overview of all classes
- Student enrollment status
- Recent activity
- Performance metrics
- Create modules and topics
- Upload learning materials
- Post announcements
- Create assignments and assessments
- Add multiple question types
- Set point values
- Define correct answers
- Configure time limits
- Set passing criteria
- View enrolled students
- Remove students
- Monitor progress
- Track attempt history
- Create/edit/delete users
- Assign roles
- Reset passwords
- Manage user profiles
- Create educational sectors
- Organize courses by sector
- Manage sector-level settings
- View system logs
- Track user activity
- Monitor performance
- Generate reports
Context API
AuthContext: User authentication and role dataToastContext: Global notifications- Custom hooks for avatar, settings, notifications
Firebase Firestore
β
Firestore Service (utils)
β
React Components (Context + State)
β
UI Components (Tailwind + Lucide)
- Tabs: Overview, Materials, Modules, Assessments, Activity
- Features:
* Real-time announcements with comments
* Quiz attempt tracking
* Material downloads
* Progress analytics
* Activity feed
- Tabs: Overview, Modules, Assessments, Responses, Students
- Features:
* Content management
* Assessment form builder
* Student response review
* Google Meet integration
* Real-time updates
{
uid: string,
email: string,
displayName: string,
role: 'admin' | 'trainer' | 'student' | 'supervisor',
avatar: string (base64),
enrolledCourses: string[],
createdAt: timestamp,
updatedAt: timestamp
}{
id: string,
name: string,
description: string,
sector: string,
trainer: string,
students: string[],
materials: Reference[],
assignments: Reference[],
assessments: Reference[],
createdAt: timestamp,
status: 'active' | 'archived'
}{
id: string,
title: string,
description: string,
courseId: string,
questions: Question[],
totalPoints: number,
duration: number,
passingScore: number,
createdAt: timestamp,
attempts: AttemptRecord[]
}{
id: string,
courseId: string,
author: string,
authorId: string,
message: string,
attachments: File[],
comments: Comment[],
createdAt: timestamp,
updatedAt: timestamp
}// Get assessments
const assessments = await getAssessments(courseId);
// Subscribe to real-time updates
subscribeToAssessments(courseId, (data) => {
setAssessments(data);
});
// Submit quiz attempt
await submitQuizAttempt(courseId, quizId, {
userId: user.uid,
answers: answers,
score: calculatedScore,
passed: isPassed
});
// Check if student attempted quiz
const hasAttempted = await hasStudentAttempted(courseId, quizId, userId);// Add comment
await addCommentToAnnouncement(courseId, announcementId, {
author: userName,
authorId: userId,
message: text
});
// Get comments
const comments = await getAnnouncementComments(courseId, announcementId);
// Subscribe to comments
subscribeToComments(courseId, announcementId, (comments) => {
setComments(comments);
});// Store announcement attachment
const fileUrl = await storeAnnouncementAttachment(
courseId,
announcementId,
file
);
// Compress and store file
const compressedFile = await compressAndStoreFile(file, maxSize);Key Classes Used
- Layout:
flex,grid,gap-*,p-*,m-* - Colors:
bg-blue-*,text-gray-*,border-* - Typography:
text-sm,font-semibold,line-clamp-* - Responsive:
md:,lg:,xl:prefixes - States:
hover:,focus:,disabled:,group-*:
- Global styles in
src/index.css - Tailwind configuration in
tailwind.config.js - PostCSS processing in
postcss.config.js
- Lucide React for consistent icons
- Over 300+ icons available
- Size variants:
w-3 h-3,w-4 h-4,w-5 h-5, etc.
- Route-based code splitting with React Router
- Lazy loading components where appropriate
- Dynamic imports for large components
- Firestore subscriptions for live updates
- Efficient query filtering
- Indexed fields for faster queries
- Context API for global state
- Local state for component-specific data
- Memoization of expensive computations
- Tree-shaking of unused code
- Minification in production builds
- Asset compression and lazy loading
Error: Firebase is not initialized
Solution:
- Check VITE_FIREBASE_* environment variables
- Verify Firebase project exists
- Confirm .env.local file in root directory
Error: Missing or insufficient permissions
Solution:
- Check Firestore security rules
- Verify user role in database
- Ensure user is authenticated
- Deploy updated firestore.rules
Error: Score submission fails
Solution:
- Verify submitQuizAttempt function
- Check Firestore assessments collection
- Ensure user has write permissions
- Check network connectivity
Error: Comments section empty
Solution:
- Verify subscribeToComments subscription
- Check announcement exists in database
- Verify collection structure
- Check user permissions
Error: Module not found
Solution:
npm install
npm run build
# Check for TypeScript errors
npm run lint
- File Naming: PascalCase for components, camelCase for utilities
- Component Structure: Hooks β State β Effects β Render
- Imports: Group imports (React, Libraries, Local)
- Comments: Add comments for complex logic
- Error Handling: Try-catch blocks for async operations
# Create feature branch
git checkout -b feature/feature-name
# Make changes and commit
git add .
git commit -m "feat: add feature description"
# Push and create PR
git push origin feature/feature-name- Test with all user roles
- Verify responsive design
- Check error handling
- Test real-time updates
- Validate form inputs
- Test file uploads
- Check performance metrics
npm run build# Install Firebase CLI
npm install -g firebase-tools
# Login to Firebase
firebase login
# Deploy
firebase deployVITE_FIREBASE_API_KEY=prod_api_key
VITE_FIREBASE_AUTH_DOMAIN=prod_auth_domain
VITE_FIREBASE_PROJECT_ID=prod_project_id
# ... other production credentialsFor issues or questions:
- Check this README and troubleshooting section
- Review Firebase documentation
- Check component JSDoc comments
- Contact development team
- Multi-role authentication system
- Course and content management
- Assessment form builder
- Real-time announcements with comments
- Student progress tracking
- Activity feeds
- File uploads and downloads
- Responsive design
- Real-time synchronization
This project is proprietary to HYT Global Institute. Unauthorized copying or distribution is prohibited.
The HYTech Learning Management System is built with modern technologies to provide an intuitive, scalable, and feature-rich platform for educational institutions. It emphasizes user experience, real-time collaboration, and comprehensive learning analytics.
Key Principles:
- User-centric design
- Real-time data synchronization
- Security and privacy
- Scalability and performance
- Accessibility compliance
Last Updated: April 22, 2026 Version: 1.0.0