- This repo uses lumen framework and passport. And it has ready to go authentication module.
- LUMEN PASSPORT
- clone the repo
- copy env.example as .env and populate the settings. ( you do not need to worry about the variable below ## DOCKER_ENV i.e for docker )
- lumen does not have key:generate feature, so there is api {app_url}/key to generate, visit that and paste the key to
APP_KEYin env. - run
composer installto install the dependencies. - run
php artisan migrateto migrate the tables. - run
php artisan passport:installto install the passport.
- IF YOU CHANGE Anything after the section
## DOCKER_ENVthen it is up to you to setup everything. - IF YOU DO NOT CHANGE and copy as it is from .env.example, Env setup:
- Set
DB_HOSTasauth-database - Set
DB_PORTwhatever you like but make sure it is available and is not used by any other service. - You can give anything for
DB_DATABASE,DB_USERNAMEandDB_PASSWORD.
- Set
- create
dataandlogsfolder in root directory. - run
docker-compose build. - run
docker-compose up -d. - run
docker exec AUTH-php82 composer installto run migration. - run
docker exec AUTH-php82 mkdir storage/framework/sessionscreate folder. - run
docker exec AUTH-php82 chmod -R 775 storagefor permissions. - run
docker exec AUTH-php82 chmod -R ugo+rw storagefor permissions. - run
docker exec AUTH-php82 php artisan migrateto run migration. - run
docker exec AUTH-php82 php artisan passport:installto install passport. - lumen does not have key:generate feature, so there is api localhost:8099/key to generate, visit that and paste the key to
APP_KEYin env.
- please populate env
FRONTEND_ENDPOINTSwith your frontend endpoints, for cors issue.
{app_url}/registerfor user registration. Make sure to setup mail settings. (It will send the user verification mail){app_url}/loginto retrieve the user auth token.