Modern e-learning platform built with Laravel 12, featuring video conferencing, AI chat assistant, exam management, and real-time collaboration.
- Quick Start
- Features
- System Requirements
- Installation
- Configuration
- Usage Guide
- API Documentation
- Testing
- Scripts & Tools
- Troubleshooting
- Project Structure
- Additional Documentation
# 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:
- Web: http://localhost:8000
- Admin: http://localhost:8000/admin
- Teacher: http://localhost:8000/teacher
- Student: http://localhost:8000/student
| Password | Role | |
|---|---|---|
| admin@megalearning.com | password | admin |
| teacher@megalearning.com | password | teacher |
| student@megalearning.com | password | student |
- 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
- 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
- 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
- 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
- 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)
git clone https://github.com/Lucdpt3105/MegaLearning.git
cd MegaLearning
composer install
npm installcp .env.example .env
php artisan key:generateEdit .env and configure:
DB_DATABASE=learning3
DB_USERNAME=root
DB_PASSWORD=your_password# Create database
mysql -u root -p -e "CREATE DATABASE learning3"
# Run migrations and seeders
php artisan migrate --seednpm run build
# Or for development with hot reload
npm run devphp artisan serveDB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=learning3
DB_USERNAME=root
DB_PASSWORD=your_password- Create Server-to-Server OAuth app at https://marketplace.zoom.us/develop/create
- Add these scopes:
meeting:write:admin,meeting:read:admin,user:read:admin - Configure in
.env:
ZOOM_ACCOUNT_ID=your_account_id
ZOOM_CLIENT_ID=your_client_id
ZOOM_CLIENT_SECRET=your_client_secretQuick Setup:
scripts\setup-zoom.batVerify:
php scripts/check-zoom-config.php
php scripts/test-zoom-meeting.phpFallback: Jitsi is available without any configuration!
Get free API key from https://makersuite.google.com/app/apikey
GEMINI_API_KEY=your_api_key
GEMINI_MODEL=gemini-2.0-flash-expQuick Setup:
scripts\setup-gemini.batTest:
php scripts/test-gemini.phpFor 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
- Login as teacher
- Navigate to Video Calls β Create New
- Choose platform (Zoom or Jitsi)
- Fill in details and submit
- Share join link with students
- Go to Exams β Create Exam
- Add questions (multiple choice, true/false, essay)
- Set duration and grading options
- Publish to students
- Auto-grading for objective questions
- Manual grading for essay questions
- Bulk grading support
- Go to My Exams
- Click Start Exam
- Answer questions within time limit
- Submit for grading
- View Upcoming Video Calls
- Click Join button
- Enter Zoom/Jitsi meeting
- Access Chat from sidebar
- Ask questions to AI assistant
- Get instant AI-powered answers
# 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# Check system status
scripts\system-check.bat
# Check Zoom config
php scripts/check-zoom-config.phpPOST /api/dev-token
Content-Type: application/json
{
"email": "teacher@megalearning.com"
}Response:
{
"success": true,
"access_token": "1|xyz...",
"token_type": "Bearer"
}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)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
php artisan test# Feature tests
php artisan test --testsuite=Feature
# Unit tests
php artisan test --testsuite=Unit
# Browser tests (requires ChromeDriver)
php artisan dusk- 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
# 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# 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# Setup wizard
scripts\setup-gemini.bat
# Test Gemini AI
php scripts/test-gemini.php# Fresh install with demo data
php artisan migrate:fresh --seed
# Check database status
php scripts/check-database.php# Full system verification
scripts\system-check.bat
# List all scripts
dir scripts\*.bat
dir scripts\*.phpAll Scripts: See scripts/README.md
Error: Access denied for user
# Check credentials in .env
DB_USERNAME=root
DB_PASSWORD=your_password
# Clear config cache
php artisan config:clearError: Database not found
# Create database
mysql -u root -p -e "CREATE DATABASE learning3"
# Then migrate
php artisan migrateError: 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.phpError: Insufficient permissions
- Go to Zoom App β Scopes
- Add: meeting:write, meeting:read, user:read
- Click "Activate"
Can't access email?
# Use CLI tool instead
php scripts/reset-user-password.php user@email.com newpass123Forgot 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# Clear all caches
php artisan optimize:clear
# Regenerate autoload
composer dump-autoload
# Rebuild assets
npm run build
# Restart server
php artisan serveMegaLearning/
βββ 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
# 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- Homepage: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
- Teacher Dashboard: http://localhost:8000/teacher
- Student Dashboard: http://localhost:8000/student
- API Base: http://localhost:8000/api/v1
- Password Reset: http://localhost:8000/forgot-password
- docs/setup/SETUP_VERIFICATION.md - Detailed setup status report
- docs/setup/ZOOM_SETUP_GUIDE.md - Complete Zoom integration guide
- docs/setup/SETUP_SUMMARY.md - All features overview
- docs/guides/PASSWORD_RESET_GUIDE.md - Password reset methods
- docs/guides/ZOOM_QUICK_REF.md - Zoom quick reference
- docs/testing/TESTING_GUIDE.md - Testing documentation
- docs/api/THUNDER_CLIENT_API_GUIDE.md - API testing guide
- docs/STRUCTURE.md - Detailed project structure
- docs/DATABASE_SEEDING.md - Database seeding guide
- scripts/README.md - All helper scripts documentation
β 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 β
Need Help?
- Check Troubleshooting section
- Review documentation in docs/ folder
- Run system check:
scripts\system-check.bat - Check specific guides:
- Password issues β docs/guides/PASSWORD_RESET_GUIDE.md
- Zoom issues β docs/setup/ZOOM_SETUP_GUIDE.md
- API issues β docs/api/THUNDER_CLIENT_API_GUIDE.md
Quick Diagnostics:
php scripts/check-zoom-config.php # Check Zoom
scripts\system-check.bat # Full system checkThis project is licensed under the MIT License - see the LICENSE file for details.
- Luc Dang - Initial work - Lucdpt3105
Made with β€οΈ using Laravel
NhΓ³m 5 - NhαΊp MΓ΄n CΓ΄ng Nghα» PhαΊ§n Mα»m - 2025-2026
# CαΊp nhαΊt branch hiα»n tαΊ‘i
git pull origin <branch-name>
# VΓ dα»₯:
git pull origin feature/webrtc-video-call# 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| 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 |
- Luc Dang - GitHub
- ThΓͺm tΓͺn cΓ‘c thΓ nh viΓͺn khΓ‘c α» ΔΓ’y
This project is for educational purposes only (NMCNPM - 2025).
NαΊΏu gαΊ·p vαΊ₯n Δα», vui lΓ²ng:
- Kiα»m tra phαΊ§n Troubleshooting
- TαΊ‘o issue trΓͺn GitHub
- LiΓͺn hα» team members
Happy Coding! π