Skip to content

munaimpro/fable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

πŸ“š Fable

A full-stack Ebook Sharing Platform where readers can discover and purchase original ebooks, writers can publish and manage their creations after verification, and administrators can oversee platform operations through a centralized dashboard.


🌐 Live Website

πŸ”— Live Site: fable-munaimpro.vercel.app


πŸš€ Getting Started

Clone Client Repository

git clone https://github.com/munaimpro/fable.git

Clone Server Repository

git clone https://github.com/munaimpro/fable-server.git

Install Dependencies

npm install

Run Development Server

npm run dev

Open:

http://localhost:3000

in your browser.


🎯 Project Overview

Fable is a modern digital ebook marketplace designed to connect readers and writers on a single platform.

Readers can browse, bookmark, and purchase ebooks securely using Stripe.

Writers can upload, publish, edit, and manage their ebooks after completing a one-time verification process.

Administrators have complete control over users, ebooks, transactions, and platform analytics.


πŸ‘₯ System Roles

πŸ“– Reader (User)

  • Browse ebooks
  • Purchase ebooks
  • Bookmark ebooks
  • View purchase history
  • Access purchased content

✍️ Writer

  • Upload ebooks
  • Edit ebooks
  • Publish / Unpublish ebooks
  • Delete ebooks
  • View sales history
  • Manage ebook catalog

πŸ›‘οΈ Admin

  • Manage users
  • Change user roles
  • Delete users
  • Manage all ebooks
  • View platform transactions
  • Monitor analytics

✨ Core Features

πŸ” Authentication & Authorization

Authentication

  • Email & Password Login
  • Google Authentication
  • BetterAuth Integration
  • Session Persistence
  • Secure Authentication Flow

Authorization

  • Role-Based Access Control (RBAC)
  • Protected Dashboard Routes
  • Admin Route Protection
  • Writer Route Protection
  • Secure API Verification

πŸ“š Ebook Management

Writers Can

  • Add New Ebook
  • Edit Existing Ebook
  • Delete Ebook
  • Publish Ebook
  • Unpublish Ebook

Ebook Information

  • Cover Image
  • Title
  • Writer Name
  • Genre
  • Price
  • Description
  • Full Content
  • Publish Status
  • Upload Date

πŸ’³ Ebook Purchase System

Readers can:

  • Browse Available Ebooks
  • View Ebook Details
  • Purchase Ebooks via Stripe
  • Access Purchased Content
  • View Purchase History

Purchase Flow

Browse Ebook
      ↓
View Details
      ↓
Stripe Checkout
      ↓
Payment Success
      ↓
Purchase Stored
      ↓
Content Unlocked

⭐ Writer Verification System

Writers must complete a one-time verification payment before publishing ebooks.

Verification Benefits

  • Ebook Publishing Permission
  • Writer Dashboard Access
  • Ebook Management Features

Payment Gateway

  • Stripe Checkout
  • Secure Verification Process

🌐 Public Pages

Home Page

  • Hero Banner
  • Featured Ebooks
  • Top Writers
  • Ebook Genres
  • Framer Motion Animations

Browse Ebooks

Features include:

  • Search by Ebook Title
  • Search by Writer Name
  • Genre Filtering
  • Price Range Filtering
  • Availability Filtering
  • Sorting
  • Pagination

Ebook Details Page

Displays:

  • High Resolution Cover
  • Ebook Information
  • Writer Information
  • Purchase Option
  • Bookmark Feature
  • Purchased Content Access

πŸ“Š Dashboard Features

Reader Dashboard

  • Purchase History
  • Purchased Ebooks
  • Bookmarked Ebooks
  • Profile Management

Writer Dashboard

  • Add Ebook
  • Manage Ebooks
  • Edit Ebook
  • Publish / Unpublish Ebook
  • Delete Ebook
  • Sales History
  • Bookmark Collection

Admin Dashboard

  • Analytics Overview
  • User Management
  • Ebook Management
  • Transaction Monitoring
  • Revenue Tracking
  • Genre Statistics
  • Monthly Sales Charts

πŸ“ˆ Analytics System

Platform analytics include:

  • Total Users
  • Total Writers
  • Total Ebooks Sold
  • Total Revenue
  • Monthly Revenue Statistics
  • Ebook Genre Distribution

πŸ” Search, Filtering & Pagination

Search

  • Ebook Title Search
  • Writer Name Search

Filters

  • Genre Filter
  • Availability Filter
  • Price Range Filter

Sorting

  • Newest First
  • Price Low β†’ High
  • Price High β†’ Low

Pagination


πŸ›‘οΈ Security Features

  • BetterAuth Authentication
  • JWT Verification
  • Protected API Routes
  • Role-Based Authorization
  • Secure Environment Variables
  • MongoDB Credential Protection
  • Server-Side Validation

πŸ—„οΈ Database Collections

Users

name
email
image
role
createdAt

Ebooks

title
description
content
genre
price
coverImage
writerId
writerName
status
totalSale
createdAt

Purchases

ebookId
ebookTitle
buyerId
buyerName
writerId
writerName
price
paymentStatus
transactionId
purchaseDate

Transactions

transactionId
type
userEmail
amount
status
createdAt

Verified Writers

writerId
writerEmail
paymentStatus
transactionId
verificationDate
status

Bookmarks

ebookId
userId
createdAt

πŸ”„ System Flow

User Registration
        ↓
Role Selection
        ↓
Authentication
        ↓
Dashboard Access
        ↓
Browse Ebooks
        ↓
Bookmark / Purchase
        ↓
Stripe Payment
        ↓
Purchase Storage
        ↓
Content Unlock
        ↓
Analytics Update

πŸ› οΈ Tech Stack

Frontend

  • Next.js 16
  • React 19
  • Tailwind CSS 4
  • Framer Motion
  • Lucide React
  • Recharts
  • React Hot Toast

Backend

  • Node.js
  • Express.js
  • MongoDB

Authentication

  • BetterAuth
  • JWT
  • Google OAuth

Payments

  • Stripe Checkout

πŸ“¦ NPM Packages Used

Client

{
  "@stripe/stripe-js": "^9.8.0",
  "better-auth": "^1.6.19",
  "jsonwebtoken": "^9.0.3",
  "lucide-react": "^1.21.0",
  "motion": "^12.40.0",
  "next": "^16.2.9",
  "react": "19.2.4",
  "react-dom": "19.2.4",
  "react-hot-toast": "^2.6.0",
  "recharts": "^3.8.1",
  "stripe": "^22.2.2"
}

Server

Express.js
MongoDB
JOSE
CORS
Dotenv
Stripe

🎯 Features Implemented

βœ… Authentication System

βœ… Role-Based Dashboard

βœ… Ebook CRUD Operations

βœ… Writer Verification Payment

βœ… Ebook Purchase Payment

βœ… Bookmark System

βœ… Search & Filtering

βœ… Pagination

βœ… Analytics Dashboard

βœ… Revenue Tracking

βœ… Monthly Sales Charts

βœ… Genre Statistics

βœ… Responsive Design

βœ… Loading States

βœ… Error Handling

βœ… Protected Routes


πŸ‘¨β€πŸ’» Admin Credentials

Email: admin@fable.com
Password: Admin@123

πŸ‘¨β€πŸ’» Developed By

Munaim Khan

M.Sc. in Computer Science & Engineering

Full Stack Web Developer

About

A full-stack Ebook Sharing Platform & marketplace built with Next.js 16, Node.js, Express, and MongoDB. Includes role-based dashboards, Stripe payments, and analytic tracking

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors