SymfonyWorld2020

Sylius API workshop - initial backend application

Project setup

  1. Install dependencies:

    composer install
  2. Duplicate content of .env to .env.local

    cp .env .env.local
  3. Adjust your configuration in .env.local

  4. Source the configuration file

    source .env.local
  5. Install JWT:

    mkdir -p config/jwt
    openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096 -pass pass:$JWT_PASSPHRASE
    openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout -passin pass:$JWT_PASSPHRASE
    
  6. Setup project:

    bin/console sylius:install -s default -n

Running application

It is recommended to use Symfony binary to run the project. This library can be found here.

Once library is installed, you should install TLS certificate locally

symfony server:ca:install

Then serve application:

symfony serve

Customize configuration

Documentation is available at docs.sylius.com.