This is a simple web application built with React and TypeScript for managing a library's book inventory. It allows users to:
- View a list of books: The application displays a table listing all available books, including their title, author, total copies, and available copies.
- Add new books: Users can add new books to the inventory by providing the title, author, and number of copies.
- Lend books: Users can lend books from the inventory, which decreases the number of available copies.
- Return books: Users can return borrowed books, which increases the number of available copies.
- Delete books: Users can remove books from the inventory.
- Data persistence: The application fetches and updates book data from a backend API (running on
http://localhost:XXXX/api/books
). - Error handling: The application handles potential errors during data fetching and updates, displaying appropriate error messages to the user.
- User feedback: The application provides visual feedback to the user through toast notifications for successful actions and error messages.
- React: A JavaScript library for building user interfaces.
- TypeScript: A superset of JavaScript that adds static typing for improved code quality and maintainability.
- React-toastify: A library for displaying toast notifications.
-
Clone the repository:
git clone https://github.com/angel-hidalgo-source/library-web.git
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Access the application: Open
http://localhost:XXXX/
in your web browser.
Contributions are welcome! Please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.