Full stack: Next.js (frontend) + Laravel (API) + PostgreSQL (database).
┌─────────────────┐ HTTP (API) ┌─────────────────┐
│ Next.js :3000 │ ──────────────────► │ Laravel :8000 │
│ frontend/ │ Sanctum + CORS │ backend/ │
└─────────────────┘ └────────┬────────┘
│ SQL
▼
┌─────────────────┐
│ PostgreSQL :5432 │
│ (Docker) │
└─────────────────┘
mealbuddy/
├── backend/ # Laravel 13 — REST API, Sanctum, Filament
├── frontend/ # Next.js 16 — React UI
├── docker-compose.yml # PostgreSQL for local dev
├── package.json # Root scripts
└── pnpm-workspace.yaml
- Docker (for PostgreSQL)
- PHP 8.3+ with
pdo_pgsql, Composer - Node 20+, pnpm
Install the PHP PostgreSQL extension if needed:
# macOS (Homebrew PHP)
pecl install pdo_pgsql
# or ensure php is built with pgsql1. Start PostgreSQL
pnpm db:up2. Install dependencies and migrate
pnpm setup
cp frontend/.env.example frontend/.env.localpnpm setup starts Postgres, installs Node/PHP deps, copies backend/.env, generates an app key, and runs migrations.
3. Run the stack
pnpm dev| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| API | http://localhost:8000 |
| PostgreSQL | localhost:5432 |
Defaults in .env.example match Docker Compose:
| Variable | Default |
|---|---|
DB_CONNECTION |
pgsql |
DB_HOST |
127.0.0.1 |
DB_PORT |
5432 |
DB_DATABASE |
mealbuddy |
DB_USERNAME |
mealbuddy |
DB_PASSWORD |
secret |
NEXT_PUBLIC_API_URL=http://localhost:8000/apipnpm db:up # Start PostgreSQL
pnpm db:down # Stop PostgreSQL
pnpm db:reset # Wipe volume and recreate DB
pnpm dev # Laravel + Next.js
pnpm dev:backend # Laravel only
pnpm dev:frontend # Next.js onlyphp artisan migrate
php artisan migrate:fresh --seed
php artisan tinkerPHPUnit uses in-memory SQLite (fast, no Docker required):
cd backend && composer test- CORS and Sanctum allow
http://localhost:3000(backend/config/cors.php,backend/config/sanctum.php). - Inertia pages under
backend/resources/jsare for Filament / legacy routes; the main app UI is infrontend/. - Change Postgres credentials in both root
.env(Docker) andbackend/.env(Laravel) if you customize them.