Skip to content

Prasanna-Gupta/NextChapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

258 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NextChapter

Overview

NextChapter is a modern digital library platform that revolutionizes online reading. Users can explore, read, and manage their book collections with AI-powered recommendations, content moderation, personalized reading experiences, and comprehensive analytics. Built with a focus on user experience, accessibility, and scalability.


Features

Core Features

  • Advanced Search & Filters – Find books by title, author, genre, language, and rating
  • Built-in PDF Reader – Read books directly in the browser with PDF.js integration
  • Dark/Light Theme – Seamless theme switching with persistent preferences
  • Fully Responsive – Optimized for desktop, tablet, and mobile devices
  • Authentication System – Secure sign-up/sign-in with OAuth support (Google, GitHub)

AI-Powered Features

  • AI Content Moderation – Groq-powered moderation for user-generated content
  • Personalized Recommendations – Smart book suggestions based on reading preferences
  • Genre-Based Discovery – Curated book collections by genre

User Dashboard

  • Reading Statistics – Track books read, pages completed, and reading time
  • Reading Activity – Visual charts showing daily/weekly reading patterns
  • Monthly Progress – Monitor reading goals and achievements
  • Reading Challenge – Set and track annual reading goals
  • Currently Reading – Quick access to books in progress
  • Pinned Books – Bookmark favorite books for easy access
  • Genre Preferences – Customize reading recommendations

Admin Features

  • Book Management – Add, edit, and delete books
  • Bulk Upload – Upload multiple books via CSV with cover images and PDFs
  • User Management – View and manage user accounts
  • Analytics Dashboard – Track platform usage and statistics

πŸ“– Reading Experience

  • Reading Lists – Organize books into custom lists
  • Already Read – Track completed books
  • Trending Books – Discover popular titles
  • Highest Rated – Browse top-rated books
  • New Releases – Stay updated with latest additions
  • Word Meaning Search – Built-in dictionary for vocabulary lookup

Additional Features

  • Subscription System – Premium membership with Razorpay integration
  • Profile Management – Customize user profiles and preferences
  • Contact & Support – User support and feedback system
  • Legal Pages – Privacy policy, terms of service, refunds, and shipping info
  • Custom Cursor – Enhanced UI interactions
  • Error Boundaries – Graceful error handling
  • Loading States – Smooth loading animations

πŸ› οΈ Tech Stack

Frontend

  • React 18 – Modern UI library with hooks
  • Vite – Lightning-fast build tool and dev server
  • Tailwind CSS 4 – Utility-first CSS framework
  • Framer Motion – Smooth animations and transitions
  • React Router DOM – Client-side routing
  • Lucide React – Beautiful icon library
  • Recharts – Data visualization for analytics
  • PDF.js – PDF rendering in browser
  • Socket.io Client – Real-time features
  • React Toastify – Toast notifications

Backend & Services

  • Supabase – Backend-as-a-Service (Database, Auth, Storage)
  • FastAPI (Python) – AI moderation service
  • Groq API – AI-powered content moderation

Development Tools

  • FingerprintJS – Device fingerprinting
  • DOMPurify – XSS protection
  • date-fns – Date manipulation
  • Razorpay – Payment gateway integration

Deployment

  • Vercel – Frontend hosting
  • Render – Backend AI service hosting

Project Structure

NextChapter-React/
β”œβ”€β”€ frontend/                    # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/     # Dashboard-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin.jsx      # Admin panel
β”‚   β”‚   β”‚   β”œβ”€β”€ BulkUploadModal.jsx  # Bulk book upload
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx     # Navigation header
β”‚   β”‚   β”‚   β”œβ”€β”€ HeroSection.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ BookSection.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PdfViewer.jsx  # PDF reader
β”‚   β”‚   β”‚   β”œβ”€β”€ Reader.jsx     # Book reader
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ LandingPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ BooksPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ BookDetailPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProfilePage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ExploreBooksPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ReadingListPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SignInPage.jsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ contexts/          # React contexts
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   └── ThemeContext.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
β”‚   β”‚   β”‚   └── useRazorpay.js
β”‚   β”‚   β”œβ”€β”€ lib/               # Utility functions
β”‚   β”‚   β”‚   β”œβ”€β”€ supabaseClient.js
β”‚   β”‚   β”‚   β”œβ”€β”€ bookUtils.js
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboardUtils.js
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.js
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ services/          # API services
β”‚   β”‚   β”‚   └── moderation/
β”‚   β”‚   β”œβ”€β”€ pdf/               # PDF utilities
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ public/                # Static assets
β”‚   β”‚   β”œβ”€β”€ books-data.json
β”‚   β”‚   β”œβ”€β”€ bulk-upload-template.csv
β”‚   β”‚   β”œβ”€β”€ pdfs/
β”‚   β”‚   └── pdfjs/
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── package.json
β”œβ”€β”€ backendAI/                  # Python AI service
β”‚   β”œβ”€β”€ main.py                # FastAPI server
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ render.yaml
β”‚   └── Setup_AI_Moderation.md
β”œβ”€β”€ documentation/              # Project documentation
β”‚   β”œβ”€β”€ elicitation/
β”‚   β”œβ”€β”€ EPICS.md
β”‚   β”œβ”€β”€ user-stories.md
β”‚   └── sprints.md
β”œβ”€β”€ gallery/                    # Screenshots & media
└── README.md

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.8+ (for AI moderation service)
  • Supabase account
  • Groq API key (for AI moderation)

