Laravel 13 API scaffold for client-facing integrations.
The project is intended to demonstrate a structure suitable for:
- API clients and internal frontends
- third-party integrations
- LLM and agent tooling
- MCP-style server consumers
- DTO and multitenancy expansion
The app is currently single-tenant at runtime. Multitenancy-related structure is intentionally left as scaffolding for future implementation.
- Versioned API routes under
routes/api.php - Auth endpoint using Sanctum personal access tokens
- Request validation classes under
app/Http/Api/Requests - API controllers under
app/Http/Api/Controllers - Resource serialization under
app/Http/Resources - Response wrapper classes scaffolded under
app/Http/Api/Responses
Current API routes:
POST /api/v1/auth/loginGET /api/v1/usersGET /api/v1/tasksPOST /api/v1/tasksGET /api/v1/tasks/{task}PUT/PATCH /api/v1/tasks/{task}DELETE /api/v1/tasks/{task}
Authentication uses Laravel Sanctum token creation via:
POST /api/v1/auth/login
Request body:
{
"email": "client@example.com",
"password": "password"
}Optional header:
X-Integration-Name: Johns-Modem
Successful login returns a bearer token.
The login endpoint is rate-limited by email and client IP.
The default database seeder creates a test client account:
- Email:
client@example.com - Password:
password
Defined in database/seeders/DatabaseSeeder.php.
- PHP 8.3+
- Composer
- Node.js and npm
- MySQL for local runtime, or SQLite for test runs
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan db:seedOr use the Composer helper:
composer setupStart the full local dev stack:
composer devStart only the Laravel server:
php artisan serveTail Laravel logs:
php artisan pailRun migrations:
php artisan migrateRefresh and reseed:
php artisan migrate:fresh --seedRun seeders only:
php artisan db:seedRun the full test suite:
composer testRun a focused auth test:
php artisan test tests/Feature/Auth/LoginTest.phpList API routes:
php artisan route:list --path=api/v1Open an interactive shell:
php artisan tinkercurl -X POST http://127.0.0.1:8000/api/v1/auth/login \
-H "Content-Type: application/json" \
-H "X-Integration-Name: local-client" \
-d '{
"email": "client@example.com",
"password": "password"
}'This codebase is meant to show a clean starting structure for an API-first Laravel app rather than a finished production platform.
Intentional design choices:
- versioned routes from day one
- separated API controllers and requests
- token-based auth for machine clients
- room for DTO/action layering
- room for future multitenant scoping
Not implemented yet:
- Multitenancy
- Data Transfer Object mapping
- Resource policies
- Tenant-aware data scoping
- formal API schema or SDK generation
- User IDs use ULIDs.
- Sanctum personal access tokens are configured to work with ULID-backed users.
- Tests run against SQLite in memory via
phpunit.xml.