LearnBuddy is a full-featured Learning Management System (LMS) built with Laravel 13, Filament 5, Tailwind CSS v4, and Alpine.js. It is designed as a modular monolith that supports Online, Physical (in-person), and Hybrid course delivery under a unified course model, with default localization configured for Sri Lanka (Asia/Colombo, LKR).
- Key Features
- Tech Stack
- Project Structure
- Getting Started (Local Development)
- Demo Accounts (Seeded)
- Environment Variables
- Artisan Commands & Health Checks
- Running Tests
- Docker & Deployment
- Additional Documentation
- Online, Physical & Hybrid Modes: A single course can offer multiple delivery options (
CourseDeliveryOption) without duplicating course records. - Physical Campus & Batch Management: Manage physical campus locations (
PhysicalLocation), cohort batches (CourseBatch), recurring schedules (BatchSchedule), individual sessions (BatchSession), and student attendance (Attendance).
- Role-Based Access Control (RBAC): Supports
admin,instructor, andstudentroles with dedicated policies and middleware (role:admin,instructor,role:admin). - 6-Digit Email OTP Verification: New registrations verify their email via a 6-digit OTP flow (
/verify-otp), alongside standard password reset and email verification flows. - User & Instructor Approval: Public Become an Instructor application (
/become-instructor) and admin approval workflows (/admin/approvals,/management/users/approvals).
- Course Discovery & Enrollment: Public course catalog (
/courses), course detail pages, instructor profiles, and concurrency-safe enrollment (/courses/{course}/enroll). - Structured Curriculum & Video Playback: Sections and lessons with protected video playback (
VideoPlaybackController), downloadable lesson resources, and lesson progress tracking. - Assessments:
- Assignments: View prompts, submit files, and download graded submissions.
- Quizzes: Start timed/structured quiz attempts, submit answers, and review results.
- Live Classes: Scheduled interactive video classes powered by Jitsi Meet with configurable join buffer windows for students and instructors.
- Certificates & Reviews: Eligibility checks, certificate claiming, public certificate verification (
/certificates/verify/{hash}), and course ratings/reviews with moderation. - Receipts & Support: Order history, downloadable payment receipts (
/my-receipts), course announcements, and a built-in Support & Contact Desk (/support).
- Create and manage courses, transition publication statuses, and build curriculum sections/lessons.
- Upload and sync lesson videos with Mux (
LessonVideoUploadController). - Manage course batches, schedules, physical sessions, and mark attendance sheets.
- Create assignments and grade student submissions.
- Build quizzes, manage question banks, and inspect student attempts.
- Schedule live classes and trigger class reminders.
- Filament 5 Admin Panel & custom admin controllers covering:
- Academic & Courses: Courses, Categories, Videos
- Campus & Batches: Course Batches, Physical Locations, Attendance
- Student Learning & Progress: Enrollments, Certificates
- Assessments & Grading: Assignments, Quizzes
- Financial & Orders: Payments, Orders
- User & Security: Users, Instructors, Approvals, Audit Logs
- Analytics & System: Dashboard widgets, Reports, System Settings, Support Desk
- Payment Gateways: Pluggable gateway manager (
PaymentManager) supporting PayHere (default,LKR), Stripe, and a Mock gateway for local testing. - Webhooks (CSRF-exempt):
POST /api/webhooks/video/muxPOST /api/webhooks/payments/payherePOST /api/webhooks/payments/stripePOST /api/webhooks/payments/mock
- Notifications: In-app notification center with unread count API, user notification preferences, Mailjet transactional email support, and push notification provider abstraction (Firebase / Null).
| Layer | Technology |
|---|---|
| Backend | PHP 8.3+, Laravel 13 (^13.17), Filament 5 (^5.11) |
| Frontend | Vite 8, Tailwind CSS v4, Alpine.js 3, Font Awesome 7 |
| Database | MySQL (Aiven Cloud MySQL with SSL/TLS) / SQLite (testing) |
| Video & Live Classes | Mux (on-demand video), Jitsi Meet (live classes) |
| Payments | PayHere, Stripe, Mock Gateway |
| Email & Push | Mailjet, Firebase (optional) |
| Testing & Quality | PHPUnit 12, Laravel Pint, Laravel Pail |
| Deployment | Docker (PHP 8.3 + Apache), Render (render.yaml) |
LearnBuddy/
├── app/
│ ├── Console/Commands/ # Custom Artisan commands (health check, reminders, IPN sim)
│ ├── Enums/ # Typed PHP enums (roles, statuses, delivery modes)
│ ├── Filament/ # Filament 5 resources, pages, and dashboard widgets
│ ├── Http/
│ │ ├── Controllers/ # Public, Auth, Student, Admin, Management, Webhook controllers
│ │ ├── Middleware/ # Role, enrollment, locale, and security header guards
│ │ └── Requests/ # Form Request validation classes
│ ├── Models/ # Eloquent models (Course, Enrollment, Batch, Payment, etc.)
│ ├── Policies/ # Authorization & ownership policies
│ ├── Providers/ # AppServiceProvider & Filament AdminPanelProvider
│ └── Services/ # Payments, Video (Mux), LiveClass (Jitsi), Certificates, Notifications
├── config/ # Laravel, Filament, payment, video, and live-class configs
├── database/
│ ├── factories/ # Model factories
│ ├── migrations/ # Schema migrations
│ └── seeders/ # Roles, demo users, categories, locations, courses
├── docker/
│ └── start.sh # Container startup script (Apache port, SSL cert, migrations)
├── docs/
│ ├── architecture/ # System architecture & database schema docs
│ └── setup/ # Local Windows development guide
├── public/ # Public web root & built Vite assets
├── resources/ # Blade views, CSS (Tailwind v4), and JS (Alpine.js)
├── routes/
│ ├── web.php # Web, management, admin, and webhook routes
│ └── console.php # Scheduled/console commands
├── storage/certs/ # Place SSL CA certificates here (e.g., aiven-ca.pem; git-ignored)
├── tests/Feature/ # Feature test suites covering core LMS workflows
├── Dockerfile # Multi-stage Docker build (Node 22 + PHP 8.3 Apache)
└── render.yaml # Render.com Blueprint deployment configuration
- PHP 8.3+ (with
pdo_mysql,mbstring,exif,pcntl,bcmath,gd,intl,zip,openssl,curlextensions) - Composer 2.x
- Node.js 20+ and npm 10+
- MySQL 8+ (or Aiven Cloud MySQL with SSL certificate)
-
Clone the repository and install dependencies:
git clone <repository-url> cd LearnBuddy composer install npm install
-
Create and configure
.env:cp .env.example .env php artisan key:generate
Update
.envwith your database credentials and any third-party keys (Mailjet, PayHere, Jitsi, etc.). -
Configure MySQL SSL (if using Aiven Cloud MySQL):
- Download your Aiven CA certificate and save it to:
storage/certs/aiven-ca.pem - Verify database connectivity and SSL status:
php artisan db:health-check
- Download your Aiven CA certificate and save it to:
-
Run migrations and seed sample data:
php artisan migrate --seed php artisan storage:link
-
Build frontend assets and start the dev servers: In two terminals:
# Terminal 1: Laravel server (http://127.0.0.1:8000) php artisan serve # Terminal 2: Vite dev watcher npm run dev
Or build production assets once:
npm run build
Running php artisan db:seed (via UserSeeder) creates the following non-production test accounts:
| Role | Password | Notes | |
|---|---|---|---|
| Admin | admin@learnbuddy.lk |
AdminPass123! |
Full access to /admin and /management |
| Instructor | instructor@learnbuddy.lk |
InstructorPass123! |
Access to /management course & teaching tools |
| Student | student@learnbuddy.lk |
StudentPass123! |
Active student account for /dashboard & learning |
| Inactive Student | inactive@learnbuddy.lk |
StudentPass123! |
Deactivated account for testing access restrictions |
See .env.example for the complete template. Key configuration groups include:
| Group | Variables | Purpose |
|---|---|---|
| Application | APP_NAME, APP_ENV, APP_KEY, APP_URL, APP_TIMEZONE, APP_CURRENCY |
Core app settings (defaults: Asia/Colombo, LKR) |
| Database & SSL | DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD, MYSQL_ATTR_SSL_CA, MYSQL_ATTR_SSL_VERIFY_SERVER_CERT |
MySQL connection and mandatory SSL CA verification |
| Sessions & Queues | SESSION_DRIVER, CACHE_STORE, QUEUE_CONNECTION, FILESYSTEM_DISK |
file locally; database recommended in production |
| Mailjet | MAILJET_API_KEY, MAILJET_API_SECRET, MAILJET_SENDER_EMAIL, MAILJET_SENDER_NAME |
Transactional emails and OTP delivery |
| PayHere | PAYMENT_GATEWAY, PAYMENT_DEFAULT_CURRENCY, PAYHERE_SANDBOX, PAYHERE_MERCHANT_ID, PAYHERE_MERCHANT_SECRET, PAYHERE_APP_ID, PAYHERE_APP_SECRET |
PayHere checkout & IPN webhook verification |
| Jitsi Live Classes | LIVE_MEETING_PROVIDER, LIVE_STUDENT_JOIN_BUFFER_MINUTES, LIVE_INSTRUCTOR_JOIN_BUFFER_MINUTES, JITSI_DOMAIN, JITSI_APP_ID, JITSI_API_KEY_ID, JITSI_PRIVATE_KEY, JITSI_SECRET, JITSI_ROOM_PREFIX |
Live video session rooms and join windows |
| Deployment (Render) | AIVEN_CA_CERT, RUN_MIGRATIONS |
Injects aiven-ca.pem and runs migrations on container boot |
-
Database & SSL Health Check:
php artisan db:health-check
Verifies database connectivity and reports whether SSL/TLS encryption is active without leaking credentials.
-
Send Live Class Reminders:
php artisan reminders:live-classes --window=60
Dispatches reminders for upcoming live classes within the specified minute window.
-
Simulate PayHere IPN (Local Testing):
php artisan payhere:simulate-ipn
Simulates a PayHere Instant Payment Notification locally for testing checkout completion.
GET /up— Standard Laravel application health check.GET /up/database— Returns JSON indicating database driver status and whether MySQL SSL is active.
Run the PHPUnit test suite with:
php artisan testor via Composer:
composer testFeature tests in tests/Feature/ cover:
- Authentication & OTP verification (
AuthTest) - Public course discovery (
PublicCourseDiscoveryTest) - Course management & curriculum (
CourseManagementTest) - Enrollment & student learning (
CourseEnrollmentTest,StudentLearningTest) - Physical learning & batches (
PhysicalLearningTest) - Assignments & quizzes (
AssignmentTest,QuizTest) - Live classes & notifications (
LiveClassTest,NotificationAndAnnouncementTest) - Payments & Stripe/Mock gateways (
PaymentArchitectureTest,StripeMockGatewayTest) - Video integration (
VideoIntegrationTest) - Certificates & reviews (
CertificateAndReviewTest) - Support desk (
SupportMessageTest) - Filament Admin Panel (
Filament/AdminPanelTest) - Database health check & design system (
DatabaseHealthCheckTest,DesignSystemTest)
The included Dockerfile uses a two-stage build:
- Stage 1 (
node:22-alpine): Installs npm packages and builds frontend assets (npm run build). - Stage 2 (
php:8.3-apache): Installs required PHP extensions (pdo_mysql,mbstring,gd,intl,zip,bcmath,opcache, etc.), configures Apache forpublic/, installs Composer dependencies (--no-dev), and copies built assets.
docker build -t learnbuddy .
docker run -p 10000:10000 --env-file .env learnbuddyrender.yaml defines a Docker web service for Render:
- Health check path:
/up - Automatically writes
AIVEN_CA_CERTtostorage/certs/aiven-ca.pemat startup viadocker/start.sh. - Caches config, routes, and views, creates the storage symlink, and runs
php artisan migrate --forcewhenRUN_MIGRATIONS=true.