Prerequisites
- Docker & Docker Compose
- PHP 7.2+ (for running Composer/Artisan outside Docker)
- Composer
- Node.js + npm (for email template asset compilation)
Docker setup (recommended)
Get the environment file
The API requires a
.env file in the project root. This file is not committed to the repo.Options:- Ask a team member for the current
.env - Download from S3:
s3://tutorbloc-app/env-configurations/staging/.env - The parent
tutorbloc/directory may already have a.envyou can reference
Start Docker services
| Service | Port | Purpose |
|---|---|---|
app | 9000 | PHP 7.2-FPM application server |
webserver | 80, 443 | Nginx reverse proxy |
mysql-db | 3306 | Primary MySQL 5.7 database |
mysql-db-test | 3310 | Test MySQL 5.7 database |
redis | 6379 | Cache, sessions, queue |
blackbox | 3000 | Distance calculation microservice |
- Primary:
admin/secret(database:tutorbloc_db) - Test:
tester/tester_secret(database:tutorbloc_db_test)
Seed initial data
database/seeds/:InitialCountryTableSeederInitialCurrencyTableSeederInitialRoleTableSeederInitialSubjectTableSeederInitialSubjectLevelTableSeederInitialExamBoardTableSeederInitialLanguageTableSeederInitialNameTitleTableSeederInitialPaymentGatewayTableSeederInitialVerificationGatewayTableSeeder
Alternative: Laravel Homestead
The repo includesHomestead.yaml and Vagrantfile for Vagrant-based local development.
homestead.testapi.homestead.teststaging.api.homestead.test
Useful aliases
Thealiases file in the project root defines shell shortcuts:
| Alias | Command |
|---|---|
art | php artisan |
phpunit | vendor/bin/phpunit |
serve | php artisan serve |
dbexport | Database backup |
dbimport | Database restore |
Verifying setup
Once running, hithttp://localhost/api/countries — you should get a JSON response with seeded country data (no auth required).