allandereal / dfcu-loans-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DFCU Loans API

This document describes how to set up and test run the outstanding loans API.

  • To see and test how the API works, please visit the docs page after starting the application

Tech Stack

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)

Setup and running the project

Tasks and the respective commands

  1. Clone the repository
    git clone git@github.com:allandereal/dfcu-loans-api.git
  2. Move into the dfcu-loans-api directory
    cd dfcu-loans-api
  3. Install composer dependencies
    composer install
  4. Install javascript dependencies with npm
    npm install
  5. Copy the .env file from the .env.example file
    cp .env.example .env
  6. Generate the application key
    php artisan key generate
  7. Run migrations (update the database settings in the .env file first by setting the database, username and password)
    php artisan migrate
  8. Seed the database if you want to generate test data
    php artisan db:seed
  9. Start the development server at http://127.0.0.1:8000
    php artisan serve

Running Tests

Copy .env.testing file from .env and update database parameters to the testing database
cp .env.example .env.testing
Run php artisan test

User Interfaces

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: admin@api.dfcubank.com, password: password

Test account numbers and their responses (this works after running `php artisan db:seed``)

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

Simulating the API

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.

Screenshots

Admin dashboard

Dark Theme admin dashboard dark

Light Theme
admin dashboard light

API Docs

api docs

Developers

About


Languages

Language:PHP 46.4%Language:Blade 36.5%Language:CSS 7.2%Language:JavaScript 5.1%Language:HTML 4.8%