Skip to content

pjsalita/bread

Repository files navigation

Basic API with Authentication

Direction: Implement an [or a set of] API that can do Browse, Read, Edit, Add, Delete (BREAD) operations against a sql database table.

Used:

  • Lumen
  • JWT for authentication

Setup:

  1. Clone Repository
    $ git clone https://github.com/pjsalita/bread.git
  2. Change directory and install dependencies
    $ cd bread
    $ composer install
  3. Create .env file and update APP_KEY to random string 32 characters string
    $ cp .env.example .env
  4. Create database.sqlite file under database folder
    $ touch database/database.sqlite
    
  5. Run migrations and seeders
    $ php artisan migrate --seed
    
  6. Generate jwt secret
    $ php artisan jwt:secret
    
  7. Serve
    $ php -S localhost:8000 -t public
    

Note: Make sure php-sqlite extension is installed/enabled.

Seeded user(to skip registration for testing):

  • Username: sample
  • Password: password

Endpoints:

About

Basic API with Authentication - Lumen

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published