- Api service for library managment written in DRF
- JWT authentication
- Admin panel at /admin/
- Documentation located at /api/doc/swagger/
- Management of borrowings and book returns
- Telegram alerts when a new borrowing is created
- Telegram statistics about overdue borrowings every midnight (Celery)
- Books are automatically hidden and given the status "need_to_refill" when the book inventory reaches 0
- Creating books with two types of covers
- Filtering borrows by status and user ID (customer)
- [POST] /users/register/ (register your user)
- [POST] /users/login/ (login your user)
- [GET] /users/me (info about yourself)
- [PUT] /users/me (update all info about yourself)
- [PATCH] /users/me (partial update of info about yourself)
- [POST] /users/token (get your JWT token for access)
- [POST] /users/token/refresh (update your access token)
- [POST] /api/library/books/ (create nem book)
- [GET] /api/library/books/ (list of all books)
- [GET] /api/library/books/{id} (detail info about book)
- [PUT] /api/library/books/{id} (update all book instance)
- [PATCH] /api/library/books/{id} (partial update of book instance)
- [DELETE] /api/library/books/{id} (delete book with chosen id)
- [GET] /api/library/borrowings/ (list of all borrowings)
- [GET] /api/library/borrowings/{id} (detail info about borrow)
- [PUT] /api/library/borrowings/{id} (update all borrow instance)
- [PATCH] /api/library/borrowings/{id} (partial update of borrow instance)
- [DELETE] /api/library/borrowings/{id} (delete borrow with chosen id)
- [DELETE] /api/library/borrowings/{id}/return (return book with given borrow id)
TELEGRAM_CHAT_ID=<YOUR_TELEGRAM_CHAT_ID>
- Add the Telegram BOT to your group.
- https://api.telegram.org/bot5778173608:AAEkfqphOJjflf0NxOByAvzpPu-RRFkJSpY/getUpdates
- Look for "chat" object
- SECRET_KEY=your secret django key (can be random)
- POSTGRES_USER=your database username
- POSTGRES_PASSWORD=your database password
- POSTGRES_DB=your database name
- POSTGRES_HOST=select database image here
- POSTGRES_PORT=5432
git clone https://github.com/DevSpaciX/library_api.git
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
open .env.sample and change enviroment variables on yours !Rename file from .env.sample to .env
docker-compose up
- Create user via /api/user/register/
- Get user token via /api/user/token/
- Authorize with it on /api/doc/swagger/ OR
- Install ModHeader extention and create Request header with value
Bearer <Your access tokekn>