API Library service for borrowing books written on DRF and Dockerized.
Install PostgresSQL and create db.
git clone https://github.com/kapitoshk4/library-service-api.git
cd train_station
python -m venv venv
source venv/bin/activateCopy .env.sample -> .env and populate with all required data
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
python manage.py createsuperuserdocker-compose build
docker-compose up
docker-compose ps
docker exec -it your_image_name sh
- Create new admin user. `docker-compose run app sh -c "python manage.py createsuperuser`;
- Run tests using different approach: `docker-compose run web sh -c "python manage.py test"`;To access the API endpoints, follow these steps:
- Go to one if the following URLs:
- Type your Email & Password. For example:
- Email address: admin@admin.com
- Password: 1qazcde3
- After submitting your credentials, you will receive a token. This token grants access to the API endpoints.
You can use the following endpoints:
- Refresh Token - This URL will refresh your token when it expires.
- Verify Token - This URL will verify if your token is valid and has not expired.
- User Details - This URL will display information about yourself using the token assigned to your user.
Please note that accessing certain endpoints may require the ModHeader extension, which is available for installation in Chrome.
That's it for user endpoints. You can now proceed to the next step.
- First, go to the URL provided: API Borrowing. This URL provides all borrowing endpoints of the API.
- The URL for payments: API Payments.
- The URL for books: API Payments.
- Now you are ready to use the API to manage your library service.
- JWT authentication
- Admin panel available at /admin/
- Documentation located at /api/v1/doc/swagger/
- Manage borrowings and payment, books for the library service
- Make borrowing and return them
- Make payment after borrowing
- FINE payment if borrowing is overdue
- Implemented filtering for every endpoint in Swagger
- Filtering Borrowings by: actual return date, users