Minimal JWT-auth starter based on Symfony 7.3, PHP 8.4+, LexikJWTAuthenticationBundle 3.x and Gesdinet JWT Refresh Token Bundle.
- Backend: Symfony 7.3, PHP 8.4+
- Security: LexikJWTAuthenticationBundle, Gesdinet JWT Refresh Token Bundle
- DB / Web: MariaDB 11.4, Nginx (via Docker)
docker compose up --buildAPI: http://127.0.0.1:8080.
- POST
/auth/sign-up– register user - POST
/api/login– get access + refresh tokens - POST
/api/token/refresh– refresh access token - GET
/api/user– current user (JWT required) - PATCH
/api/user– admin-only (JWT +ROLE_ADMIN, user with this role must be created manually)
# default database
docker compose exec php php bin/console doctrine:database:create
docker compose exec php php bin/console doctrine:migrations:migrate
# test database (APP_ENV=test)
docker compose exec php php bin/console --env=test doctrine:database:create
docker compose exec php php bin/console --env=test doctrine:migrations:migrate
# cache and tests
docker compose exec php php bin/console cache:clear
# create test db before
docker compose exec php ./vendor/bin/phpunit ds