Frontend Setup

1. Clone the repository

git clone https://github.com/Prasanna-Gupta/NextChapter.git
cd NextChapter-React/frontend

2. Install dependencies

npm install

3. Set up environment variables

Create a .env file in the frontend directory:

VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_RAZORPAY_KEY_ID=your_razorpay_key_id

4. Run development server

npm run dev

5. Open in browser

http://localhost:5173

Backend AI Setup (Optional)

1. Navigate to backend directory

cd backendAI

2. Create virtual environment

# Windows
python -m venv venv
.\venv\Scripts\activate

# macOS/Linux
python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Set up environment variables

Create a .env file in the backendAI directory:

GROQ_API_KEY=your_groq_api_key_here
PORT=8000

5. Run the AI service

python -m uvicorn main:app --reload

The AI moderation service will be available at http://localhost:8000


πŸ”§ Available Scripts

Frontend

  • npm run dev - Start development server (Vite)
  • npm run build - Build for production
  • npm run preview - Preview production build

Backend AI

  • python -m uvicorn main:app --reload - Start AI service with hot reload
  • Access API docs at http://localhost:8000/docs

🎨 Design Philosophy

NextChapter follows a clean, modern design approach:

  • Minimalist Interface – Focus on content, not clutter
  • Cream & Coral Color Scheme – Warm, inviting aesthetic
  • Dark Mode Support – Reduce eye strain for night reading
  • Smooth Animations – Framer Motion for delightful interactions
  • Responsive Layout – Seamless experience across all devices
  • Accessibility First – WCAG compliant design patterns

View Figma Prototype


�️ Dat abase Schema (Supabase)

Tables

  • books - Book catalog with metadata, cover images, and PDF files
  • users - User accounts and profiles
  • reading_progress - Track user reading progress
  • reading_lists - User-created book lists
  • subscriptions - Premium membership data
  • user_preferences - Personalization settings

Storage Buckets

  • covers - Book cover images
  • pdfs - Book PDF files

Key Features Explained

Bulk Upload Books

Admins can upload multiple books at once using a CSV file:

  1. Download the CSV template from the admin panel
  2. Fill in book details (title, author, description, genres, etc.)
  3. Add cover_filename and pdf_filename columns
  4. Upload the CSV along with corresponding image and PDF files
  5. System automatically matches files by name and uploads to Supabase

AI Content Moderation

  • Powered by Groq API for real-time content analysis
  • Moderates user comments, reviews, and feedback
  • Flags inappropriate content automatically
  • FastAPI backend service deployed on Render

Reading Analytics

  • Tracks reading time, pages read, and books completed
  • Visual charts using Recharts
  • Monthly and yearly progress tracking
  • Reading streak and challenge features

Personalization

  • Genre preference selection
  • AI-powered book recommendations
  • Customized book discovery based on reading history
  • Trending and highest-rated book suggestions

Security Features

  • XSS Protection - DOMPurify sanitization
  • Authentication - Supabase Auth with OAuth
  • Device Fingerprinting - FingerprintJS for security
  • Error Boundaries - Graceful error handling
  • Input Validation - Pydantic models for API validation

Deployment

Frontend (Vercel)

npm run build
# Deploy the dist/ folder to Vercel

About

A modern web-based bookstore that makes reading smarter and more engaging. Users can explore, purchase, and read books online with features like personalized AI recommendations, intelligent summaries, and multimedia-enhanced reading experiences. Designed with a clean, scalable UI and built as a full-stack web app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors