Categorygithub.com/phetployst/book-store-api
modulepackage
0.0.0-20241023095606-b64edb4b6633
Repository: https://github.com/phetployst/book-store-api.git
Documentation: pkg.go.dev

# README

📚 Book Store API

An API for managing a bookstore, built with Go and the Echo framework. This project allows users to browse, create, update, and delete book records.

This project is based on the example-go-api repository. Many concepts and structures were adapted and built upon from this source.

📦️ Packages

go get github.com/DATA-DOG/go-sqlmock
go get github.com/go-playground/validator/v10
go get github.com/google/uuid
go get github.com/labstack/echo/v4
go get github.com/stretchr/testify
go get github.com/swaggo/echo-swagger
go get github.com/swaggo/swag
go get go.uber.org/zap
go get gorm.io/driver/postgres
go get gorm.io/gorm

🚀 Running the Application

  1. To start the application locally:
go run main.go
  1. The API will be running at http://localhost:1323.

Running Tests

To run the test suite:

go test ./...

📚 API Documentation

MethodEndpointDescription
GET/booksGet all books
GET/books/:idGet a specific book
POST/booksAdd a new book
PUT/books/:idUpdate a book
DELETE/books/:idDelete a book

Sample Request

To add a new book:
POST /books
Content-Type: application/json

{
    "title": "Clean Code",
    "author": "Robert C. Martin",
    "isbn": "9780132350884",
}

# Packages

No description provided by the author
No description provided by the author
Package docs Code generated by swaggo/swag.
No description provided by the author
No description provided by the author