Giter Club home page Giter Club logo

library-api's Introduction

Library Service API

API service for managing library with DRF. Implemented possibility of managing books. Also you can borrow books and return them.

Installation

Python 3 should be installed. Docker should be installed.

git clone https://github.com/rakamakaphone/library-api
cd library-api
python -m venv venv
source venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate    
python manage.py runserver

This project uses environment variables to store sensitive information such as the Django secret key. Create a .env file in the root directory of your project and add your environment variables to it. This file should not be committed to the repository. You can see the example in .env.sample file.

Getting access

Use the following command to load prepared data from fixture to test and debug your code:

python manage.py loaddata fixture_data.json

After loading data from fixture you can use user (or create another one by yourself):

Login: [email protected]
Password: pass1234

create user via /api/user/register/
get access token via /api/user/token/

Features

  1. Admin panel.
  2. Creating user via email.
  3. Managing own profile.
  4. Managing books for admin users.
  5. Filtering books by title and author.
  6. Borrowing books with possibility to return them.
  7. Non-admins can see only their borrowings.
  8. Filtering active borrowings for all users.
  9. Filtering by user_id for admin users.
  10. Added different permissions for different actions.
  11. Added validation for date and book inventory.
  12. Added tests for different endpoints.
  13. JWT authenticated.
  14. Documentation located at /api/doc/swagger/

Schema

diag.jpg

library-api's People

Contributors

oomamchur avatar

Stargazers

 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.