Giter VIP home page Giter VIP logo

go-bookstore's Introduction

Go-Bookstore API

Overview

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.

Features

  • 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

Technologies Used

Getting Started

Prerequisites

  • Go 1.16+ installed
  • MySQL installed and running

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/go-bookstore.git
  2. Navigate to the project directory:
    cd go-bookstore
  3. Install dependencies:
    go mod tidy

Database Setup

  1. Create a MySQL database:
    CREATE DATABASE bookstore;
  2. Run the provided SQL script to set up the tables:
    mysql -u yourusername -p bookstore < schema.sql

Configuration

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

API Endpoints

Create a new book

POST /book/

Adds a new book to inventory

Lists all books

GET /book/

Retrieves a list of all books in the library.

View Book Details

GET /book/{bookId}

Retrieves details of a specific book by its ID.

Update Book Status

PUT /book/{bookId}

Updates the status of a book.

Delete a Book

DELETE /book/{bookId}

Removes a book from the inventory.

go-bookstore's People

Contributors

shubham-patel07 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.