Skip to content

The Book Management System is a web application built using the Gin framework in Go. It allows users to perform various operations related to managing a collection of books, such as viewing all books, adding new books, retrieving book details by ID, checking out books, and returning books.

Notifications You must be signed in to change notification settings

Shreyank031/Book-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Management System

A simple RESTful API for managing a collection of books written in Go.

Gin Framework

Gin is a web framework written in Go (or Golang) which is known for its minimalistic design and high performance. It's commonly used for building web applications and RESTful APIs due to its fast routing and processing capabilities.

Usage

Once the application is running, you can interact with it using HTTP requests. Here are the available endpoints:

  • GET /books: Retrieve all books.
  • POST /books: Add a new book to the collection.
  • GET /books/:id: Retrieve details of a specific book by its ID.
  • PATCH /checkout?id=:id: Check out a book by its ID.
  • PATCH /return?id=:id: Return a book by its ID.

Clone this Repo:

git clone https://github.com/Shreyank031/Book-Management-System.git

Run the main.go file

  go run main.go
  • Retrieve all books: GET /books

    curl localhost:8080/books
  • Add a new book : POST /books

    curl localhost:8080/books --include --header "Content-Type: application/json" -d @<file_name_json> --request "POST"
  • Retrieve details of a specific book: GET /books/:id

    curl localhost:8080/books/1 
  • Check out a book: PATCH /checkout?id=:id

    curl 'localhost:8080/checkout?id=1' --request "PATCH"
  • Return a book: PATCH /return?id=:id

    curl 'localhost:8080/return?id=1' --request "PATCH"

    Preview of different endpoints

    Terminal Output image

About

The Book Management System is a web application built using the Gin framework in Go. It allows users to perform various operations related to managing a collection of books, such as viewing all books, adding new books, retrieving book details by ID, checking out books, and returning books.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages