Giter Club home page Giter Club logo

authentication's Introduction

LUMEN + PASSPORT + DOCKER WITH PHP 8.2

  • This repo uses lumen framework and passport. And it has ready to go authentication module.
  • LUMEN PASSPORT

LOCAL INSTALLATION

  • 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_KEY in env.
  • run composer install to install the dependencies.
  • run php artisan migrate to migrate the tables.
  • run php artisan passport:install to install the passport.

Docker Setup

  • IF YOU CHANGE Anything after the section ## DOCKER_ENV then 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_HOST as auth-database
    • Set DB_PORT whatever you like but make sure it is available and is not used by any other service.
    • You can give anything for DB_DATABASE , DB_USERNAME and DB_PASSWORD.
  • create data and logs folder in root directory.
  • run docker-compose build.
  • run docker-compose up -d.
  • run docker exec AUTH-php82 composer install to run migration.
  • run docker exec AUTH-php82 mkdir storage/framework/sessions create folder.
  • run docker exec AUTH-php82 chmod -R 775 storage for permissions.
  • run docker exec AUTH-php82 chmod -R ugo+rw storage for permissions.
  • run docker exec AUTH-php82 php artisan migrate to run migration.
  • run docker exec AUTH-php82 php artisan passport:install to 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_KEY in env.

NOTE

  • please populate env FRONTEND_ENDPOINTS with your frontend endpoints, for cors issue.

authentication routes

  • {app_url}/register for user registration. Make sure to setup mail settings. (It will send the user verification mail)
  • {app_url}/login to retrieve the user auth token.

authentication's People

Contributors

dev-roshan avatar es-roshanb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

es-roshanb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.