This is a simple api that enables users to register, login and view their profile details. An admin is also able to login into their dashboard and view the list of registered users and their particular details
Follow through the following steps setting up the application on your local development environment
git clone https://github.com/odera-dickens/pesakit.git <your_preffered_app_name>
cd <your_preffered_app_name>
composer install
cp .env.example .env
Create a database at your local db server then at the created .env file, add the following
DB_DATABASE=<your_new_db>
php artisan:key generate
php artisan migrate
php artisan db:seed (to create an admin user)
npm install
npm run dev
This project uses Laravel Passport for the API Authentication
To create client access tokens for accessing the api endpoints when testing, run the following command
php artisan passport:install
METHOD: POST
Endpoint: /api/v1/user/register
Params:
1. name (required)
2. email (required)
3. phone (required)
4. password (required)
5. password_confirmation (required)
METHOD : POST
Endpoint: /api/v1/user/login
Params:
1. email (required)
2. password (required)
METHOD : POST
Endpoint: /api/v1/user/logout
Params:
1. Bearer-Token
METHOD : GET
Endpoint: /api/v1/user/profile
Params:
1. Bearer-Token
Sample Admin Account : { email: [email protected], password: password }
/login
/admin/dashboard
/admin/users
/admin/users/{user}/profile
/login
/user/dashboard
In order to effectively test the api, ensure you have Postman installed on your machine
php artisan test (to run all the tests)
php artisan test --filter=<test_name> (check tests/Feature/Api/UserAuthenticationTest)