1- ## Awesome Skeleton for modern development on PHP 7.3+
1+ ## Awesome Skeleton for modern development on PHP 7.4+ (incl. PHP 8)
22
3- [ ![ Build Status] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/badges/build.png?b=master )] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/build-status/master )
3+ > Contains quality tested packages, thoughtful structure and everything you need to develop microservices.
4+
5+ [ ![ Build Status] ( https://circleci.com/gh/sunrise-php/awesome-skeleton.svg?style=shield )] ( https://circleci.com/gh/sunrise-php/awesome-skeleton )
46[ ![ Code Coverage] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/badges/coverage.png?b=master )] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/?branch=master )
57[ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/sunrise-php/awesome-skeleton/?branch=master )
68[ ![ Total Downloads] ( https://poser.pugx.org/sunrise/awesome-skeleton/downloads?format=flat )] ( https://packagist.org/packages/sunrise/awesome-skeleton )
1517composer create-project ' sunrise/awesome-skeleton:^3.0' app
1618```
1719
20+ ## Cooking
21+
22+ Set up your database connection:
23+
24+ ``` bash
25+ cp .env.example .env && nano .env
26+ ```
27+
28+ Execute a migration:
29+
30+ ``` bash
31+ php bin/app migrations:migrate --service ' master' --no-interaction
32+ ```
33+
1834## Run CLI
1935
20- > including : Doctrine DBAL, Doctrine ORM, Doctrine Migrations.
36+ > incl. : Doctrine DBAL, Doctrine ORM, Doctrine Migrations.
2137
2238``` bash
2339php bin/app
@@ -35,10 +51,22 @@ composer serve
3551
3652> listen 0.0.0.0:3000
3753
54+ Set up your server:
55+
56+ ``` bash
57+ cp .rr.yml.example .rr.yml && nano .rr.yml
58+ ```
59+
60+ Run the server:
61+
3862``` bash
3963rr -dv serve
4064```
4165
66+ ## Run via Swoole
67+
68+ > Coming soon...
69+
4270## Run tests
4371
4472``` bash
@@ -53,9 +81,81 @@ composer bench
5381
5482---
5583
84+ ## Run routes through cURL
85+
86+ > you may need to change the server address...
87+
88+ #### Home (index)
89+
90+ ``` bash
91+ curl -X ' GET' ' http://127.0.0.1:3000/'
92+ ```
93+
94+ #### OpenAPI document
95+
96+ ``` bash
97+ curl -X ' GET' ' http://127.0.0.1:3000/openapi'
98+ ```
99+
100+ #### Create an entry (example bundle)
101+
102+ ``` bash
103+ curl -X ' POST' -H ' Content-Type: application/json' -d ' {"name": "foo", "slug": "foo"}' ' http://127.0.0.1:3000/api/v1/entry'
104+ ```
105+
106+ #### Update an existing entry (example bundle)
107+
108+ > you need to set an existing ID.
109+
110+ ``` bash
111+ curl -X ' PATCH' -H ' Content-Type: application/json' -d ' {"name": "foo", "slug": "foo"}' ' http://127.0.0.1:3000/api/v1/entry/b06fd41d-d131-4bb9-a472-eb583369437c'
112+ ```
113+
114+ #### Delete an existing entry (example bundle)
115+
116+ > you need to set an existing ID.
117+
118+ ``` bash
119+ curl -X ' DELETE' ' http://127.0.0.1:3000/api/v1/entry/b06fd41d-d131-4bb9-a472-eb583369437c'
120+ ```
121+
122+ #### Read an existing entry (example bundle)
123+
124+ > you need to set an existing ID.
125+
126+ ``` bash
127+ curl -X ' GET' ' http://127.0.0.1:3000/api/v1/entry/b06fd41d-d131-4bb9-a472-eb583369437c'
128+ ```
129+
130+ #### List of entries (example bundle)
131+
132+ ``` bash
133+ curl -X ' GET' ' http://127.0.0.1:3000/api/v1/entry'
134+ ```
135+
136+ ---
137+
56138## Useful commands
57139
58- #### Generate Systemd unit file for RoadRunner
140+ #### Deploy
141+
142+ ``` bash
143+ bash bin/deploy
144+ ```
145+
146+ #### Down
147+
148+ ``` bash
149+ bash bin/down ' Reason...'
150+ ```
151+
152+ #### Up
153+
154+ ``` bash
155+ bash bin/up
156+ ```
157+
158+ #### Generate Systemd unit for RoadRunner
59159
60160``` bash
61161php bin/app app:roadrunner:generate-systemd-unit > app.service
@@ -64,24 +164,23 @@ php bin/app app:roadrunner:generate-systemd-unit > app.service
64164#### Generate OpenApi document
65165
66166``` bash
67- php bin/app app:openapi:generate-documentation --pretty > openapi.json
167+ php bin/app app:openapi:generate-document > openapi.json
68168```
69169
70170---
71171
72172## Used stack
73173
174+ > see composer.json
175+
74176* https://github.com/PHP-DI/PHP-DI
75177* https://github.com/Seldaek/monolog
76178* https://github.com/sunrise-php/http-router
77179* https://github.com/doctrine/orm
78180* https://github.com/doctrine/migrations
79181* https://github.com/symfony/console
80182* https://github.com/symfony/validator
81- * https://github.com/neomerx/cors-psr7
82183* https://github.com/justinrainbow/json-schema
83- * https://github.com/filp/whoops
84- * https://github.com/twigphp/Twig
85184
86185## Used technology
87186
0 commit comments