A modern full-stack starter template combining Tempest PHP Framework for the backend API and Next.js for the frontend dashboard.
| Layer | Technology | Version |
|---|---|---|
| Backend Framework | Tempest | 2.0 |
| PHP | PHP | 8.4 |
| Frontend Framework | Next.js | 16 |
| React | React | 19 |
| State Management | TanStack Query | 5 |
| Styling | Tailwind CSS | 4 |
| PHP Tooling | Mago | 1.0 beta |
| JS Tooling | Biome | 2.2 |
| Testing | PHPUnit | 12 |
| Containerization | Docker | - |
- Docker and Docker Compose
- PHP 8.4+ and Composer (for installation)
- (Optional for local development without Docker):
- Node.js 24+ with pnpm
composer create-project luminarix/tempest-nextjs-starter my-project
cd my-project
docker compose up -dgit clone https://github.com/luminarix/tempest-nextjs-starter.git my-project
cd my-project
# Copy environment files
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
# Start with Docker
docker compose up -dThat's it! Your application is now running:
- Frontend: http://localhost:3000
- Backend API: http://localhost
cd backend
# Install dependencies
composer install
# Generate application key
./tempest key:generate
# Start the development server
./tempest serveThe API will be available at http://localhost:8000
cd frontend
# Install dependencies
pnpm install
# Update .env for local backend
echo "API_URL=http://localhost:8000" > .env.local
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" >> .env.local
# Start development server
pnpm run devThe frontend will be available at http://localhost:3000
.
├── backend/ # Tempest PHP API
│ ├── app/
│ │ ├── Api/ # API Controllers
│ │ └── ResponseProcessors/ # Response processors (CORS, etc.)
│ ├── tests/ # PHPUnit tests
│ ├── composer.json
│ ├── phpunit.xml
│ ├── mago.toml # PHP formatter config
│ └── tempest # CLI entrypoint
│
├── frontend/ # Next.js Application
│ ├── src/
│ │ ├── app/ # Pages and layouts (App Router)
│ │ └── lib/ # Utilities, hooks, providers
│ ├── package.json
│ ├── biome.json # Linter/formatter config
│ └── next.config.ts
│
├── docker-compose.yml # Container orchestration
├── Backend.dockerfile
└── Frontend.dockerfile
Run from the tempest container:
| Command | Description |
|---|---|
composer qa |
Run all checks (format, test, lint) |
composer phpunit |
Run tests |
composer fmt |
Format code with Mago |
composer lint |
Lint code with Mago |
./tempest |
Tempest CLI (run with no args for help) |
./tempest serve |
Start development server |
./tempest discovery:status |
Check discovery cache status |
Run from the nextjs container:
| Command | Description |
|---|---|
pnpm qa |
Run all checks (lint, test, build) |
pnpm test |
Run tests with Vitest |
pnpm dev |
Start development server |
pnpm build |
Create production build |
pnpm start |
Run production server |
pnpm lint |
Lint with Biome |
pnpm format |
Format with Biome |
Run from the project root:
| Command | Description |
|---|---|
docker compose up -d |
Start all services |
docker compose down |
Stop all services |
docker compose logs -f |
View logs |
docker compose exec tempest bash |
Shell into backend container |
docker compose exec nextjs sh |
Shell into frontend container |
ENVIRONMENT=local # local, staging, production
BASE_URI=http://localhost:8000
FRONTEND_URL=http://localhost:3000 # CORS allowed originAPI_URL=http://tempest:8080 # Server-side (Docker internal, use localhost if you don't use Docker)
NEXT_PUBLIC_API_URL=http://localhost # Client-side (browser)# Run all tests
docker compose exec tempest composer phpunit
# Run specific test file
docker compose exec tempest ./vendor/bin/phpunit tests/ApiTest.php
# Run specific test method
docker compose exec tempest ./vendor/bin/phpunit --filter testVersionEndpoint# Run all tests
docker compose exec nextjs pnpm test
# Run tests in watch mode
docker compose exec nextjs pnpm test:watchBoth backend and frontend have pre-configured linting and formatting:
# Backend - run all quality checks (format, test, lint)
docker compose exec tempest composer qa
# Frontend - run all quality checks (lint, test, build)
docker compose exec nextjs pnpm qaCORS is handled by CorsResponseProcessor in the backend. To modify allowed origins, update backend/.env:
FRONTEND_URL=http://localhost:3000For multiple origins or more complex CORS rules, modify backend/app/ResponseProcessors/CorsResponseProcessor.php.