chubbyphp/petstore

A simple skeleton to build api's based on the chubbyphp-framework.

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 25

Watchers: 3

Forks: 2

Open Issues: 0

Type:project


README

Build Status Coverage Status

Description

A simple skeleton to build api's based on the chubbyphp-framework.

Requirements

Environment

Add the following environment variable to your system, for example within ~./bash_aliases:

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

Docker

docker-compose up -d
docker-compose exec php bash

Urls

DBs

  • jdbc:postgresql://localhost:15432/petstore?user=root&password=root

Installation

Through Composer as chubbyphp/petstore.

composer create-project chubbyphp/petstore myproject "dev-chubbyphp-framework"

Setup

composer setup:dev

Structure

Collection

Collections are sortable, filterable paginated lists of models.

Config

Enviroment based configurations, dev, phpunit, prod. Credentials where used fom enviroment variables.

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.

Factory

Factories to create collections, model or whatever you need to be created.

Mapping

Mappings are used for deserialization, orm, serialization and validation defintions. They are all done in PHP.

Model

Models, entities, documents what ever fits your purpose the best.

Repository

Repositories get data from storages like databases, elasticsearch, redis or whereever your models are stored or cached.

ServiceFactory

Service factories are the glue code of the dependeny injection container.

Copyright

Dominik Zogg 2020