Skip to content

Tusharwasake/ClarityAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ClarityAI - Smart Content Summarizer

A Chrome extension that intelligently extracts and summarizes web content with AI-powered insights. Built with TypeScript, featuring smart content detection, one-click summarization, and a clean interface.

🌐 Live Deployment

πŸ“¦ Chrome Web Store Status

Version 1.0.1 - Privacy Policy Compliance Update

  • βœ… Added comprehensive privacy policy
  • βœ… Updated manifest with privacy policy URL
  • βœ… Ready for Chrome Web Store resubmission
  • πŸ“„ See CHROME_STORE_PRIVACY_FIX.md for details

πŸ”§ Quick Install (Chrome Extension)

For Users:

  1. Download Extension: Clone or download this repository
  2. Open Chrome: Go to chrome://extensions/
  3. Enable Developer Mode: Toggle "Developer mode" in top-right
  4. Load Extension: Click "Load unpacked" β†’ Select chrome-extension/dist folder
  5. Start Using: Visit any webpage and click the ClarityAI icon to summarize!

For Developers:

  1. Build Extension: cd chrome-extension && npm install && npm run build
  2. Load in Chrome: Point to the dist folder when loading unpacked
  3. API Integration: Extension connects to deployed backend automatically

🌟 Core Features

Smart Content Detection & Extraction

  • Automatic noise removal: Eliminates ads, navigation, sidebars automatically
  • Intelligent main content detection: Achieves 80%+ accuracy on common sites
  • Multi-strategy extraction: Uses semantic HTML, readability algorithms, and fallback methods
  • Broad compatibility: Handles Medium, news sites, blogs, and general web content

One-Click Summarization

  • Floating action button: Always visible "Summarize" button on every page
  • Consistent format: Clean 3-bullet point summary format for easy scanning
  • Real-time feedback: Loading states with progress indicators
  • Error resilience: Comprehensive error handling with retry options

Clean Popup Interface

  • Slide-out panel design: Non-intrusive slide panel (not popup window)
  • Summary management: View, copy, and export summaries
  • Quick actions: One-click copy and export functionality
  • Settings control: Toggle extension on/off per site

Local Storage & Quick Access

  • Recent summaries: Automatically saves last 10 summaries locally
  • Quick access: Instant access via extension popup
  • Auto-cleanup: Automatically deletes old summaries to manage storage
  • Export options: Export summaries as text or markdown files

πŸš€ Technology Stack

Frontend (Chrome Extension)

  • TypeScript: Type-safe development
  • Webpack: Module bundling and build optimization
  • Chrome Extension API: Manifest V3 for modern Chrome extensions

Backend (API Server)

  • Node.js + Express: RESTful API server with MVC architecture
  • TypeScript: Full type safety and modern JavaScript features
  • MVC Pattern: Organized into Models, Views, Controllers for maintainability
  • Service Layer: Separated business logic and external API integrations
  • Mozilla Readability: Advanced content extraction
  • JSDOM: Server-side DOM manipulation

πŸ“ Project Structure

e:\ClarityAI\
β”œβ”€β”€ backend/                     # API Server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ server.ts           # Main server entry point
β”‚   β”‚   β”œβ”€β”€ controllers/        # Request handlers
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”‚   β”œβ”€β”€ models/            # Type definitions
β”‚   β”‚   β”œβ”€β”€ utils/             # Helper functions
β”‚   β”‚   └── middleware/        # CORS, logging, error handling
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”‚
└── chrome-extension/           # Chrome Extension
    β”œβ”€β”€ src/                    # TypeScript source files
    β”‚   β”œβ”€β”€ content.ts          # Main content script
    β”‚   β”œβ”€β”€ background.ts       # Service worker
    β”‚   β”œβ”€β”€ popup.ts           # Extension popup
    β”‚   β”œβ”€β”€ contentExtractor.ts # Smart content detection
    β”‚   β”œβ”€β”€ storageManager.ts   # Local storage management
    β”‚   β”œβ”€β”€ summarizationService.ts # API communication
    β”‚   └── types.ts           # TypeScript definitions
    β”œβ”€β”€ styles/                # CSS styling
    β”œβ”€β”€ icons/                 # Extension icons
    β”œβ”€β”€ dist/                  # Built extension files
    β”œβ”€β”€ manifest.json          # Chrome extension manifest
    β”œβ”€β”€ popup.html            # Popup HTML
    β”œβ”€β”€ package.json
    β”œβ”€β”€ tsconfig.json
    └── webpack.config.js

