Skip to content

Latest commit

 

History

History
71 lines (58 loc) · 1.84 KB

README.md

File metadata and controls

71 lines (58 loc) · 1.84 KB

Kanye quotes generator

Highly scalable, mobile-friendly Laravel platform with authentication, RESTful API, Metronic theme integration, Livewire, comprehensive tests, and more.

Dev Installation

Run image

cd kanye-quotes
composer install
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
cp .env.example .env
npm install && npm run build
sail up -d

alias for sail may be globally exported once -d flag for background running

Seed DB

Note: Docker image must be already running to apply migrations

alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
sail artisan migrate:refresh --seed

Congrats! 🎉 App running on: http://localhost:80 Login using demo:password or sign up

RESTFul API Swagger Docs Available here

Manual RESTFul test

RESTFul Endpoints required a valid user token passed withing header

'Authorization': 'Bearer ' + YOUR_API_TOKEN_HER
'Accept': 'application/json'
  1. Derive auth token for user
sail artisan tinker
$user = App\Models\User::first();
$token = $user->createToken('demo')->plainTextToken;
  1. Then send curl with auth successful
curl -H "Authorization: Bearer YOUR_API_TOKEN_HERE" -H "Accept: application/json" http://localhost/api/kanye/quote

You should see a quote :)

Tests

TODO: Create test .env.testing and test_database for tests phpunit.xml

sail artisan test // all tests
sail artisan test --testsuite=Feature // Feature tests
sail artisan test --testsuite=Unit // Unit tests
sail artisan test --testsuite=Api // Api tests

Requirements

  • Docker 4+
  • Composer 2+
  • PHP 8+

Notes

Might contain some components from mine previous projects to save time