The "Symfony 5 Api Starter" can be used as the base code to start an API using jwt authentication.
- PHP 7.2 or higher;
- and the usual Symfony application requirements.
Create a directory, and clone the repo in it.
git clone https://github.com/igorbalden/sf5-api.git ./
composer install
Copy ./env
to .env.local
. Edit it, if so needed.
Create a MySql database and run the migration.
If you have installed Symfony binary, run this command:
$ cd my_project/
$ symfony serve -d
Start Docker by
$ cd my_project/
$ docker-compose up -d
Then start the client application to use it,
or query it with a tool like curl or similar.
If you don't have the Symfony binary installed, run php -S localhost:8000 -t public/
to use the built-in PHP web server or configure a web server like Nginx or
Apache to run the application.
Execute this command to run tests:
$ cd my_project/
$ ./bin/phpunit