πŸ› οΈ Development Setup

Prerequisites

  • Node.js 18+ and npm
  • Google Chrome browser

1. Backend Development (Optional - Uses Live API)

The extension connects to the live backend at https://clarityai-qrnk.onrender.com by default. For local development:

cd "e:\ClarityAI\backend"
npm install
npm run dev
# Backend runs at http://localhost:3000

2. Extension Development

cd "e:\ClarityAI\chrome-extension"
npm install
npm run build

3. Load Extension in Chrome

  1. Open chrome://extensions/
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select the e:\ClarityAI\chrome-extension\dist\ folder

4. Test the Extension

  1. Visit any webpage with content
  2. Click the floating "Summarize" button or ClarityAI icon
  3. View the summary in the slide-out panel

🌐 API Endpoints (Live)

Base URL: https://clarityai-qrnk.onrender.com

  • GET /: Welcome message
  • GET /health: Health check and server status
  • POST /api/summarize: Generate AI-powered summary
    • Body: { content: string, title: string, url?: string }
    • Returns: { points: string[], timestamp: string, wordCount: number }
  • POST /api/extract: Extract content from URL
    • Body: { url: string }
    • Returns: { title: string, content: string, excerpt: string, ... }

Example API Usage:

// Summarize text
const response = await fetch(
  "https://clarityai-qrnk.onrender.com/api/summarize",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      content: "Your article content here...",
      title: "Article Title",
    }),
  }
);
const summary = await response.json();

πŸ“Š How It Works

Content Detection

  1. Semantic HTML: Looks for <article>, [role="main"], .content
  2. Readability Algorithm: Scores elements based on content density
  3. Noise Removal: Filters out ads, navigation, sidebars
  4. Fallback: Uses full page content if other methods fail

Summarization

  • Position scoring: Prioritizes opening sentences
  • Length optimization: Prefers 10-30 word sentences
  • Keyword matching: Boosts sentences with title keywords
  • Content indicators: Recognizes important terms and numbers

πŸ”’ Privacy & Security

  • Local storage: Summaries stored locally in Chrome
  • No tracking: No analytics or user data collection
  • CORS enabled: Secure backend communication
  • Minimal permissions: Only necessary Chrome permissions

πŸš€ Future Enhancements

  • AI Integration (OpenAI, Claude)
  • Custom summary lengths
  • Multiple summary formats
  • Highlight integration
  • Sharing features

πŸ› Troubleshooting

Extension not working?

  1. βœ… Backend is live: Uses https://clarityai-qrnk.onrender.com (no local setup needed)
  2. βœ… Check Chrome extensions: Go to chrome://extensions/ for errors
  3. βœ… Reload extension: After code changes, reload from extensions page
  4. βœ… Check permissions: Ensure extension has access to the current site

Content not extracting?

  • βœ… Works best on articles: News sites, blogs, Medium posts
  • ⚠️ JavaScript-heavy sites: May need page refresh for dynamic content
  • ⚠️ Social media: Limited support for Twitter, Facebook, etc.
  • βœ… Test on: CNN, BBC, Medium, Wikipedia for best results

API Issues?

  • βœ… Check status: Visit https://clarityai-qrnk.onrender.com/health
  • ⚠️ Free tier limits: Render free tier may have cold starts (first request slower)
  • βœ… CORS enabled: Should work from any domain

πŸš€ Deployment Status

Component Status URL
Backend API βœ… Live https://clarityai-qrnk.onrender.com
Chrome Extension βœ… Ready Load from /chrome-extension/dist folder
Repository βœ… Public GitHub.com/Tusharwasake/ClarityAI

ClarityAI - Making web content digestible! 🎯

About

A Chrome extension that intelligently extracts and summarizes web content with AI-powered insights. Built with TypeScript, featuring smart content detection, one-click summarization, and a clean interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors