Libry API is a simple REST API that allows people to borrow books from a library. This project is made with Go. It is created as an exercise in the Go phase of the Backend Development Training.
- View list of users & their currently borrowed books.
- Add a new user.
- View list of books.
- Add a new book.
- View list of borrowed books.
- Borrow a book.
- Return a book.
There are 3 entities: Book, User, & Borrow.
Book
- id:
string
- title:
string
- author:
string
User
- id:
string
- username:
string
- books:
[]*Book
Borrow
- id:
string
- user_id:
string
- book_id:
string
- start_date:
timestamp
- end_date:
timestamp
- status:
string
-
Make sure you have Go installed on your computer.
-
Clone the repo.
git clone https://github.com/nadiannis/libry-api.git
cd libry-api
-
Install the dependencies.
go mod tidy
-
Run the server. The web server will run on port 8080.
go run ./cmd