books-server

command module
v0.0.0-...-8c37d1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 5 Imported by: 0

README

Booky Backend Service

Booky is a simple backend service built with Go, Gorm, and SQLite, providing an API for sharing and borrowing books.

Project Structure

.
├── controllers/
│   └── book_controller.go
├── types/
│   ├── book.go
│   └── borrow.go
└── main.go

API Endpoints

  • Add a Book for Sharing

    POST /api/v1/booky/
    
    {
        "name": "The Book Title"
    }
    
  • Browse Books

    GET /api/v1/booky/
    
  • List Borrows

    GET /api/v1/borrow/
    
  • Borrow a Book

    POST /api/v1/booky/{book_id}/borrow
    
    {
        "borrow_start_time": "2023-01-01T10:00:00Z",
        "borrow_end_time": "2023-01-10T18:00:00Z"
    }
    
  • Return a Borrowed Book

    PUT /api/v1/booky/{book_id}/borrow/{borrow_id}
    

Setup

Install Go dependencies:
go get -u gorm.io/gorm
go get -u gorm.io/driver/sqlite
go get -u github.com/gin-gonic/gin
Run the application:
go run main.go

By default, the server will be running on http://localhost:8000.

Author

probablyarth

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL