Skip to content

Lucdpt3105/MegaLearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š MegaLearning - E-Learning Platform

Modern e-learning platform built with Laravel 12, featuring video conferencing, AI chat assistant, exam management, and real-time collaboration.

Laravel PHP License Status


πŸ“– Table of Contents


πŸš€ Quick Start

One-Command Setup

# Clone repository
git clone https://github.com/Lucdpt3105/MegaLearning.git
cd MegaLearning

# Install dependencies
composer install
npm install

# Setup environment
cp .env.example .env
php artisan key:generate

# Setup database
php artisan migrate --seed

# Start development servers
composer dev
# 3. Test:

Access the application:

Default Test Accounts

Email Password Role
admin@megalearning.com password admin
teacher@megalearning.com password teacher
student@megalearning.com password student

✨ Features

πŸŽ“ Core Learning Features

  • Exam Management - Create, take, auto-grade exams with multiple question types
  • Subject & Topic Management - Organize courses with hierarchical structure
  • Document Library - Upload and share learning materials
  • Forum & Q&A - Stack Overflow-style forum with voting system
  • Student Rankings - Leaderboards and achievement tracking
  • Attendance Tracking - Class attendance management

πŸ“Ή Communication & Collaboration

  • Video Conferencing - Zoom API integration + Jitsi fallback
  • Real-time Chat - Group chat, private messages, AI assistant
  • AI Chat Assistant - Google Gemini AI-powered Q&A (FREE)
  • Notifications - Real-time notifications for all activities

πŸ” Security & Administration

  • Role-Based Access Control - Admin, Teacher, Student roles
  • Password Reset - Email-based + CLI tool
  • Exam Security - Anti-cheating measures, time limits, randomization
  • API Authentication - Sanctum token-based auth

πŸ› οΈ Developer Features

  • RESTful API - Full API with Sanctum authentication
  • Testing Suite - 36+ test cases (PHPUnit + Dusk)
  • API Testing - Thunder Client integration
  • Database Seeding - Demo data generators
  • Helper Scripts - 20+ utility scripts

πŸ’» System Requirements

  • PHP >= 8.2
  • MySQL >= 8.0 or MariaDB >= 10.3
  • Composer >= 2.0
  • Node.js >= 18.x & npm
  • Git (for version control)

Optional:

  • ChromeDriver (for Dusk browser tests)
  • Zoom Account (for video conferencing)
  • Google Gemini API Key (for AI assistant)

πŸ“¦ Installation

1. Clone & Install Dependencies

git clone https://github.com/Lucdpt3105/MegaLearning.git
cd MegaLearning
composer install
npm install

2. Environment Configuration

cp .env.example .env
php artisan key:generate

Edit .env and configure:

DB_DATABASE=learning3
DB_USERNAME=root
DB_PASSWORD=your_password

3. Database Setup

# Create database
mysql -u root -p -e "CREATE DATABASE learning3"

# Run migrations and seeders
php artisan migrate --seed

4. Build Assets

npm run build
# Or for development with hot reload
npm run dev

5. Start Server

php artisan serve

βš™οΈ Configuration

Required Configuration

Database (Required)

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=learning3
DB_USERNAME=root
DB_PASSWORD=your_password

Optional Configuration

Zoom Video Calls (Optional - 5 min setup)

  1. Create Server-to-Server OAuth app at https://marketplace.zoom.us/develop/create
  2. Add these scopes: meeting:write:admin, meeting:read:admin, user:read:admin
  3. Configure in .env:
ZOOM_ACCOUNT_ID=your_account_id
ZOOM_CLIENT_ID=your_client_id
ZOOM_CLIENT_SECRET=your_client_secret

Quick Setup:

scripts\setup-zoom.bat

Verify:

php scripts/check-zoom-config.php
php scripts/test-zoom-meeting.php

Fallback: Jitsi is available without any configuration!

Google Gemini AI (Optional - 2 min setup)

