Skip to content

alifruliarso/simpleloan

Repository files navigation

Simple Loan REST API

This project provides the following function:

  1. Create User/Admin
  2. Login User/Admin
  3. Create a loan by User
  4. Approve a loan by Admin
  5. Pay the loan through scheduled payment

Setup local development

Clone the project

  • git clone https://github.com/alifruliarso/simpleloan.git
    cd simpleloan

Setup environment variable.

  • Default api url : http://localhost:8000/api/
  • MySQL can be accessed from host using port 33066, user=root with empty password
  • For using different port, change it inside application's .env file
    APP_PORT=8000
    FORWARD_DB_PORT=33066
    

Install With Docker (Sail).

  • Run the following command :

    cd simpleloan
    cp .env.sample .env
    make dev

Install Without Docker

  1. Change the directory, and Install the dependencies:

    cd simpleloan
    cp .env.sample .env
    composer install
  2. Generate application key:

    php artisan key:generate
  3. Run database migration with seeder:

    php artisan migrate --seed
  4. Start the local server:

    php artisan serve

Features

API Documentation

Code style and lint using Laravel Pint

./vendor/bin/pint

Running the Test.

php artisan test

To generate the OpenAPI Specification file, run command:

composer openapi

docker-compose Commands

sail up        Start the application
sail up -d     Start the application in the background
sail stop      Stop the application
sail restart   Restart the application
sail ps        Display the status of all containers

Demo User Credentials

Email: john@example.com
Password: 123456

Demo Admin Credentials

Email: root@admin.com
Password: 123456

Credits

This starter kit is inspired by the project Pandora, laravel-makefile.

Releases

No releases published

Packages

No packages published

Languages