This repository contains the solutions to apex network backend developer assessment role.
This guide assumed you have PHP 8.2+ and Composer installed on your pc.
Clone this repository and navigate into it:
git clone [email protected]:iamolayemi/apex-network-assessment.git
cd apex-network-assessment
Install the application dependencies by running the following command:
composer install
Copy the contents of the .env.example
file into a new .env
file by running the following command:
cp .env.example .env
Generate a new application key by running the following command:
php artisan key:generate
You can use SQLite for the database by default. If you want to use another database, update the database configuration in the .env
file.
Create a new SQLite database by running the following command:
touch database/database.sqlite
Run the database migrations to create the necessary tables by running the following command:
php artisan migrate
Seed the database with dummy data by running the following command:
php artisan db:seed
- To set up passport oauth keys run the following command:
php artisan passport:keys
- Next, you need to setup the Laravel Passport personal access token clients by running the following command:
php artisan passport:client --personal
After running the command, you will be prompted to enter the client name. You can enter any name you want.
Then copy the client id and client secret generated and update the PASSPORT_PERSONAL_ACCESS_CLIENT_ID
and PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET
in the .env
file.
Start the application by running the following command:
php artisan serve
The application should now be running and accessible at http://localhost:8000 in your web browser. You can access the API documentation at http://localhost:8000/docs.
You can use the following credentials to test the application:
- Email: [email protected]
- Password: Password123!
- Email: [email protected]
- Password: Password123!
To run tests for the application you can use this command:
php artisan test
# To run tests with coverage
php artisan test --coverage