Code Monkey home page Code Monkey logo

library-api's Introduction

Library API

Restful Django project for managing a library.

Features

  • JWT Authentication
  • Payments management (Stripe API)
  • Borrowings management
  • Book management
  • Fines system
  • Telegram notifications

Installation

Docker should be installed

git clone https://github.com/sashabryl/library-api.git
cd library-api
cp .env.sample .env
docker-compose build
docker-compose up

Telegram notifications group

Testing

To run tests, type:

docker exec -it <id of the docker container with the app> python manage.py test

Endpoints

Books Service (CRUD for Books)

  • POST: api/library/books/ - add a new book
  • GET: api/library/books/ - get a list of books
  • GET: api/library/books/{id}/ - get book's detail info
  • PUT/PATCH: api/library/books/{id}/ - update book (also manage inventory)
  • DELETE: api/library/books/{id}/ - delete book

Users Service (Authentication & registration management)

  • POST: api/users/ - register a new user
  • POST: api/users/token/ - get JWT tokens
  • POST: api/users/token/refresh/ - refresh JWT token
  • GET: api/users/me/ - get my profile info
  • PUT/PATCH: api/users/me/ - update profile info

Borrowings Service (Book borrowings management)

  • POST: api/library/borrowings/ - add new borrowing (when borrow book - inventory is made -= 1)
  • GET: api/library/borrowings/?user_id=...&is_active=... - get borrowings by user id and whether is borrowing still active or not.
  • GET: api/library/borrowings/{id}/ - get specific borrowing
  • POST: api/library/borrowings/{id}/return/ - set actual return date (inventory is made += 1)

Payment Service (Perform payments via Stripe API)

  • GET: api/library/success/ - check successful stripe payment
  • GET: api/library/cancel/ - return payment paused message

Documentation

To visit documentation go to

http://127.0.0.1:8000/api/doc/swagger/

Photos:

Screenshot1 Screenshot2 Screenshot3 Screenshot4 Screenshot5

library-api's People

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.