Working examples demonstrating core Tipsy features on modern PHP 8.3+.
| Example | Description |
|---|---|
| hello-world | Minimal app — one route, one view |
| rest-api | JSON REST API with GET/POST/PUT/DELETE |
| middleware | Request logging and auth middleware |
| services | Dependency injection with services |
| docker | Production Dockerfile + nginx config |
| vercel | Serverless deploy with vercel-php community runtime |
In-repo composer.json files use a path repository (../../) so examples track this working tree during development.
cd examples/hello-world
# Mirror (copy) the path repo — avoids symlink loops with coverage tools
COMPOSER_MIRROR_PATH_REPOS=1 composer install
php -S localhost:8000 -t webThen open http://localhost:8000.
After tipsyphp/tipsy ^2.0 is on Packagist, production apps should depend on Packagist instead of a path repo:
{
"require": {
"php": ">=8.3",
"tipsyphp/tipsy": "^2.0"
}
}The Vercel example’s path repository will not work on Vercel’s build hosts — publish/require from Packagist first, or vendor the package another way.
# From the repo root:
docker build -f examples/docker/Dockerfile -t tipsy-app .
docker run -p 8080:80 tipsy-appThen open http://localhost:8080.
cd examples/vercel
# Requires tipsyphp/tipsy on Packagist (or adjust composer.json)
npx vercel