Get free API key from https://makersuite.google.com/app/apikey

GEMINI_API_KEY=your_api_key
GEMINI_MODEL=gemini-2.0-flash-exp

Quick Setup:

scripts\setup-gemini.bat

Test:

php scripts/test-gemini.php

Email (Optional)

For development, emails are logged to storage/logs/laravel.log.

For production SMTP:

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_app_password
MAIL_FROM_ADDRESS=your_email@gmail.com

πŸ“˜ Usage Guide

For Teachers

Create Video Call

  1. Login as teacher
  2. Navigate to Video Calls β†’ Create New
  3. Choose platform (Zoom or Jitsi)
  4. Fill in details and submit
  5. Share join link with students

Create Exam

  1. Go to Exams β†’ Create Exam
  2. Add questions (multiple choice, true/false, essay)
  3. Set duration and grading options
  4. Publish to students

Grade Submissions

  • Auto-grading for objective questions
  • Manual grading for essay questions
  • Bulk grading support

For Students

Take Exam

  1. Go to My Exams
  2. Click Start Exam
  3. Answer questions within time limit
  4. Submit for grading

Join Video Call

  1. View Upcoming Video Calls
  2. Click Join button
  3. Enter Zoom/Jitsi meeting

Use Chat & AI Assistant

  1. Access Chat from sidebar
  2. Ask questions to AI assistant
  3. Get instant AI-powered answers

For Admins

Manage Users

# List all users
php scripts/list-all-users.php

# Reset password (fastest way)
php scripts/reset-user-password.php user@email.com newpass

# Create test users
php scripts/create-test-chat-users.php

System Monitoring

# Check system status
scripts\system-check.bat

# Check Zoom config
php scripts/check-zoom-config.php

πŸ”Œ API Documentation

Authentication

Get Dev Token (Development Only)

POST /api/dev-token
Content-Type: application/json

{
  "email": "teacher@megalearning.com"
}

Response:

{
  "success": true,
  "access_token": "1|xyz...",
  "token_type": "Bearer"
}

API Endpoints

Categories API

GET    /api/v1/categories           # List all
GET    /api/v1/categories/{id}      # Show one
POST   /api/v1/categories           # Create (auth)
PUT    /api/v1/categories/{id}      # Update (auth)
DELETE /api/v1/categories/{id}      # Delete (auth)

Subjects API

GET    /api/v1/subjects             # List all
GET    /api/v1/subjects/{id}        # Show one
POST   /api/v1/subjects             # Create (auth)
PUT    /api/v1/subjects/{id}        # Update (auth)
DELETE /api/v1/subjects/{id}        # Delete (auth)

Authentication: Add header: Authorization: Bearer {token}

Full API Guide: See docs/api/THUNDER_CLIENT_API_GUIDE.md


πŸ§ͺ Testing

Run All Tests

php artisan test

Run Specific Test Suites

# Feature tests
php artisan test --testsuite=Feature

# Unit tests
php artisan test --testsuite=Unit

# Browser tests (requires ChromeDriver)
php artisan dusk

Test Coverage

  • 26 Feature Tests - Exam management, Chat system, Integration tests
  • 10 Browser Tests - UI automation with Laravel Dusk
  • 36 Total Test Cases

Detailed Guide: See docs/testing/TESTING_GUIDE.md


πŸ› οΈ Scripts & Tools

Password Management

# Reset any user password (fastest way)
php scripts/reset-user-password.php user@email.com newpassword

# Example
php scripts/reset-user-password.php student@megalearning.com 12345678

Zoom Management

# Setup wizard
scripts\setup-zoom.bat

# Check configuration
php scripts/check-zoom-config.php

# Test API
php scripts/test-zoom-api.php

# Test meeting creation
php scripts/test-zoom-meeting.php

AI Assistant

# Setup wizard
scripts\setup-gemini.bat

# Test Gemini AI
php scripts/test-gemini.php

Database Management

