SplashCourses is a complete multi-tenant SaaS platform for online courses and knowledge businesses, built with pure PHP and MySQL. Similar in spirit to Teachable, Kajabi, and Thinkific, it provides everything needed to run an online course business at scale.
- Course creators & online educators
- Training academies & universities
- Corporate training departments
- Coaching & consulting businesses
- Fully isolated tenant data with single shared database
- Subscription plans with quota enforcement
- Usage tracking (courses, students, storage, API calls)
- Customizable branding per tenant
- Unlimited courses, modules, and lessons
- Multiple content types: video, text, downloads, quizzes
- Progress tracking and course completion
- Certificates of completion
- Preview lessons for marketing
- Multiple question types (MCQ single/multi, true/false, short text)
- Configurable passing scores
- Attempt limits
- Auto-grading with detailed results
- One-time course purchases
- Subscription memberships
- Course bundles
- Free courses
- Simulated payment processing (ready for Stripe/PayPal integration)
- Referral tracking with unique codes
- Configurable commission rates (percent or fixed)
- Click tracking and conversion attribution
- Commission management
- Student progress dashboards
- Instructor revenue tracking
- Course performance metrics
- Platform-wide admin analytics
- Public API for integrations
- API key authentication
- Course catalog access
- Enrollment management
- Progress tracking
- Backend: PHP 7.0+ (compatible with 7.x - 8.x)
- Database: MySQL 5.7+ / MariaDB 10.2+
- Architecture: Custom lightweight MVC (no frameworks)
- Frontend: Vanilla JavaScript + responsive CSS
- Security: PDO prepared statements, CSRF protection, password hashing
- PHP 7.0 or higher
- MySQL 5.7+ or MariaDB 10.2+
- Apache/Nginx web server
- PHP Extensions:
- pdo_mysql
- mbstring
- openssl
- json
- fileinfo
git clone https://github.com/ahmedsaadawi13/splashcourses.git
cd splashcoursescp .env.example .envEdit .env with your database credentials:
APP_ENV=development
APP_DEBUG=true
APP_URL=http://localhost
DB_HOST=localhost
DB_DATABASE=splashcourses
DB_USERNAME=root
DB_PASSWORD=your_password_heremysql -u root -pCREATE DATABASE splashcourses CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;mysql -u root -p splashcourses < database.sqlThis will create all tables and insert seed data including:
- Demo tenant ("Demo Academy")
- Sample users with different roles
- Example courses with content
- Quiz questions and certificates
chmod -R 755 storage/
chmod -R 755 storage/uploads/
chmod -R 755 storage/logs/Ensure mod_rewrite is enabled and set DocumentRoot to /path/to/splashcourses/public
Example VirtualHost:
<VirtualHost *:80>
ServerName splashcourses.local
DocumentRoot /var/www/splashcourses/public
<Directory /var/www/splashcourses/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/splashcourses_error.log
CustomLog ${APACHE_LOG_DIR}/splashcourses_access.log combined
</VirtualHost>server {
listen 80;
server_name splashcourses.local;
root /var/www/splashcourses/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}Open your browser and navigate to:
- http://localhost (or your configured domain)
- http://localhost/demo (Demo Academy homepage)
- Email: platform@splashcourses.com
- Password: password123
- Email: owner@demoacademy.com
- Password: password123
- Email: instructor@demoacademy.com
- Password: password123
- Email: student1@example.com, student2@example.com, student3@example.com
- Password: password123
splashcourses/
├── app/
│ ├── core/ # MVC framework core
│ │ ├── Database.php
│ │ ├── Router.php
│ │ ├── Controller.php
│ │ ├── Model.php
│ │ ├── View.php
│ │ ├── Auth.php
│ │ ├── Session.php
│ │ ├── Request.php
│ │ ├── Response.php
│ │ └── CSRF.php
│ ├── controllers/ # Application controllers
│ ├── models/ # Database models
│ ├── views/ # View templates
│ └── helpers/ # Helper utilities
├── config/ # Configuration files
├── public/ # Public web root
│ ├── index.php # Application entry point
│ ├── .htaccess # Apache rewrite rules
│ └── assets/ # CSS, JS, images
├── storage/
│ ├── uploads/ # User uploaded files
│ └── logs/ # Application logs
├── tests/ # Test scripts
├── database.sql # Database schema & seed data
├── .env.example # Environment template
└── README.md # This file
- Login as instructor or tenant owner
- Navigate to "My Courses" or "Manage Courses"
- Click "Create New Course"
- Fill in course details:
- Title, subtitle, description
- Level (beginner/intermediate/advanced)
- Category
- Pricing (free or paid)
- Save as draft
- Add modules and lessons
- Publish when ready
Course
├── Module 1
│ ├── Lesson 1 (Video)
│ ├── Lesson 2 (Text)
│ └── Lesson 3 (Quiz)
├── Module 2
│ ├── Lesson 4 (Video)
│ └── Lesson 5 (Download)
└── ...
- Browse courses at
/demo/courses - Click on a course to view details
- Click "Enroll Now"
- For free courses: instant enrollment
- For paid courses: simulated checkout process
- Access course from student dashboard
- Track progress automatically
- Earn certificate upon completion
Certificates are automatically generated when students complete all lessons in a course. Each certificate has:
- Unique verification code
- Public verification URL:
/certificate/{code} - Downloadable HTML (PDF generation can be added)
- Create affiliate account in tenant admin
- Generate unique referral code
- Share referral link:
/demo?ref={code} - Track clicks and conversions
- Earn commissions on sales
- View earnings in affiliate dashboard
All API requests require an API key in the header:
X-API-KEY: your_api_key_hereGET /api/coursesQuery parameters:
category- Filter by category IDfree_only- Show only free courses (1/0)search- Search in title/description
Response:
{
"success": true,
"data": [...],
"count": 2
}GET /api/courses/{id or slug}Response:
{
"success": true,
"data": {
"course": {...},
"modules": [...]
}
}POST /api/enrollments/createBody:
{
"student": {
"email": "john@example.com",
"name": "John Doe"
},
"course_id": 1
}GET /api/students/{student_id}/courses/{course_id}/progress$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/api/courses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-API-KEY: demo_api_key_1234567890abcdef1234567890abcdef1234567890abcdef"
]
]);
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response, true);Run the included test scripts to verify installation:
# Test database connection
php tests/test_db_connection.php
# Test course creation
php tests/test_course_creation.php
# Test enrollment flow
php tests/test_enrollment_flow.php
# Test API (requires running server)
php tests/test_api.php- Password Hashing: BCrypt via
password_hash() - SQL Injection Prevention: PDO prepared statements only
- XSS Protection:
htmlspecialchars()on all outputs - CSRF Protection: Token validation on all forms
- Session Security:
session_regenerate_id()on login - Login Throttling: Brute force protection with lockout
- Tenant Isolation: Strict filtering on all queries
- File Upload Validation: MIME type and size checks
- API Rate Limiting: Via usage tracking
Each subscription plan has quotas for:
- Maximum courses
- Maximum students
- Maximum instructors
- Maximum storage (bytes)
- Maximum membership tiers
- API calls per month
The system automatically enforces these limits and provides clear error messages when quotas are exceeded.
Emails are currently logged to /storage/logs/email_log.txt.
To integrate real email service:
- Install PHPMailer or use built-in
mail() - Update
app/helpers/MailerHelper.php - Configure SMTP settings in
.env
Triggered emails:
- Enrollment confirmation
- Payment receipts
- Certificate issuance
- Password reset
- Welcome messages
The payment system is currently simulated. To integrate real payments:
// In app/helpers/PaymentHelper.php
require_once 'vendor/autoload.php';
\Stripe\Stripe::setApiKey('your_secret_key');
$charge = \Stripe\Charge::create([
'amount' => $amount * 100,
'currency' => 'usd',
'source' => $token,
'description' => 'Course purchase'
]);Similar integration can be done with PayPal REST API or other payment gateways like Braintree, Square, or Paddle.
- Add indexes on frequently queried columns
- Implement query caching
- Use read replicas for analytics
- Consider partitioning large tables
- Move uploads to S3/CloudFlare R2/DigitalOcean Spaces
- Implement CDN for static assets
- Use cloud storage for videos
- Add Redis/Memcached for session storage
- Implement application-level caching
- Use queue systems (Redis Queue, RabbitMQ) for emails
- Enable OPcache for PHP
- Load balancer (HAProxy, Nginx)
- Multiple web servers
- Database clustering
- Automated backups
- Add role to
userstable enum - Update permissions in controllers
- Create role-specific dashboard view
- Update navigation menus
- Edit
/public/assets/css/style.css - Or add per-tenant theme CSS in database
- Load custom CSS based on
tenant.theme_settings_json
- Add type to
course_lessons.content_typeenum - Create handler in
LessonController - Add view template
- Update lesson creation form
- Check
.envcredentials - Verify MySQL is running
- Test connection:
php tests/test_db_connection.php
- Ensure
mod_rewriteis enabled (Apache) - Check
.htaccessis in/public - Verify DocumentRoot points to
/public
- Check storage directory permissions
- Verify
upload_max_filesizein php.ini - Ensure
post_max_sizeis sufficient
- Check session directory is writable
- Verify
session.save_pathin php.ini - Clear browser cookies
This project is provided as-is for educational and commercial use.
For issues, feature requests, or contributions:
- GitHub Issues: https://github.com/ahmedsaadawi13/splashcourses/issues
- Email: ahmed.sha3ban13@gmail.com
Built with:
- Custom PHP MVC Architecture
- MySQL Database
- Vanilla JavaScript
- Pure CSS
- Multi-tenant architecture
- Complete LMS functionality
- Quiz system
- Certificate generation
- Affiliate program
- REST API
- Payment simulation
- 50+ database tables
- Responsive UI
- Security hardening
- Comprehensive documentation
Happy Teaching! 🎓