- To see and test how the API works, please visit the docs page after starting the application
This API is built using the following languages and tools
- Backend: PHP >= 8.1 (Laravel Framework >= 10.2)
- Database: MySQL
- Package Managers: npm >= 6.14 with NodeJS >= 14.21, composer >= 2.0
- Frontend: Javascript & CSS (Tailwind CSS >= 3.1)
Tasks and the respective commands
- Clone the repository
git clone [email protected]:allandereal/dfcu-loans-api.git
- Move into the
dfcu-loans-api
directory
cd dfcu-loans-api
- Install composer dependencies
composer install
- Install javascript dependencies with
npm
npm install
- Copy the
.env
file from the.env.example file
cp .env.example .env
- Generate the application key
php artisan key generate
- Run migrations (update the database settings in the
.env
file first by setting the database, username and password)
php artisan migrate
- Seed the database if you want to generate test data
php artisan db:seed
- Start the development server at http://127.0.0.1:8000
php artisan serve
Copy .env.testing
file from .env
and update database parameters to the testing database
cp .env.example .env.testing
Run php artisan test
1. API performance Dashboard http://127.0.0.1:8000/dashboard
You are required to be authenticated to view this dashboard.
You can use the following credentials generated by the php artisan db:seed
command
email: [email protected]
, password: password
1000000001 => Returns outstanding loans 1000000002 => Return no outstanding loan
2. API Documentation http://127.0.0.1:8000/docs
To test run the API, you will need an access token that can be generated on the admin dashboard
A command that takes sample account numbers and runs them through the API endpoint.
A text file containing the API endpoint simulation results is saved in the public folder in the format
loans-api-simulation-*.txt
on completion.
Please use the command php artisan loan:simulate
to execute this.
- Allan Ahumuza
Github: @allandereal
Email: [email protected]