Bestseller Narrative Analytics Platform

Mary

Mary Kurt

๐Ÿ“š Bestsellerโ€‘Anatomy

A comprehensive narrative analytics platform that decodes the DNA of bestsellers through multi-dimensional analysis. By examining structural patterns, emotional arcs, and narrative techniques across successful novels, this project reveals the underlying mechanics that make stories resonate with readers. The project consists of two main components:
A proprietary analysis engine (closed source) that powers the metrics
An open-source web interface that provides:
Deep insights into what makes bestsellers successful through comprehensive analysis of successful fictions
Interactive metrics dashboard for analyzing your own manuscript

๐Ÿš€ Live Demo

The demo has two main features:
Anatomy of a Bestseller โ€“ Explore detailed insights and patterns from our analysis of successful novels, revealing the key elements that make stories resonate with readers
Analyze My Book โ€“ Upload your manuscript (TXT) to receive a comprehensive metrics dashboard showing how your story compares to bestseller patterns

๐Ÿ”ฎ Coming Soon

Predictive Analytics Engine

Bestseller Probability Score: Get an AI-powered prediction of your manuscript's potential success
Success Factors Analysis: Understand which elements contribute to or detract from your book's bestseller potential
Comparative Market Analysis: See how your book compares to current market trends
Optimization Suggestions: Receive data-driven recommendations to improve your manuscript's market potential

How It Works

Upload your manuscript
Our AI analyzes your text against our bestseller database
Receive a comprehensive probability score
Get detailed insights into:
Market fit
Reader engagement potential
Competitive positioning
Optimization opportunities

๐Ÿ” Project Architecture

1) Analysis Engine (Proprietary)

The core analysis engine is built on extensive research and machine learning models. While the engine itself is not open source, here's what it does:
Research Foundation
Analyzed 80 contemporary bestsellers (โ‰ˆ 8.3 M words)
Developed proprietary scoring algorithms
Implemented advanced NLP techniques
Technical Stack
Category Libraries/Tools Purpose Deep Learning & NLP PyTorch, Transformers BERT-based text analysis and inference Scientific Computing NumPy, SciPy Numerical operations and statistical analysis Data Processing Pandas Data manipulation and analysis Classical ML & Statistics scikit-learn, XGBoost Model preparation, metrics, and feature importance Feature Analysis SHAP (SHapley Additive exPlanations) Feature importance and model interpretation Dimensionality Reduction PCA, UMAP, t-SNE High-dimensional data visualization and pattern discovery Language Modeling SpaCy, Gensim, NLTK Tokenization, embeddings, word vectors Visualization Matplotlib, Plotly Statistical plots, interactive visualizations, and analysis dashboard System Tools os, pathlib, json, re, time File management, regex, debugging Environment Google Colab GPU CUDA acceleration for processing
Key Capabilities
Chapter-level sentiment analysis
Emotional arc tracking
Pacing and tension measurement
Style and readability metrics
Temporal and sensory analysis
Output Metrics
~100 raw metrics per chapter
~200 derived features
Statistical validation
Pattern recognition
Archetype identification

2) Web Interface (Open Source)

This repository contains the open-source web interface that connects to the analysis engine. It provides:
Features
TXT file upload
Real-time analysis processing
Interactive visualizations
Comprehensive dashboards
Export capabilities
Technical Implementation
Component Technology Purpose Frontend Next.js 14, React 19 User interface and interactions File Processing Supabase Storage Secure file handling Analysis Pipeline Edge Functions Serverless processing Data Storage Supabase Postgres Metrics persistence Visualization Plotly.js, Recharts Interactive charts

๐Ÿ› ๏ธ Tech Stack

Framework: Next.js 15.2.4
Language: TypeScript
UI Library: React 19
Styling: Tailwind CSS
Component Library: Radix UI
Form Handling: React Hook Form with Zod validation
Data Visualization: Plotly.js, Recharts
Database: Supabase
State Management: React Hooks
Date Handling: date-fns

๐Ÿ“ฆ Installation

Clone the repository:
git clone [repository-url]
cd bestseller_anatomy
Install dependencies:
pnpm install
Set up environment variables: Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

๐Ÿƒโ€โ™‚๏ธ Development

Run the development server:
pnpm dev
The application will be available at http://localhost:3000

๐Ÿ—๏ธ Build

To create a production build:
pnpm build
To start the production server:
pnpm start

๐Ÿ“ Project Structure

bestseller_anatomy/
โ”œโ”€โ”€ app/ # Next.js app directory
โ”‚ โ”œโ”€โ”€ globals.css # Global styles
โ”‚ โ”œโ”€โ”€ layout.tsx # Root layout component
โ”‚ โ””โ”€โ”€ page.tsx # Main page component
โ”‚
โ”œโ”€โ”€ components/ # React components
โ”‚ โ”œโ”€โ”€ ui/ # Reusable UI components
โ”‚ โ”œโ”€โ”€ tabs/ # Tab-related components
โ”‚ โ”œโ”€โ”€ book-dashboard.tsx # Book analysis dashboard
โ”‚ โ”œโ”€โ”€ chart-viewer.tsx # Data visualization components
โ”‚ โ”œโ”€โ”€ nav-tabs.tsx # Navigation components
โ”‚ โ”œโ”€โ”€ podcast-player.tsx # Audio content player
โ”‚ โ””โ”€โ”€ table-of-contents.tsx # Content navigation
โ”‚
โ”œโ”€โ”€ hooks/ # Custom React hooks
โ”œโ”€โ”€ lib/ # Utility functions and configurations
โ”œโ”€โ”€ public/ # Static assets
โ”œโ”€โ”€ styles/ # Global styles and Tailwind configurations
โ”‚
โ”œโ”€โ”€ next.config.mjs # Next.js configuration
โ”œโ”€โ”€ tailwind.config.ts # Tailwind CSS configuration
โ”œโ”€โ”€ postcss.config.mjs # PostCSS configuration
โ”œโ”€โ”€ tsconfig.json # TypeScript configuration
โ””โ”€โ”€ package.json # Project dependencies and scripts

๐Ÿ“Š Data Visualization

The web interface includes multiple visualization types for comprehensive analysis:

Distribution Analysis

Scatter/Bubble Plots: Readability vs. length distribution, cluster analysis
Box/Violin Plots: Chapter length distribution, word count variance

Progress Analysis

Line/Area Charts: Emotional flow, pacing variations, peak points across chapters
Timeline/Step Charts: Structural turning points (Disturbance, Doorways, Midpoint)
Progress Indicators: Chapter-by-chapter advancement

Comparative Analysis

Bar/Column Charts: Genre-based average reading times, feature comparisons
Stacked/100% Stacked Bars: Character traits, narrative POV, mood distributions
Donut/Pie Charts: Sensory balance (visual-auditory-tactile ratios)

Key Metrics

KPI Cards:
Readability scores
Word counts
Average chapter length
Key success metrics

Interactive Features

Zoom and pan capabilities
Tooltip information
Dynamic filtering
Export functionality

๐Ÿ“ License

GNU General Public License v3.0 (GPL-3.0)
This project is licensed under the GPL-3.0 License. Commercial use is not permitted.

๐Ÿ‘ฅ Contributing

Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add some amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request

โ„น๏ธ Note

This repository contains only the web interface code. The analysis engine that powers the metrics is proprietary and not included in this repository.
Like this project

Posted May 21, 2025

The platform showcases insights from 2024's bestselling fiction and lets storytellers upload manuscripts for chapter-level analysis.

Likes

0

Views

0

Timeline

Apr 17, 2025 - May 20, 2025