share_book
A Web API which facilitates effortless book sharing.
Tech Stack:-
go(Programming Language.)
go-Fiber(go backend framework)
SQLite(Database)
GORM(Object Relation Mapper)
share_book uses the power of go-Fiber to build a clean API. For Storage share_book uses SQLite.
Requirements:-
go > v1.16.4
go-Fiber/v2 > v2.50.x
SQLite-v3
API Design:-
API Usage Guide:-
- To Add a book for sharing do:-
- To Browse the shared books do:-
- To borrow a book for certain duration of time do:-
PUT /api/v1/booky/<book_id>/borrow
- book_id -> ID of the Book that has been added for sharing with others
- borrow_start_time -> Start Time from when the Book is being borrowed
- borrow_end_time -> End Time till when the Book is being borrowed (a week).
- To view all the borrowed books:-
- To return a borrowed book do:-
POST /api/v1/booky/<book_id>/borrow/<borrow_id>
- book_id -> ID of the Book that has been added for sharing with others
- borrow_id -> ID of the Borrow operation for Book with book_id
Setting Up:-
Your server is started at port :8000
.
- Use curl/hoppscotch/postman to test the API.
- To Add a book for sharing do:-
- To Browse the shared books do:-
- To borrow a book for certain duration of time do:-
- To view all the borrowed books:-
- To return a borrowed book do:-
TODO(Create these endpoints..):
- Add a Book for sharing with others
- Browse books that other users have put up for sharing
- Borrow a book from a user for a certain duration of time. Let's call these as borrow_start and borrow_end.
- View all the borrowed Books.
- Return a borrowed book
Thanks for using share_book.
License
MIT License
Copyright (c) 2023 Shrinibas Mahanta
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.