This project is a scalable, multi-tenant online learning platform built with HyPerf and powered by a containerized infrastructure using Docker. It includes support for i18n, async jobs, secure API access, content delivery, and user certification management.
| Layer | Stack/Tools |
|---|---|
| Backend | HyPerf 3.1, PHP 8.4, Swoole |
| Frontend | Nuxt by Vue.js (with Firebase or Cloudflare) |
| Database | MySQL 8 (via Docker) |
| Caching | Redis (async-queue) |
| Media | Google Cloud Storage, YouTube/Vimeo |
| Hosting | VPS (Hostinger), Firebase (Frontend) |
| SSL | Certbot + Cloudflare |
| Container | Docker + Docker Compose |
- Multi-tenant architecture (
Tenant,Course,Topic,Content) - Student enrollment and progress tracking
- Video-based lessons and activity content
- Certification generation for completed courses
- Fully containerized backend + DB + cache
- Auto-configured non-root user in container
- Dark/Light theme toggle on frontend
- Firebase or Cloudflare hosting support
- Docker-ready for local + production environments
- Docker + Docker Compose
make(optional but recommended)
-
Copy the environment file:
cp src/.env.example src/.env
-
Start the application:
make go
This command will:
- Stop any existing containers
- Install Composer dependencies
- Build and start containers
- Run database migrations
- Display the API URL
-
Access the API:
http://localhost:8087
make go # Full setup (install + build + start + migrate)
make up # Start containers
make down # Stop containers
make restart # Restart containers
make sh # Open shell in backend container
make logs # Follow container logs
make log # Follow application logs
make test # Run tests
# Database commands
make db-migrate # Run migrations
make db-rollback # Rollback last migration
make db-seed # Run database seeders
# Cache & cleanup
make cache-clear # Clear Hyperf cache
make autoload # Regenerate autoload filesA complete Postman collection is available at docs/postman_collection.json with all API endpoints documented and ready to use.
Tenant Management
POST /api/tenants- Create a new tenantGET /api/tenants- List all tenants (with pagination)GET /api/tenants/{id}- Get tenant by ID
Student Enrollment
POST /api/enrollments- Enroll student in course
-
Import the collection:
- Open Postman
- Click "Import" → Select
docs/postman_collection.json
-
Configure variables:
- Base URL is pre-configured:
http://localhost:9501 - Variables:
tenant_id,course_id,student_id(automatically populated from responses)
- Base URL is pre-configured:
-
Start testing:
- Ensure containers are running:
make up - Use the requests in the collection
- Ensure containers are running:
Each endpoint includes:
- Complete request examples
- Detailed descriptions
- Expected response formats
- Validation error examples
- DDD bounded context information
To run the test suite:
make testOr generate a coverage report:
make test-reportAll production traffic is routed via Cloudflare, with Certbot handling SSL provisioning using DNS challenge.
- WebSocket real-time updates
- Notification system
- Admin dashboard
- Payment integration (Stripe or MercadoPago)