You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Libraff is a modern, scalable book management system built with Django and Django REST Framework. It provides a comprehensive platform for managing and accessing books with advanced features like social interactions, user management, and performance optimizations.
β¨ Key Features
π Book Management
Comprehensive Book Operations
View detailed book information
Download books in PDF format
Advanced search and filtering
Book categorization system
Price range filtering
Author and context-based search
π₯ User Experience
Authentication & Authorization
JWT-based authentication
Secure user registration
Role-based access control
Profile management
Session management
π¬ Social Features
Interactive Platform
Comment system for books
Like/unlike functionality
Public and private favorites
User activity tracking
Social interactions
β‘ Performance
Optimized System
Redis caching implementation
Custom pagination
Database query optimization
Asynchronous task processing
π§ Technical Stack
Backend Framework: Django 5.1.6
API Framework: Django REST Framework
Authentication: JWT (JSON Web Tokens)
Database: PostgreSQL/SQLite
Caching: Redis
Task Queue: Celery
API Documentation: DRF-YASG (Swagger/OpenAPI)
π‘ API Documentation
Authentication Endpoints
Endpoint
Method
Description
Auth Required
/api/auth/register/
POST
Register new user
No
/api/auth/login/
POST
User login
No
/api/auth/logout/
POST
User logout
Yes
User Management
Endpoint
Method
Description
Auth Required
/api/users/
GET
List all users
No
/api/users/{user_id}/
GET
Get user details
No
/api/users/{user_id}/
PATCH
Update user profile
Yes
Book Management
Endpoint
Method
Description
Auth Required
/api/books/
GET
List all books
No
/api/books/{book_id}/
GET
Get book details
No
/api/books/{book_id}/
PATCH
Update book status
Yes
/api/books/category/{category_id}/
GET
List books by category
No
/api/books/search/
GET
Search books
No
/api/books/filter/
GET
Filter books
No
/api/books/{book_id}/download/
GET
Download book
Yes
Comments System
Endpoint
Method
Description
Auth Required
/api/books/{book_id}/comments/
GET
List book comments
No
/api/comments/{comment_id}/
GET
Get comment details
No
/api/books/{book_id}/comments/
POST
Create comment
Yes
/api/comments/{comment_id}/
PATCH
Update comment
Yes
/api/comments/{comment_id}/
DELETE
Delete comment
Yes
Likes System
Endpoint
Method
Description
Auth Required
/api/books/{book_id}/likes/
GET
List book likes
No
/api/books/{book_id}/likes/
POST
Like book
Yes
/api/books/{book_id}/likes/
DELETE
Unlike book
Yes
/api/comments/{comment_id}/likes/
GET
List comment likes
No
/api/comments/{comment_id}/likes/
POST
Like comment
Yes
/api/comments/{comment_id}/likes/
DELETE
Unlike comment
Yes
Favorites System
Endpoint
Method
Description
Auth Required
/api/users/{user_id}/favorites/open/
GET
List public favorites
No
/api/users/{user_id}/favorites/private/
GET
List private favorites
Yes
/api/favorites/{favorite_id}/
GET
Get favorite details
Yes
/api/books/{book_id}/favorites/
POST
Add to favorites
Yes
/api/favorites/{favorite_id}/
PATCH
Update favorite
Yes
/api/favorites/{favorite_id}/
DELETE
Remove favorite
Yes
π οΈ Query Parameters
Pagination
page: Page number (default: 1)
page_size: Items per page (default: 10)
Search
query: Search term for book titles
Filtering
price_from: Minimum price
price_to: Maximum price
category: Filter by category
author: Filter by author
context: Filter by context
π Getting Started
Prerequisites
Python 3.8+
PostgreSQL
Redis
Virtual environment
Installation
Clone the repository
git clone https://github.com/yourusername/libraff.git
cd libraff
Set up virtual environment
python -m venv venv
source venv/bin/activate
Install dependencies
pip install -r requirements.txt
Configure environment variables
cp .env.example .env
Set up database
python manage.py migrate
Create superuser
python manage.py createsuperuser
Run development server
python manage.py runserver
Run Celery worker
celery -A libraff worker -l info
Run Redis server
redis-server
π Security Features
JWT-based authentication
Password hashing
CSRF protection
Rate limiting
Input validation
Secure file uploads
Role-based access control
π Performance Optimizations
Redis caching
Database query optimization
Pagination
Lazy loading
Asynchronous tasks
Connection pooling
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Libraff is a modern, scalable book management system built with Django and Django REST Framework. It provides a comprehensive platform for managing and accessing books with advanced features like social interactions, user management, and performance optimizations.