Skip to content

phuclh/voting

 
 

Repository files navigation

Voting App

Demo: https://voting.deknot.io

Installation

  1. Clone the repo and cd into it
  2. composer install
  3. Rename or copy .env.example file to .env
  4. php artisan key:generate
  5. Setup a database and add your database credentials in your .env file
  6. php artisan migrate or php artisan migrate --seed if you want seed data
  7. npm install
  8. npm run dev or npm run watch
  9. php artisan serve or use Laravel Valet
  10. Visit localhost:8000 in your browser
  11. Access Nova via /admin

Setup Login With DeKnot

  1. Install Laravel Passport in Oauth Server application: https://laravel.com/docs/8.x/passport
  2. Create Passport Client via: php artisan passport:client (Read more about Requesting Tokens process: https://laravel.com/docs/8.x/passport#requesting-tokens)
  3. Add these env variables into your voting app .env
DEKNOT_CLIENT_ID=1 // Client ID in oauth_clients table of your Oauth Server application.
DEKNOT_CLIENT_SECRET= // Secret in oauth_clients table of your Oauth Server application.
DEKNOT_CLIENT_REDIRECT=http://voting.test/deknot/auth/callback // Callback URL of the voting application.
DEKNOT_PASSPORT_SERVER=http://gp.test // Oauth Server application URL
  1. Make sure your api.php is using Passport (auth:api):
Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Voting app will make a request to that route to get the user information of you Saas app.

  1. Customize (Optional)
App\Oauth\DeKnotProvider.php
App\Http\Controllers\Auth\LoginWithDeKnotController.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 72.8%
  • Blade 27.0%
  • Shell 0.2%