chubbyphp / petstore
A simple skeleton to build api's based on the chubbyphp-framework.
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 38
Watchers: 2
Forks: 6
Open Issues: 0
pkg:composer/chubbyphp/petstore
Requires
- php: ^8.3
- chubbyphp/chubbyphp-clean-directories: ^1.5
- chubbyphp/chubbyphp-cors: ^1.7
- chubbyphp/chubbyphp-decode-encode: ^1.3
- chubbyphp/chubbyphp-framework: ^6.0
- chubbyphp/chubbyphp-framework-router-fastroute: ^2.3
- chubbyphp/chubbyphp-http-exception: ^1.3
- chubbyphp/chubbyphp-laminas-config: ^1.5
- chubbyphp/chubbyphp-laminas-config-doctrine: ^3.1
- chubbyphp/chubbyphp-laminas-config-factory: ^1.5
- chubbyphp/chubbyphp-negotiation: ^2.3
- chubbyphp/chubbyphp-parsing: ^2.1
- doctrine/orm: ^3.5.8
- monolog/monolog: ^3.9
- ramsey/uuid: ^4.9.1
- slim/psr7: ^1.8
- symfony/console: ^7.4.1|^8.0.1
- symfony/var-exporter: ^7.4.0
Requires (Dev)
- chubbyphp/chubbyphp-dev-helper: dev-master
- chubbyphp/chubbyphp-mock: ^2.1
- dg/bypass-finals: ^1.9
- infection/infection: ^0.31.9
- php-coveralls/php-coveralls: ^2.9
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.1.33
- phpunit/phpunit: ^12.5
This package is auto-updated.
Last update: 2026-01-12 19:45:39 UTC
README
Description
A simple skeleton to build api's based on the chubbyphp-framework.
Requirements
- php: ^8.3
- chubbyphp/chubbyphp-clean-directories: ^1.5
- chubbyphp/chubbyphp-cors: ^1.7
- chubbyphp/chubbyphp-decode-encode: ^1.3
- chubbyphp/chubbyphp-framework: ^6.0
- chubbyphp/chubbyphp-framework-router-fastroute: ^2.3
- chubbyphp/chubbyphp-http-exception: ^1.3
- chubbyphp/chubbyphp-laminas-config: ^1.5
- chubbyphp/chubbyphp-laminas-config-doctrine: ^3.1
- chubbyphp/chubbyphp-laminas-config-factory: ^1.5
- chubbyphp/chubbyphp-negotiation: ^2.3
- chubbyphp/chubbyphp-parsing: ^2.1
- doctrine/orm: ^3.5.8
- monolog/monolog: ^3.9
- ramsey/uuid: ^4.9.1
- slim/psr7: ^1.8
- symfony/console: ^7.4.1|^8.0.1
- symfony/var-exporter: ^7.4.0
Environment
Add the following environment variable to your system, for example within ~/.bashrc or ~/.zshrc:
export USER_ID=$(id -u) export GROUP_ID=$(id -g)
Make sure all the mount points are given
touch ~/.bash_docker touch ~/.bash_history
touch ~/.gitconfig touch ~/.gitignore
mkdir -p ~/.local/share/opencode [ ! -f ~/.local/share/opencode/auth.json ] && echo '{}' > ~/.local/share/opencode/auth.json
touch ~/.zsh_docker touch ~/.zsh_history
Docker
docker-compose up -d
docker-compose exec php bash
Setup
composer install composer setup:dev
Urls
Pet
- GET https://localhost/api/pets?sort[name]=asc
- POST https://localhost/api/pets
- GET https://localhost/api/pets/8ba9661b-ba7f-436b-bd25-c0606f911f7d
- PUT https://localhost/api/pets/8ba9661b-ba7f-436b-bd25-c0606f911f7d
- DELETE https://localhost/api/pets/8ba9661b-ba7f-436b-bd25-c0606f911f7d
DBs
- jdbc:postgresql://localhost:5432/petstore?user=root&password=root
Structure
Collection
Collections are sortable, filterable paginated lists of models.
Dto
A DTO, or Data Transfer Object, is a simple object used to transport data between software application components.
Middleware
Middleware functions can execute code, make changes to the request and response objects. Middleware can generally be added globally or on a per-route basis.
Model
Models, entities, documents what ever fits your purpose the best.
ORM
ORM Mapping definitions.
Parsing
Parses and validates data against predefined schemas, ensuring that incoming data conforms to expected structures and criteria.
Repository
Repositories get data from storages like databases, elasticsearch, redis or whereever your models are stored or cached.
RequestHandler
RequestHandler alias Controller, or Controller actions to be more precise. There is a directory with generic crud controllers. If you like the idea adapt them for your generic use case, if not drop them. I highly recommend to not extend them.
ServiceFactory
Service factories are the glue code of the dependeny injection container.
Opensearch
Policy to delete logstash formatted indicies after 14 days.
curl -XPUT 'https://admin:98T722Eqw99oqFCSJCnB@localhost:9200/_plugins/_ism/policies/logstash-policy' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ "policy": { "description": "Logstash", "default_state": "hot", "states": [ { "name": "hot", "actions": [], "transitions": [ { "state_name": "delete", "conditions": { "min_index_age": "14d" } } ] }, { "name": "delete", "actions": [ { "delete": {} } ] } ], "ism_template": { "index_patterns" : ["logstash-*"], "priority": 100 } } }' \ --insecure
Copyright
2026 Dominik Zogg