Go-Bookstore API is a robust and efficient API designed for managing a library's book inventory. It supports operations to fetch, view, and update the list and status of books, facilitating seamless integration for library management systems.
- Fetch a list of all books available in the library
- View details of a specific book
- Update the status of a book (e.g., available, checked out, reserved)
- Add new books to the inventory
- Remove books from the inventory
- Programming Language: Go (Golang)
- Database: MySQL
- API Architecture: RESTful
- Dependencies:
- Go 1.16+ installed
- MySQL installed and running
- Clone the repository:
git clone https://github.com/yourusername/go-bookstore.git
- Navigate to the project directory:
cd go-bookstore
- Install dependencies:
go mod tidy
- Create a MySQL database:
CREATE DATABASE bookstore;
- Run the provided SQL script to set up the tables:
mysql -u yourusername -p bookstore < schema.sql
Create a .env
file in the project root with the following environment variables:
DB_HOST=localhost
DB_PORT=3306
DB_USER=yourusername
DB_PASSWORD=yourpassword
DB_NAME=bookstore
POST /book/
Adds a new book to inventory
GET /book/
Retrieves a list of all books in the library.
GET /book/{bookId}
Retrieves details of a specific book by its ID.
PUT /book/{bookId}
Updates the status of a book.
DELETE /book/{bookId}
Removes a book from the inventory.