This project is a Django-based application that provides a REST API for managing a library's book borrowing system. The API allows users to:
- View available books
- Borrow books
- Receive notifications on Telegram
- Make payments for borrowed books
The application ensures proper authentication and permissions to manage user access and actions.
- Overview
- Features
- Installation
- Setting up Environment Variables
- Starting the Server
- Run Tests
- Run with Docker
- Getting Access
- Contributing
- All users can browse the list of books.
- Only staff members can add new books to the library.
- Registered users without outstanding payments can borrow available books.
- Overdue returns incur a fine.
- Users are prompted to pay via Stripe upon creating a borrowing.
- Payment sessions are valid for 24 hours.
- Secure JWT authentication for user access.
- Comprehensive API documentation with Swagger, DRF Spectacular, and Redoc.
- Task scheduling and automation using Celery and Celery Beat.
- Detailed notifications for staff in the Telegram chat:
- Creation of a new borrowing.
- Successful payment.
- Daily report of overdue and soon-to-be overdue borrowings.
- Daily payment report.
- Monthly payment report.
- Clone the repository:
git clone https://github.com/DmytroHlazyrin/Library-service-api.git- Go to the project directory:
cd Library-service-api- Create and activate venv:
python -m venv venv
source venv/bin/activate(on macOS)
venv\Scripts\activate(on Windows)- Set the project assignments:
pip install -r requirements.txttouch .env .env.sample
- Create database migrations:
python manage.py makemigrations
python manage.py migrate- Create superuser:
python manage.py createsuperuser- *Load test data:
python manage.py loaddata library_service_db_data.jsonDefault superuser for testing 👤
- Email: admin@admin.com
- Password: 1qazcde3
- Start the development server:
python manage.py runserverpython manage.py testdocker-compose build docker-compose up create user via api/user/register
get access token via api/user/token
We welcome contributions to improve this project! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push to your branch.
- Create a pull request.
Please ensure your code adheres to our coding standards and includes appropriate tests.
Thank you for checking out our Library Management System project! We hope this API makes it easier to manage book borrowings, payments, and notifications in your library. With comprehensive features, secure authentication, and detailed documentation, we strive to provide a robust and user-friendly solution.
Happy coding!