Coder Social home page Coder Social logo

books-server's Introduction

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.

books-server's People

Contributors

probablyarth 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.