NovelPub is a full-featured web application for uploading, reading, editing, and managing web novels. It features browser-side ePub parsing, TXT chapter uploads/inserts, customizable reading themes, real-time scroll progress tracking, paragraph-level inline comments, and role-based permissions.
- Frontend: Vite + React 18 + TypeScript + Tailwind CSS
- Icons: Lucide React
- Parsers: JSZip + DOMParser (XHTML/ePub & TXT parsing)
- Backend / Database: Supabase (PostgreSQL + Auth + Storage)
- Fallback Engine: LocalStorage Mock Database (for offline / keyless testing)
- Containerization: Docker + Docker Compose + Nginx
npm installnpm run devOpen http://localhost:5173 in your browser.
Note: If Supabase environment variables are not configured, NovelPub automatically runs in Hybrid Demo Mode using local storage seeded with sample novels.
Follow these step-by-step instructions to connect NovelPub to your live Supabase project:
- Go to Supabase.com and sign in or create a free account.
- Click New Project, select an organization, name your project (e.g.
novel-pub), set a database password, and choose a region.
- In your Supabase project dashboard, navigate to Project Settings -> API.
- Locate the following two values:
- Project URL (e.g.
https://xyzcompany.supabase.co) - anon / public key (
eyJhbGci...)
- Project URL (e.g.
Create a .env file in the root of the project directory:
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here- In your Supabase Dashboard, click SQL Editor in the left sidebar -> New Query.
- Copy the entire contents of the migration file
supabase/migrations/0001_initial_schema.sql. - Paste the SQL code into the SQL editor and click Run.
This SQL script creates:
profiles(User role permissions:adminvsnormal)books(Novel metadata: Title, Author, Description, Genre, Tags, Language, Status, Age Rating, Cover URL)chapters(Individual chapter contents)novel_ratings&novel_reviews(1–5 Star rating and reviews)line_comments(Paragraph-level inline comments)reading_progress(User scroll percentage & position)- Row Level Security (RLS) policies for secure multi-user data access.
- Cover Images: Stored directly as Base64 Data URLs (or external image URLs) inside the
books.cover_urlcolumn in PostgreSQL. - ePub & TXT Files: Parsed directly in the browser via
JSZip&DOMParser. The extracted chapter titles and HTML text payloads are stored directly in thechapters.contentPostgreSQL table. - No Supabase Storage Buckets Required: No object storage buckets need to be created in Supabase for the application to function fully!
Since NovelPub is a 100% client-side Vite React application with direct Supabase SDK integration, it can be deployed to Vercel in seconds:
If you haven't already set up Supabase:
- Create a Supabase project and run the SQL migration
supabase/migrations/0001_initial_schema.sqlin the Supabase SQL Editor (see Setting Up Live Supabase PostgreSQL above). - Copy your Project URL (
VITE_SUPABASE_URL) and anon / public key (VITE_SUPABASE_ANON_KEY) from Project Settings -> API.
Push your repository to GitHub, GitLab, or Bitbucket.
- Log in to Vercel.com and click Add New -> Project.
- Select your
novel-pubrepository. - Vercel automatically detects the Vite framework preset:
- Build Command:
npm run build - Output Directory:
dist
- Build Command:
Before clicking Deploy, expand Environment Variables in Vercel and add:
VITE_SUPABASE_URL=https://your-project-id.supabase.coVITE_SUPABASE_ANON_KEY=your-anon-key-here
Click Deploy. Vercel will compile the Vite production bundle and host NovelPub globally on high-speed edge CDN with free automatic SSL.
You can build and run NovelPub using Docker and Docker Compose:
docker compose up --build -dAccess the application at http://localhost:8080.
docker compose down- 📖 ePub & TXT Uploads: Upload
.epubfiles to overwrite full novel contents or.txtfiles to append/insert chapters. - 🎨 Themed Reader UI: Supports Light, Dark, Sepia, and Slate themes, custom font sizes, and line height adjustments.
- 💬 Line-Level Inline Comments: Hover over any paragraph on desktop (or tap on mobile) to leave inline comments and view discussion threads.
- ⌨️ Desktop Arrow Key Navigation: Press
←or→on your keyboard to navigate between chapters. - 📊 Fine Scroll Progress: Automatically tracks and restores your exact reading percentage per book.
- 🛡️ HTML Sanitization: All HTML descriptions, ePub chapters, and user comments are sanitized against XSS attacks.
- 👤 Role-Based Permissions: Admin users or book creators can manage, edit, or delete novels; all registered users can read and rate.