DISCLAIMER
The Sugoi framework is still under heavy development and breaking changes will be introduced.
COMING SOON
No source is available for installing the framework yet, this will be provided once a stable API has been implemented.
Getting started
To get started you simply need to set up a new project using composer with PSR-4 autoloading.
composer init \
--require faylite/sugoi-php=dev-main \
-a src/ --type project \
--name=myproject/api
And that's it! Now you can start your new application by running the sugoi
script.
./vendor/bin/sugoi
Note that there will be no services running by default, once you start adding http endpoints the http server will start, or if you add websocket handlers the websocket server will start, and so on and so forth.
TIP
Sugoi comes with bundled dev tools and can be opened on: http://localhost:4040/
Configuration
Some baseline configuration is always nice to have. The prod
flag turns the dev server on/off, so remember to set it to true when you deploy. As for the application name it's nice to change it so you get the service name in the logs.
Sugoi generates a complete config schema of every single property that you can possibly set in this yaml file, so remember to use it by referencing the schema in the yaml file .sugoi/app.schema.json
and generating the schema using sugoi dump:config
.
app.yml
$schema: .sugoi/app.schema.json
sugoi:
application:
name: my-service-api
prod: true
TIP
You can also override the production flag through the environment using SUGOI_APPLICATION_PROD=true