A full-featured online learning platform built for the Afghan market β with local payment integration via HesabPay, course management, video lessons, and real-time student progress tracking.
Afghanistan lacks accessible, locally-integrated online education platforms. Most global e-learning tools don't support local payment methods, making it impossible for Afghan students to enroll and pay. EduLearn Academy solves this by providing a full-featured LMS with HesabPay β Afghanistan's local payment gateway β built right in.
- π Course Management β instructors can create, update, and organize courses with structured content
- π¬ Video Lessons β stream video lessons directly within the platform
- π€ Student Enrollment β students can browse, enroll, and access courses after payment
- π Student Progress Tracking β track completion rates and lesson progress per student
- π³ HesabPay Integration β seamless local payment processing for Afghan users
- π οΈ Admin Dashboard β full control over courses, users, enrollments, and revenue
edulearn-academy/
βββ backend/ # Laravel REST API
β βββ app/
β β βββ Http/
β β β βββ Controllers/ # API controllers
β β β βββ Middleware/
β β βββ Models/ # Eloquent models
β β βββ Services/ # HesabPay & business logic
β β βββ Policies/ # Authorization policies
β βββ database/
β β βββ migrations/
β β βββ seeders/
β βββ routes/
β βββ api.php
βββ frontend/ # React + Chakra UI
βββ src/
β βββ components/
β βββ pages/
β βββ hooks/
β βββ services/ # API client layer
- PHP 8.1+
- Composer
- MySQL 8+
- Node.js 18+
git clone https://github.com/Sajjad-Matin/edulearn-academy.git
cd edulearn-academycd backend
composer installCopy the example env file and fill in your values:
cp .env.example .envKey environment variables to configure in .env:
APP_NAME=EduLearn
APP_ENV=local
APP_KEY= # Run: php artisan key:generate
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=edulearn
DB_USERNAME=root
DB_PASSWORD=
SESSION_DRIVER=database
QUEUE_CONNECTION=database
CACHE_STORE=database
MAIL_MAILER=smtp
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME="${APP_NAME}"
FRONTEND_URL=http://localhost:5173
# HesabPay (Afghanistan local payment gateway)
HESAB_PAY_API_KEY=
HESAB_PAY_MERCHANT_ID=Run migrations and seed the database:
php artisan key:generate
php artisan migrate --seed
php artisan storage:link
php artisan serveThe API will be available at http://localhost:8000
cd ../frontend
npm install
npm run devThe frontend will be available at http://localhost:5173
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register |
Register a new user | Public |
| POST | /api/auth/login |
Login and get token | Public |
| GET | /api/courses |
List all available courses | Public |
| GET | /api/courses/:id |
Get course details & lessons | Public |
| POST | /api/courses |
Create a new course | Admin |
| POST | /api/enrollments |
Enroll in a course | Required |
| GET | /api/enrollments/my |
Get my enrolled courses | Required |
| GET | /api/progress/:courseId |
Get lesson progress for a course | Required |
| POST | /api/payments/hesabpay/initiate |
Initiate HesabPay payment | Required |
| POST | /api/payments/hesabpay/verify |
Verify payment & unlock course | Required |
| GET | /api/admin/dashboard |
Admin stats & overview | Admin |
EduLearn uses HesabPay as its payment gateway β one of the few payment processors operating in Afghanistan. The integration flow works as follows:
- Student selects a course and initiates checkout
- Backend calls HesabPay API to create a payment session
- Student is redirected to HesabPay's secure payment page
- On success, HesabPay sends a callback to the backend
- Backend verifies the payment and automatically enrolls the student
- Add test coverage (PHPUnit + Pest)
- Quiz & assessment system
- Certificate generation on course completion
- Instructor earnings & payout tracking
- Mobile app (React Native)
Sajjad Matin
- Portfolio: my-portfolio-vert-seven.vercel.app
- LinkedIn: sajjad-matin-mahmodi
- Email: [email protected]
This project is open source and available under the MIT License.