# Fresh install with demo data
php artisan migrate:fresh --seed

# Check database status
php scripts/check-database.php

System Checks

# Full system verification
scripts\system-check.bat

# List all scripts
dir scripts\*.bat
dir scripts\*.php

All Scripts: See scripts/README.md


πŸ› Troubleshooting

Database Issues

Error: Access denied for user

# Check credentials in .env
DB_USERNAME=root
DB_PASSWORD=your_password

# Clear config cache
php artisan config:clear

Error: Database not found

# Create database
mysql -u root -p -e "CREATE DATABASE learning3"

# Then migrate
php artisan migrate

Zoom API Issues

Error: Invalid credentials

# Verify credentials at https://marketplace.zoom.us
# Re-run setup wizard
scripts\setup-zoom.bat

# Or check config
php scripts/check-zoom-config.php

Error: Insufficient permissions

  • Go to Zoom App β†’ Scopes
  • Add: meeting:write, meeting:read, user:read
  • Click "Activate"

Password Reset Issues

Can't access email?

# Use CLI tool instead
php scripts/reset-user-password.php user@email.com newpass123

Forgot all passwords?

# Reset all test accounts
php scripts/reset-user-password.php admin@megalearning.com password
php scripts/reset-user-password.php teacher@megalearning.com password
php scripts/reset-user-password.php student@megalearning.com password

Common Fixes

# Clear all caches
php artisan optimize:clear

# Regenerate autoload
composer dump-autoload

# Rebuild assets
npm run build

# Restart server
php artisan serve

πŸ“ Project Structure

MegaLearning/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Http/Controllers/      # Controllers
β”‚   β”‚   β”œβ”€β”€ Admin/             # Admin controllers
β”‚   β”‚   β”œβ”€β”€ Teacher/           # Teacher controllers
β”‚   β”‚   β”œβ”€β”€ Student/           # Student controllers
β”‚   β”‚   └── Api/               # API controllers
β”‚   β”œβ”€β”€ Models/                # Eloquent models
β”‚   β”œβ”€β”€ Services/              # Business logic
β”‚   β”‚   β”œβ”€β”€ ZoomService.php    # Zoom API integration
β”‚   β”‚   └── AIService.php      # Gemini AI integration
β”‚   └── Policies/              # Authorization policies
β”‚
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/            # Database migrations
β”‚   β”œβ”€β”€ seeders/               # Database seeders
β”‚   └── factories/             # Model factories
β”‚
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ views/                 # Blade templates
β”‚   β”‚   β”œβ”€β”€ admin/             # Admin views
β”‚   β”‚   β”œβ”€β”€ teacher/           # Teacher views
β”‚   β”‚   β”œβ”€β”€ student/           # Student views
β”‚   β”‚   β”œβ”€β”€ auth/              # Authentication views
β”‚   β”‚   └── chat/              # Chat views
β”‚   β”œβ”€β”€ css/                   # Stylesheets
β”‚   └── js/                    # JavaScript
β”‚
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ web.php                # Web routes
β”‚   β”œβ”€β”€ api.php                # API routes
β”‚   └── channels.php           # Broadcasting channels
β”‚
β”œβ”€β”€ scripts/                   # Helper scripts
β”‚   β”œβ”€β”€ setup-zoom.bat         # Zoom setup wizard
β”‚   β”œβ”€β”€ setup-gemini.bat       # AI setup wizard
β”‚   β”œβ”€β”€ reset-user-password.php
β”‚   β”œβ”€β”€ test-zoom-api.php
β”‚   └── test-gemini.php
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ Feature/               # Feature tests
β”‚   β”‚   β”œβ”€β”€ ExamManagementTest.php
β”‚   β”‚   β”œβ”€β”€ ChatSystemTest.php
β”‚   β”‚   └── IntegrationTest.php
β”‚   └── Browser/               # Browser tests
β”‚       β”œβ”€β”€ ExamUITest.php
β”‚       └── ChatUITest.php
β”‚
└── docs/                      # Documentation
    β”œβ”€β”€ SETUP_VERIFICATION.md  # Setup status report
    └── DATABASE_SEEDING.md    # Seeding guide

