phoneburner / pinch-template
The Pinch Application Template
Requires
- php: ^8.4
- phoneburner/api-handler: ^1.0.1
- phoneburner/composer-replacements: ^1.0.0
- phoneburner/http-tortilla: ^2.0.0
- phoneburner/link-tortilla: ^1.0.0
- phoneburner/pinch-component: ^0.0.17
- phoneburner/pinch-core: ^0.0.17
- phoneburner/pinch-framework: ^0.0.17
Requires (Dev)
- behat/behat: ^3.23.0
- brianium/paratest: ^7.11
- eventsauce/test-utilities: dev-main
- league/openapi-psr7-validator: ^0.22.0
- phoneburner/coding-standard: ^1.0.0
- phoneburner/pinch-phpstan: ^0.0.17
- php-parallel-lint/php-parallel-lint: ^1.4
- phpunit/phpunit: ^12.2.7
- rector/rector: ^2.1.2
- roave/security-advisories: dev-latest
- symfony/var-dumper: ^7.3.1
README
Note: This repository is a read-only subtree split of the Pinch Framework monorepo. Please submit issues and pull requests to the main repository.
About
The Pinch Template package provides a complete application starter template for building REST APIs with the Pinch Framework. This opinionated template includes pre-configured Docker setup, database migrations, testing infrastructure, and example implementations following the framework's type-safe, API-first philosophy.
Quick Start
Create a New Project
composer create-project phoneburner/pinch-template my-api
cd my-api
Initial Setup
-
Configure Environment
cp .env.dist .env # Edit .env with your configuration
-
Build Docker Images and Install Dependencies
make
-
Start Docker Services
docker compose up -d
-
Run Database Migrations
docker compose run --rm php pinch migrations:migrate
-
Verify Installation
curl http://localhost:8080/
Project Overview
my-api/
├── bin/ # Console commands
├── config/ # Configuration files
├── database/ # Database migrations
├── public/ # Web root
├── src/ # Application source code
├── tests/ # Test suites
├── storage/ # Cache and logs
├── .env.dist # Environment template
├── composer.json # Project Composer dependencies
├── compose.yaml # Docker Compose configuration
├── Makefile # Development commands
└── openapi.yaml # API specification
Development
Common Commands
# Run tests make test # Code quality checks make lint make phpstan
Documentation
Troubleshooting
Common Issues
Docker services not starting:
docker compose down -v docker compose up -d
Permission issues:
docker compose exec php chown -R www-data:www-data var/
Database connection errors:
- Verify
.env
database settings - Check Docker network:
docker compose ps
- Verify database service:
docker compose logs db
Contributing
This is a read-only repository. To contribute:
- Visit the main repository
- Submit issues and pull requests there
- Follow the contribution guidelines in the main repository
License
The Pinch Framework is open-source software licensed under the MIT license.