# Take-Home Assessment MVP RESTful API Project using CodeIgniter 3
This project is a RESTful API developed using the CodeIgniter framework. It provides CRUD (Create, Read, Update, Delete) operations that can be accessed via HTTP requests using tools like Postman. The API is designed to be run locally for development and testing purposes.
## Features
- Developed using CodeIgniter (PHP framework)
- Implements a RESTful API with CRUD operations
- Supports JSON input and output
- Database integration using MySQL
## Prerequisites
Before running this project, ensure you have the following installed:
- [PHP (7.4)](https://www.php.net/downloads.php)
- [MySQL](https://dev.mysql.com/downloads/)
- [Apache](https://httpd.apache.org/download.cgi) or [Nginx](https://nginx.org/en/download.html) server
- [Postman](https://www.postman.com/downloads/) (for API testing)
## Installation
Follow these steps to set up the project locally:
- Clone the Repository ```bash git clone https://github.com/yourusername/your-repository.git cd your-repository
## Configuration
- CodeIgniter Configuration
- Update application/config/config.php (optional): $config['base_url'] = 'http://localhost/your-repository/';
## Database Setup
- Create MySQL Database
- CREATE DATABASE lending_mvp
- Import the provided db.sql file into lending_mvp database
- Update the application/config/database.php file with your local database configuration settings.
## Testing with Postman
- Open Postman and create a new request.
- Set the request type (GET, POST, PUT, DELETE).
- Enter the API endpoint URL (e.g., http://localhost/ha_mvp/create_loan).
- For POST/PUT requests, use the Body tab to send JSON data.
- Click Send and view the response.
## Troubleshooting
- 500 Internal Server Error: Ensure your database credentials are correct in the database.php file.
- 404 Not Found: Check if your base URL is correctly set up in config.php.
- Database Connection Issues: Verify your MySQL server is running.
## License
MIT License
Copyright (c) 2024 Avijit Chakravarty
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.