Skip to content

ebilebilli/Libraff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Libraff - Modern Book Management System

Django Django REST Framework JWT Redis PostgreSQL

πŸš€ Overview

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

  1. Clone the repository
git clone https://github.com/yourusername/libraff.git
cd libraff
  1. Set up virtual environment
python -m venv venv
source venv/bin/activate  
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables
cp .env.example .env
  1. Set up database
python manage.py migrate
  1. Create superuser
python manage.py createsuperuser
  1. Run development server
python manage.py runserver
  1. Run Celery worker
celery -A libraff worker -l info
  1. 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.

πŸ‘¨β€πŸ’» Author

πŸ™ Acknowledgments

  • Django REST Framework team
  • Redis community
  • PostgreSQL team
  • All contributors

About

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.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages