# Book Search API and React App
## Overview
This repository is structured as a monorepo containing both the backend API and the frontend React application.
### Project Structure
- **Backend (Book Search API)**: Located in the `backend` folder.
- **Frontend (React App)**: Located in the `ui` folder.
## Demo
A live demo of the application is available at: [https://clairvolex.onrender.com/](https://clairvolex.onrender.com/)
**Note**: The server is hosted on a free tier, which incurs a cold start time of approximately 50 seconds.
## Backend (Book Search API)
The Book Search API allows users to search for books based on various criteria such as title, author, published date range, genre, and availability.
### Endpoints
- **/books**: Supports `GET` and `POST` requests to retrieve a list of books based on search criteria.
### Search Criteria
- **Title**: Partial or full match.
- **Author**: Partial or full match.
- **Published Date Range**: Optional.
- **Genre**: Optional.
- **Sort Order**: By title, author, or publication date.
- **Pagination**: Page number and size.
- **Availability**: Filter by in-stock books only.
### Implementation Details
- All business logic is implemented within the route files due to time constraints.
- JWT authorization is not included but can be implemented using middleware.
- Database: MySQL
- ORM: Objection.js
- Migrations and seed data: Knex.js
### Running the Backend
Navigate to the `backend` folder and run the following commands:
```sh
npm install
npm start
The React application provides a user interface to search for books using the Book Search API.
- Search by title, author, and genre.
- Filter by availability.
- Pagination and sorting options.
Navigate to the ui
folder and run the following commands:
npm install
npm start
Test cases and coverage reports are available for both the frontend and backend.
- UI App: https://clairvolex.onrender.com/coverage/ui/
- API: https://clairvolex.onrender.com/coverage/api/
- This project does not include controllers and services due to time constraints. All business logic is written inside route files.
- JWT authorization is not implemented but can be added using middleware.
For any questions or issues, please contact the project maintainers on Email - [email protected] or WA (+91) 9830407236
This `README.md` file provides a comprehensive overview of your project, including the structure, demo link, implementation details, and instructions for running the frontend and backend. It also highlights the testing and coverage information for both the UI and API.