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.
- Docker
- Docker Compose
- Clone the repository:
https://github.com/rahulnayanegali/loan-management-api.git
- Copy the example environment file:
cp .env.example .env
- Run the setup script:
chmod +x setup.sh
./setup.sh
This script will:
- Build and start Docker containers
- Run database migrations
- Execute tests
-
Once the setup is complete, the API will be available at
http://localhost:8080
-
Access the API documentation at
http://localhost:8080/docs/index.html
GET /api/loans
: Retrieve all loans (paginated)POST /api/loans
: Create a new loanGET /api/loans/{id}
: Retrieve a specific loanPUT /api/loans/{id}
: Update a specific loanDELETE /api/loans/{id}
: Delete a specific loanPOST /api/loans/{id}/payments
: Add/Update payment to a specific loan For detailed information on request/response formats, please refer to the API documentation.
To run tests manually:
docker-compose exec app php artisan test
To stop the Docker containers:
docker-compose down
To start the application again:
docker-compose up -d
If you encounter any issues:
- Ensure all containers are running:
docker-compose ps
- Check container logs:
docker-compose logs
- Verify database connection:
docker-compose exec app php /var/www/db_test.php
For more detailed information about the Docker setup, please refer to our Docker Setup Documentation.
This project is licensed under the MIT License - see the LICENSE.md file for details.