Skip to main content

Prerequisites

  • Docker & Docker Compose
  • PHP 7.2+ (for running Composer/Artisan outside Docker)
  • Composer
  • Node.js + npm (for email template asset compilation)
1

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 .env you can reference
The .env contains secrets (Stripe keys, API tokens, database credentials). Never commit it.
2

Install PHP dependencies

3

Start Docker services

This starts 6 services:Default database credentials:
  • Primary: admin / secret (database: tutorbloc_db)
  • Test: tester / tester_secret (database: tutorbloc_db_test)
4

Run database migrations

5

Seed initial data

This seeds: countries, currencies, roles, subjects, subject levels, exam boards, languages, name titles, payment gateways, and verification gateways.Individual seeders available in database/seeds/:
  • InitialCountryTableSeeder
  • InitialCurrencyTableSeeder
  • InitialRoleTableSeeder
  • InitialSubjectTableSeeder
  • InitialSubjectLevelTableSeeder
  • InitialExamBoardTableSeeder
  • InitialLanguageTableSeeder
  • InitialNameTitleTableSeeder
  • InitialPaymentGatewayTableSeeder
  • InitialVerificationGatewayTableSeeder
6

Compile frontend assets (optional)

Only needed if you’re working on email templates. Compiles JS and SASS via Laravel Mix.

Alternative: Laravel Homestead

The repo includes Homestead.yaml and Vagrantfile for Vagrant-based local development.
The Homestead config has a hardcoded path (/Users/jmendoza/Sites/tutorbloc-api). You’ll need to update this to your local path in Homestead.yaml.
Homestead maps three sites:
  • homestead.test
  • api.homestead.test
  • staging.api.homestead.test

Useful aliases

The aliases file in the project root defines shell shortcuts:

Verifying setup

Once running, hit http://localhost/api/countries — you should get a JSON response with seeded country data (no auth required).