Full Structure: See docs/STRUCTURE.md


🎯 Quick Reference

Most Used Commands

# Development
php artisan serve              # Start server
npm run dev                    # Start Vite (hot reload)
composer dev                   # Run both servers

# Database
php artisan migrate:fresh --seed    # Reset database
php artisan migrate                 # Run migrations
php artisan db:seed                 # Seed only

# Testing
php artisan test               # Run all tests
php artisan dusk               # Run browser tests

# Cache
php artisan optimize:clear     # Clear all caches
php artisan config:clear       # Clear config cache
php artisan view:clear         # Clear view cache

# Utilities
php artisan route:list         # List all routes
php artisan tinker             # Laravel REPL

Key URLs


πŸ“š Additional Documentation

Setup & Configuration

User Guides

Testing & API

Project Structure


πŸŽ‰ Status

βœ… FULLY OPERATIONAL & PRODUCTION READY

  • Core learning features
  • Video conferencing (Zoom + Jitsi)
  • AI chat assistant (Gemini)
  • Real-time chat
  • Exam management
  • API with authentication
  • Testing suite (36 tests)
  • Documentation complete

Ready for:

  • Development βœ…
  • Testing βœ…
  • Demo/Presentation βœ…
  • Production Deployment βœ…

πŸ“ž Support

Need Help?

  1. Check Troubleshooting section
  2. Review documentation in docs/ folder
  3. Run system check: scripts\system-check.bat
  4. Check specific guides:

Quick Diagnostics:

php scripts/check-zoom-config.php    # Check Zoom
scripts\system-check.bat             # Full system check

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘₯ Authors


Made with ❀️ using Laravel

NhΓ³m 5 - NhαΊ­p MΓ΄n CΓ΄ng Nghệ PhαΊ§n Mềm - 2025-2026

⬆ Back to Top

# 3. Push lΓͺn GitHub git push origin feature/webrtc-video-call # Thay tΓͺn branch tΖ°Ζ‘ng α»©ng: feature/chat-system, feature/forum-qna, v.v. ```

Pull code mα»›i nhαΊ₯t tα»« GitHub

# CαΊ­p nhαΊ­t branch hiện tαΊ‘i
git pull origin <branch-name>

# VΓ­ dα»₯:
git pull origin feature/webrtc-video-call

Merge Branch vΓ o Main (sau khi hoΓ n thΓ nh)

# 1. Chuyển về main
git checkout main

# 2. Pull code mα»›i nhαΊ₯t
git pull origin main

# 3. Merge branch feature vΓ o main
git merge feature/webrtc-video-call

# 4. Push lΓͺn GitHub
git push origin main

πŸ“‹ PhΓ’n cΓ΄ng Branches cho Team

ThΓ nh viΓͺn Branch Nhiệm vα»₯
Person A feature/webrtc-video-call Video call học nhóm, screen sharing
Person B feature/chat-system Real-time chat, group messaging
Person C feature/forum-qna Diα»…n Δ‘Γ n Q&A, upvote/downvote
Person D feature/ai-integration AI chatbot, auto-grading

πŸ“š TΓ i liệu Tham khαΊ£o


πŸ‘₯ Team Members

  • Luc Dang - GitHub
  • ThΓͺm tΓͺn cΓ‘c thΓ nh viΓͺn khΓ‘c ở Δ‘Γ’y

πŸ“„ License

This project is for educational purposes only (NMCNPM - 2025).


πŸ†˜ Support

NαΊΏu gαΊ·p vαΊ₯n đề, vui lΓ²ng:

  1. Kiểm tra phαΊ§n Troubleshooting
  2. TαΊ‘o issue trΓͺn GitHub
  3. LiΓͺn hệ team members

Happy Coding! πŸš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •