Setup & Installation
Prerequisites
- PHP 8.4+
- Composer
- Node.js 20+
- PostgreSQL 16+ (Docker recommended)
- Docker (for Octane and full dev environment)
Quick Start
bash
# Install dependencies + create .env + generate key + migrate + build
composer run setupStep-by-Step
1. Clone & Install
bash
git clone <repo-url> sutomo
cd sutomo
cp .env.example .env
composer install
npm install2. Environment Configuration
Edit .env with your database credentials:
env
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=sutomo
DB_USERNAME=app
DB_PASSWORD=3. Generate Key & Run Migrations
bash
php artisan key:generate
php artisan migrate4. Build Frontend Assets
bash
npm run build5. Run Dev Server
bash
composer run devThis runs three processes concurrently:
php artisan serve --port=8080— Laravel dev serverphp artisan queue:listen— Queue workernpm run dev— Vite hot-reload
Docker Environment
For production-like environment with Octane (FrankenPHP):
bash
docker compose up -dOctane Reload
After PHP changes during development:
bash
docker compose exec app php artisan octane:reloadFirst Run — Setup Wizard
When you first visit http://localhost:8080 the app redirects to /setup if no super user exists.
Setup Steps
| Step | Description | API Endpoint |
|---|---|---|
| 1. Super User | Create admin account + verify email | POST /api/setup/register, POST /api/setup/send-otp, POST /api/setup/verify-otp |
| 2. Seed Data | Run seeders (geographic, permissions, settings) | POST /api/setup/seed (SSE stream) |
| 3. About | Foundation info, branding, contact | POST /api/setup/about |
| 4. Settings | Theme, colors, social media | POST /api/setup/setting |
Middleware Flow
Request → SetupMiddleware → MaintenanceMiddleware → Controller- SetupMiddleware: If no super user / geographic data → redirect to
/setup - MaintenanceMiddleware: If maintenance mode ON → UnderConstruction page. If missing schools/articles → redirect to
/portal
Code Quality
bash
vendor/bin/pint --format agent # Auto-format PHP
npm run format # Prettier (Svelte/TS)
npm run lint # ESLint
npm run types:check # Svelte checkTesting
bash
# All tests
composer run test
# Filter by name
php artisan test --compact --filter=VacancyTest
# Frontend unit tests
npm run test:unit
# E2E (Playwright)
npm run test:e2e