Skip to content

Loan Management API: A RESTful backend service for creating, reading, updating, and deleting loans. Built with PHP, Laravel, and Docker for easy setup and deployment.

License

Notifications You must be signed in to change notification settings

rahulnayanegali/loan-management-api

Repository files navigation

Loan Management API

A RESTful backend service for creating, reading, updating, and deleting loans. This API allows users to manage loan data, including loan amounts, interest rates, and durations. Built with PHP, Laravel, and Docker for easy setup and deployment.

Prerequisites

  • Docker
  • Docker Compose

Quick Start

  1. Clone the repository:
https://github.com/rahulnayanegali/loan-management-api.git
  1. Copy the example environment file:
cp .env.example .env
  1. Run the setup script:
chmod +x setup.sh
./setup.sh

This script will:

  • Build and start Docker containers
  • Run database migrations
  • Execute tests
  1. Once the setup is complete, the API will be available at http://localhost:8080

  2. Access the API documentation at http://localhost:8080/docs/index.html

API Endpoints

  • GET /api/loans: Retrieve all loans (paginated)
  • POST /api/loans: Create a new loan
  • GET /api/loans/{id}: Retrieve a specific loan
  • PUT /api/loans/{id}: Update a specific loan
  • DELETE /api/loans/{id}: Delete a specific loan
  • POST /api/loans/{id}/payments: Add/Update payment to a specific loan For detailed information on request/response formats, please refer to the API documentation.

Testing

To run tests manually:

docker-compose exec app php artisan test

Stopping the Application

To stop the Docker containers:

docker-compose down

To start the application again:

docker-compose up -d

Troubleshooting

If you encounter any issues:

  1. Ensure all containers are running:
docker-compose ps
  1. Check container logs:
docker-compose logs
  1. Verify database connection:
docker-compose exec app php /var/www/db_test.php

Additional Information

For more detailed information about the Docker setup, please refer to our Docker Setup Documentation.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Loan Management API: A RESTful backend service for creating, reading, updating, and deleting loans. Built with PHP, Laravel, and Docker for easy setup and deployment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published