thibaut-decherit / symfony-react-api-platform

Application coded during this course: https://learn.web-develop.me/courses/developpement-moderne-avec-apiplatform-symfony-et-react. I deviated from the course quite a lot to add more features and explore server side rendering with Limenius/ReactBundle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Symfony 4 React API Platform

Application coded during this course.
I deviated from the course quite a lot to add more features and explore server side rendering with Limenius/ReactBundle.

Setup

Install dependencies

composer install yarn

Create .env.local (see .env.your_env.local.dist)

Customize all empty variables.

If you use MariaDB, DB_VERSION should start with mariadb- then the version number, else only specifying the version number should suffice.

Setup LexikJWTAuthenticationBundle

php bin/console lexik:jwt:generate-keypair

Setup database

php bin/console doctrine:database:create php bin/console doctrine:migration:migrate

Run in dev env

Run in dedicated terminals:

  • symfony server:start
  • yarn encore:dev
  • yarn encore:dev:serverside
  • node renderingExternalServer.js

Deployment

You may need to add export PATH=$PATH:/home/{user}/.nvm/versions/node/{version}/bin (replace {user} and {version}) to /etc/apache2/envvars, so the SSR bundle is able to run JS server side.

pm2 start renderingExternalServer.js --name symfony-react-api-platform-rendering pm2 save

About

Application coded during this course: https://learn.web-develop.me/courses/developpement-moderne-avec-apiplatform-symfony-et-react. I deviated from the course quite a lot to add more features and explore server side rendering with Limenius/ReactBundle.

License:MIT License


Languages

Language:PHP 54.8%Language:TypeScript 42.0%Language:JavaScript 2.4%Language:SCSS 0.4%Language:Twig 0.3%