A next-generation book-centered social media platform that combines AI-powered recommendations, intelligent book discussions, and vibrant community features to revolutionize how readers discover, discuss, and share their literary experiences.
- Google Books Integration: Seamlessly search and explore millions of books
- AI-Powered Recommendations: Advanced semantic search based on emotional tone, genre preferences, and reading patterns
- Personalized Discovery: Machine learning algorithms that understand your reading taste
- Visual Book Search: Rich metadata with covers, descriptions, and ratings
- Intelligent Book Discussions: Chat with AI about specific books using Retrieval-Augmented Generation
- Context-Aware Responses: AI understands book content through vector embeddings and Wikipedia integration
- Literary Analysis: Deep conversations about themes, characters, plot, and literary techniques
- Memory-Enabled Conversations: Maintains conversation history for continuity
- Emotion-Based Filtering: Find books by mood (Happy, Suspenseful, Sad, Surprising, Angry)
- Genre Intelligence: Advanced categorization beyond simple genre tags
- Vector Search: Semantic similarity matching for nuanced recommendations
- Multi-Factor Analysis: Combines content analysis, sentiment, and user preferences
- Dynamic Posts: Share thoughts, reviews, and reading updates
- Rich Discussions: Comment threads and book-focused conversations
- User Profiles: Track reading history, favorite books, and social connections
- Feed Algorithms: Curated content based on interests and connections
Frontend/
βββ app/ # Next.js 15 App Router
β βββ auth/ # Authentication pages
β βββ books/ # Book discovery & details
β βββ posts/ # Social media feed
β βββ discussions/ # Book chat interface
β βββ ai-recommendations/ # AI recommendation engine
β βββ discover/ # Book search & browse
β βββ profile/ # User management
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui component library
β βββ book-card.tsx # Book display components
β βββ post-card.tsx # Social post components
β βββ chat-interface.tsx # AI chat components
βββ lib/ # Utilities & API clients
βββ api-client.ts # Backend API integration
βββ auth-context.tsx # Authentication state
βββ hooks/ # Custom React hooks
Backend/
βββ readingroom/ # Main Django project
β βββ settings.py # Configuration with CORS, JWT
β βββ urls.py # API routing
βββ books/ # Book management
β βββ models.py # Book & UserBookStatus models
β βββ views.py # Google Books API integration
β βββ serializers.py # API serialization
β βββ utils/ # Google Books utilities
βββ posts/ # Social media functionality
β βββ models.py # Post & interaction models
β βββ views.py # CRUD operations
β βββ serializers.py # Post API serialization
βββ users/ # User management
β βββ models.py # Custom User model
β βββ views.py # Authentication & profiles
β βββ serializers.py # User API serialization
βββ comments/ # Comment system
βββ models.py # Comment models
βββ views.py # Comment operations
βββ serializers.py # Comment serialization
Retrieval-Augmented Conversational Agents/
βββ backend/
β βββ api.py # FastAPI endpoints
β βββ embedder.py # Vector embedding generation
β βββ query_engine.py # RAG query processing
β βββ wiki_fetch.py # Wikipedia data retrieval
β βββ main.py # FastAPI application
βββ vectorstore/ # ChromaDB vector storage
βββ data/ # Book metadata & content
Semantic-book-recommender/
βββ app.py # Gradio recommendation interface
βββ vector-search.ipynb # Vector similarity algorithms
βββ sentiment-analysis.ipynb # Emotion classification
βββ text-classification.ipynb # Genre categorization
βββ data/ # Processed book datasets
- Next.js 15: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- shadcn/ui: Modern component library
- Radix UI: Accessible component primitives
- Axios: HTTP client for API communication
- NextAuth.js: Authentication solution
- Django 5.2: Robust web framework
- Django REST Framework: API development
- PostgreSQL: Production database
- JWT Authentication: Secure token-based auth
- Django CORS Headers: Cross-origin support
- Google Books API: Book metadata source
- FastAPI: High-performance API framework
- ChromaDB: Vector database for embeddings
- Sentence Transformers: Text embedding models
- Google Gemini API: Large language model
- LangChain: LLM application framework
- Gradio: ML model interface
- Pandas & NumPy: Data processing
- Docker: Containerization
- Git: Version control
- Environment Variables: Secure configuration
- CORS: Cross-origin resource sharing
- RESTful APIs: Standardized communication
- Node.js 18+ and npm/pnpm
- Python 3.10+ and pip
- PostgreSQL (for production)
- Git for version control
# Google Books API
GOOGLE_API_KEY=your_google_books_api_key
# Google Gemini API (for AI chat)
GEMINI_API_KEY=your_gemini_api_key
# Django Secret Key
SECRET_KEY=your_django_secret_key
# Database URL (production)
DATABASE_URL=your_postgresql_urlcd Frontend
npm install
# or
pnpm install
# Start development server
npm run dev
# Runs on http://localhost:3000cd Backend
pip install -r requirements.txt
# Database migrations
python manage.py migrate
# Create superuser (optional)
python manage.py createsuperuser
# Start Django server
python manage.py runserver
# Runs on http://localhost:8000cd "Retrieval-Augmented Conversational Agents for Literary Discussion/backend"
pip install -r requirements.txt
# Create .env file with API keys
echo "GOOGLE_API_KEY=your_key" > .env
echo "GEMINI_API_KEY=your_key" >> .env
# Start FastAPI server
uvicorn main:app --reload --port 8001
# Runs on http://localhost:8001cd Semantic-book-recommender
pip install -r requirements.txt
# Start Gradio interface
python app.py
# Creates shareable Gradio endpoint- Base URL:
http://localhost:8000/api/ - Authentication: JWT Bearer tokens
- Documentation: Available at
/api/docs/(when DEBUG=True)
# Authentication
POST /auth/login/ # User login
POST /auth/register/ # User registration
POST /auth/refresh/ # Token refresh
# Books
GET /books/ # List books
GET /books/{id}/ # Book details
POST /books/fetch/ # Fetch from Google Books
GET /books/search/ # Search books
# Posts
GET /posts/ # List posts
POST /posts/ # Create post
GET /posts/{id}/ # Post details
PUT /posts/{id}/ # Update post
DELETE /posts/{id}/ # Delete post
# Comments
GET /posts/{id}/comments/ # Post comments
POST /posts/{id}/comments/ # Add comment- Base URL:
http://localhost:8001/ - Content-Type:
application/json
# Book Preparation
GET /search-books # Search Google Books
POST /books/fetch-wiki # Fetch Wikipedia data
POST /books/embed # Generate embeddings
POST /books/prepare # Full preparation pipeline
# Chat Interface
POST /chat/query # Ask questions about books
GET /books/check # Check if book is ready- Interface: Gradio web interface
- Input: Text description, genre, emotional tone
- Output: Ranked book recommendations with covers
The semantic recommendation system uses advanced machine learning to understand book content and user preferences:
- Vector Embeddings: Books are represented as high-dimensional vectors
- Semantic Search: Find books similar in meaning, not just keywords
- Emotion Analysis: Filter by emotional tone (joy, fear, anger, surprise, sadness)
- Genre Intelligence: Advanced categorization beyond simple tags
- Personalization: Learns from user interactions and preferences
Revolutionary AI chat system for deep book conversations:
- Content Preparation: Wikipedia data + vector embeddings
- Context Retrieval: Relevant book passages for each question
- Response Generation: Google Gemini creates contextual answers
- Memory: Maintains conversation history for continuity
- Metadata Integration: Uses book details for richer responses
Community-focused platform for book lovers:
- Dynamic Posts: Rich text posts about books and reading
- Comments & Discussions: Threaded conversations
- User Profiles: Reading history and social connections
- Book Status: Track reading progress (want to read, reading, read)
- Discovery Feed: Algorithm-curated content
Powerful search and discovery tools:
- Google Books Integration: Access to millions of books
- Advanced Filtering: Genre, author, publication date, ratings
- Visual Search: Rich metadata with covers and descriptions
- Related Books: AI-suggested similar titles
- Trending: Popular books and rising titles
- JWT Tokens: Secure authentication with refresh mechanism
- CORS Configuration: Proper cross-origin resource sharing
- Environment Variables: Secure API key management
- Input Validation: Request validation and sanitization
- Rate Limiting: API protection against abuse
- HTTPS Ready: SSL/TLS support for production
- Frontend: Next.js development server
- Backend: Django development server
- Database: SQLite for development
- AI Services: Local FastAPI instances
- Frontend: Vercel, Netlify, or custom hosting
- Backend: Railway, Heroku, or VPS
- Database: PostgreSQL (Railway, Supabase, AWS RDS)
- AI Services: Cloud deployment with Docker
- CDN: Static asset optimization
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow TypeScript/Python best practices
- Write comprehensive tests
- Update documentation
- Follow conventional commit messages
- Ensure code passes linting
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Books API for book metadata
- Google Gemini for AI conversation capabilities
- ChromaDB for vector storage and retrieval
- shadcn/ui for beautiful UI components
- Vercel for Next.js hosting platform
- Open Source Community for amazing tools and libraries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Reading Room - Where every page opens a new conversation πβ¨