A web-based platform for readers and publishers to explore, manage, and interact with books. The application allows users to search for books, rate them, and view summaries powered by the Ollama Qwen 2 0.5b model. This project is built using Django & Django REST Framework, PostgreSQL, and Docker, with Swagger for API documentation and token authentication via Django REST Framework.
- User Authentication: Secure registration and login for users with token-based authentication.
- Book Management: Publishers can add, update, and delete books.
- Search and Filter: Search for books by title, author.
- Ratings and Reviews: Users can rate and review books.
- Favorites: Users can favorite books and manage their list.
- Book Summaries: Get concise summaries of books using the Ollama Qwen 2 0.5b model.
- API Documentation: Explore the available endpoints with Swagger.
- Token Authentication: APIs secured using token-based authentication powered by Django REST Framework.
- Backend: Django & Django REST Framework
- Database: PostgreSQL
- Containerization: Docker
- Testing: Pytest
- AI Integration: Ollama Qwen 2 0.5b model for generating book summaries
- API Documentation: Swagger
- Authentication: Token-based authentication with Django REST Framework
- Docker
-
Clone the repository:
git clone https://github.com/sudip-khanal/bookweb-app.git cd bookweb-app
-
Create a
.env
file in the root directory with the necessary environment variables:DEBUG=True SECRET_KEY=your-secret-key DATABASE_URL=postgres://username:password@db:5432/bookweb_db
-
Build and run the containers:
docker-compose up --build
-
Apply migrations and create a superuser:
docker-compose exec web python manage.py migrate docker-compose exec web python manage.py createsuperuser
-
Access the application:
- Web app: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
- API Documentation (Swagger): http://localhost:8000/swagger
To run the tests using pytest
:
docker-compose exec web pytest
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a pull request.