Skip to content

Latest commit

Β 

History

183 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 SuperBrowser

An AI-native browser that searches across engines, understands what you're researching, and answers with context.

SuperBrowser pairs a multi-engine search aggregator with a context-aware AI that remembers what you've searched and read β€” per tab β€” to deliver smarter, grounded answers. It ships as both a web app and a cross-platform desktop app.


Live Demo Download Desktop License: MIT

React Vite FastAPI Python Electron TailwindCSS Groq


πŸš€ Quick Links

🌐 Live Web App superbrowser-d6441.web.app
πŸ’Ύ Desktop App Download .exe / .dmg / .AppImage from the live website
πŸ“¦ Repository github.com/PandyaJeet/SuperBrowser
🀝 Contributing CONTRIBUTING.md · Code of Conduct

πŸ“‹ Table of Contents


πŸ’‘ Why SuperBrowser?

Traditional search hands you ten blue links and forgets everything the moment you click away. SuperBrowser does three things differently:

  1. πŸ”Ž One query, many engines. It searches Google, Bing, and DuckDuckGo at once β€” with automatic scraper fallbacks if an API call fails β€” so you get broader, deduplicated results from a single box.
  2. 🧠 It remembers your research. Every query you run and every page you open is captured into a per-tab context. Open a new tab and you get a clean slate; stay in one and your trail compounds.
  3. πŸ€– The AI uses that context. When you switch to AI mode and ask a follow-up, the assistant already knows what you've been looking at β€” so answers are grounded in your session, not generic.

The result is a research loop: Search β†’ Context captured β†’ Ask AI β†’ Smarter answer.


✨ Features

πŸ” SuperSEO β€” Multi-Engine Search

  • Aggregated results from Google, Bing, and DuckDuckGo behind one search box.
  • Resilient fallback: if SerpAPI returns nothing or errors, SuperBrowser transparently switches to direct web scrapers (BeautifulSoup) for the same engine.
  • Deduplication & ranking across sources, plus Google Shopping results for product queries.
  • Response caching with X-Cache: HIT/MISS headers to keep repeat searches fast.

πŸ€– SuperAI β€” Persona-Based, Context-Aware Chat

  • Five answer styles: default, chatgpt, gemini, perplexity, and claude, each driven by its own system prompt.
  • Smart live-data routing: a lightweight classifier decides whether your question needs fresh web data (prices, comparisons, news) or can be answered from the model's general knowledge β€” and only scrapes when it helps.
  • Grounded in your session: the assistant references your recent searches and visited pages for relevant, personalized answers.
  • Powered by Groq for low-latency inference across Llama 3.1/3.3, Mixtral, and Gemma models.

πŸ—£οΈ Community Insights

  • Pulls real discussion from Stack Overflow, Reddit, Hacker News, and Dev.to.
  • AI-summarized into consensus, tips, debates, and warnings β€” so you skip the doom-scroll.

🧠 Per-Tab Context Engine

  • Automatically tracks your queries, results, and visited-page content (first ~5,000 chars).
  • Isolated per tab β€” each tab is its own research thread.
  • Visual context badge shows what's being tracked (🧠 Context: X searches, Y results).
  • One-click JSON export of an entire session for archival or sharing.

πŸ–₯️ Modern, Dual-Platform UI

  • Tab-based browsing with independent state per tab.
  • Dark / Light themes, persisted across sessions.
  • Smooth motion via Framer Motion, 3D accents via Three.js, and Markdown export of results.
  • Runs in the browser or as a native Electron desktop app (Windows / macOS / Linux).

βš™οΈ How It Works

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   1. Search "react hooks"      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   You type   β”‚ ─────────────────────────────► β”‚  Multi-engine search β”‚
   β”‚   a query    β”‚                                β”‚  (SerpAPI ↔ scrapers)β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ◄───────────────────────────── β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚              results returned + cached
          β”‚
          β–Ό  2. Query + results auto-saved to this tab's context
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   🧠 Per-Tab Context:  queries Β· results Β· visited pages       β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β–Ό  3. Switch to AI mode, pick a persona, ask a follow-up
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    classify β†’ (scrape if needed) β†’ synthesize   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚   SuperAI    β”‚ ◄───────────────────────────────────────────── β”‚  Groq  β”‚
   β”‚  (context-   β”‚                                                 β”‚  LLMs  β”‚
   β”‚   aware)     β”‚ ──► "Based on your searches about react hooks…" β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—οΈ Architecture

SuperBrowser is a decoupled two-tier app: a React/Vite frontend talks to a FastAPI backend over REST. In desktop mode, Electron bundles and supervises the Python backend locally.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  FRONTEND β€” React 19 + Vite (web)  Β·  Electron 39 (desktop)          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Tab Mgr  β”‚  β”‚ Search Bar β”‚  β”‚ useContextManager (per-tab hook)β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚  REST  (http://localhost:8000/api/…)
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  BACKEND β€” FastAPI (Uvicorn, async)                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ /search/seo  β”‚ β”‚ /search/ai   β”‚ β”‚ /search/     β”‚ β”‚ /context/*  β”‚ β”‚
β”‚  β”‚              β”‚ β”‚ /contextual  β”‚ β”‚ community    β”‚ β”‚ (per tab)   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  query classifier Β· persona engine Β· summarizers Β· caching layer    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚                                     β”‚
                β–Ό                                     β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  SerpAPI      β”‚  ── fallback ──►    β”‚  Web Scrapers      β”‚
        β”‚  Groq LLM API β”‚                     β”‚  (BeautifulSoup)   β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Note: Browsing context is scoped per session_id β†’ tab_id, cached in memory, and persisted as JSON under CONTEXT_STORE_DIR. Context-chat messages use SQLite. Both locations can be redirected to durable storage.


🧰 Tech Stack

Layer Technologies
Frontend React 19, Vite, TailwindCSS, Framer Motion, Three.js / React Three Fiber, Recharts
Desktop Electron 39, electron-builder (NSIS Β· DMG Β· AppImage)
Backend Python 3.10+, FastAPI, Uvicorn, httpx, BeautifulSoup4, cachetools
AI & Search Groq (Llama 3.1/3.3, Mixtral, Gemma), SerpAPI, custom scrapers
Hosting / CI Firebase Hosting, GitHub Actions

πŸ› οΈ Getting Started

Prerequisites

1. Clone the repo

git clone https://github.com/PandyaJeet/SuperBrowser.git
cd SuperBrowser

2. Start the backend

cd backend
pip install -r requirements.txt
cp .env.example .env

Now generate a session token β€” the backend will not serve any search or context route without one:

python -c "import secrets; print(secrets.token_urlsafe(32))"

Put that value in backend/.env as SUPERBROWSER_SESSION_TOKEN, keep it handy for the frontend step, then start the server:

uvicorn main:app --reload --host 0.0.0.0 --port 8000

The API will be available at http://localhost:8000, with interactive docs at http://localhost:8000/docs.

⚠️ If you skip the token, every /api/search/* and /api/context/* request returns HTTP 500 β€” "Server authentication not configured". The backend fails closed by design and prints a warning at startup telling you exactly this.

Port already in use? lsof -ti:8000 | xargs kill -9

3. Start the frontend

In a second terminal:

cd frontend
npm install
cp .env.example .env.local

Set VITE_SUPERBROWSER_SESSION_TOKEN in frontend/.env.local to the same token you put in backend/.env, then:

npm run dev -- --host 0.0.0.0

Open http://localhost:5173 in your browser. The frontend auto-detects its API base (local, Codespaces, or Electron), so no extra config is needed for local dev.

If the two tokens do not match, searches fail with a visible "Not authorised" banner. That is the expected signal β€” not a silent empty result list.

The desktop app needs neither variable: Electron generates its own token on first launch and injects it over IPC.


πŸ” Configuration

Create a .env file inside the backend/ directory:

# Required β€” shared secret guarding /api/search/* and /api/context/*
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
SUPERBROWSER_SESSION_TOKEN=your_generated_token

# Required β€” powers SuperSEO search across Google, Bing & DuckDuckGo
SERPAPI_API_KEY=your_serpapi_key

# Required β€” powers all SuperAI responses & summaries
GROQ_API_KEY=your_groq_key

# Optional β€” CORS allow-list (comma-separated). Defaults to http://localhost:5173
ALLOWED_ORIGINS=http://localhost:5173

# Optional β€” where per-tab context JSON is persisted.
# Defaults to /tmp/superbrowser_contexts.
CONTEXT_STORE_DIR=/tmp/superbrowser_contexts
Variable Required Purpose Get a key
SUPERBROWSER_SESSION_TOKEN βœ… Auth token for all search & context routes. Backend returns HTTP 500 on every gated route without it generate locally (below)
SERPAPI_API_KEY (or SERP_API_KEY) βœ… Live search results for SuperSEO serpapi.com
GROQ_API_KEY βœ… LLM inference for SuperAI & summaries console.groq.com
ALLOWED_ORIGINS ⬜ CORS origins for the backend β€”
CONTEXT_STORE_DIR ⬜ Directory for persisted per-tab context. Defaults to /tmp/superbrowser_contexts β€”

Frontend environment

Create frontend/.env.local (template: frontend/.env.example):

Variable Required Purpose
VITE_SUPERBROWSER_SESSION_TOKEN βœ… (web build) Must exactly match the backend's SUPERBROWSER_SESSION_TOKEN. Mismatched or missing β‡’ every search returns 401 and the UI shows a "Not authorised" banner
VITE_API_BASE ⬜ Override the auto-detected backend URL
VITE_API_BASE_ELECTRON ⬜ Override the backend URL in desktop mode

Generating the token β€” run once and use the same value on both sides:

python -c "import secrets; print(secrets.token_urlsafe(32))"

Desktop app: neither token variable is needed. Electron generates its own token on first launch, stores it in settings.json, passes it to the backend it spawns, and attaches it over IPC β€” so it never reaches renderer JavaScript.

Live desktop search and AI still require provider credentials. In the desktop app, open Settings β†’ Open provider key file, add SERPAPI_API_KEY and GROQ_API_KEY, save, and restart SuperBrowser. Electron creates this per-user provider-credentials.txt file in its user-data directory and passes it to the bundled backend through SUPERBROWSER_ENV_FILE; credentials are not embedded in the installer. Existing process environment variables take precedence.

Note: VITE_* values are bundled into the client build and are visible to anyone who loads the page. This token gates a self-hosted backend; it is not a per-user credential.

If any SerpAPI engine fails or returns nothing, SuperSEO automatically falls back to the matching web scraper β€” so search keeps working even without a perfect API response.


πŸ–₯️ Running the Desktop App

SuperBrowser can run as a native Electron app that spawns and supervises the Python backend for you.

cd frontend

# Dev: runs Vite + Electron together with hot reload
npm run dev:electron

# Build distributables
npm run dist:win     # Windows  β†’ NSIS installer
npm run dist:mac     # macOS    β†’ .dmg
npm run dist:linux   # Linux    β†’ .AppImage

The distribution commands first build an isolated, pinned PyInstaller environment under backend/.pyi-build, produce a self-contained backend executable, and then bundle it with Electron. Python is required on the build machine but is not required on an end user's machine.

In desktop mode Electron selects an available loopback port, injects the endpoint through the preload bridge, stores app data under Electron's user-data directory, and terminates the backend process on application exit. A single-instance lock prevents duplicate primary instances.


πŸ“š API Reference

All routes are served under http://localhost:8000. Full interactive docs (Swagger UI) live at /docs.

Search

Method Endpoint Description
GET /api/search/seo?q={query} Multi-engine search with scraper fallback.
GET /api/search/ai?q={query}&persona={p}&gl={region} AI answer (persona-styled, region-aware).
POST /api/search/ai/contextual AI answer using full browsing context (body below).
GET /api/search/community?q={query} Summarized insights from SO, Reddit, HN, Dev.to.
Example β€” contextual AI request
POST /api/search/ai/contextual
Content-Type: application/json

{
  "query": "How do I use these together?",
  "persona": "perplexity",
  "context": {
    "queries": ["react hooks", "useEffect"],
    "results": [ { "title": "...", "url": "...", "snippet": "..." } ],
    "visited_pages": [ { "url": "...", "content": "..." } ]
  }
}

persona is one of: default Β· chatgpt Β· gemini Β· perplexity Β· claude.

Context Management

Method Endpoint Description
POST /api/context/session/start Start a browsing session.
POST /api/context/add_query Add a query to a tab's context.
POST /api/context/add_results Add search results to a tab's context.
POST /api/context/add_visited_page Add visited-page content to context.
GET /api/context/get/{session_id}/{tab_id} Fetch a tab's context.
GET /api/context/export/{session_id} Export the full session context as JSON.
POST /api/context/chat Chat with the AI about your browsing context.
DELETE /api/context/clear/{session_id}/{tab_id} Clear one tab's context.

For deeper detail see CONTEXT_FEATURE.md and TESTING.md.


πŸ“‚ Project Structure

SuperBrowser/
β”œβ”€β”€ backend/                 # FastAPI app
β”‚   β”œβ”€β”€ main.py              # App entry point & router mounting
β”‚   β”œβ”€β”€ routers/             # seo Β· ai Β· community Β· context endpoints
β”‚   β”œβ”€β”€ services/            # groq, super_ai, query_classifier, personas, summarizers
β”‚   β”œβ”€β”€ scrapers/            # Google/Bing/DDG + SO/Reddit/HN/Dev.to scrapers
β”‚   β”œβ”€β”€ utils/               # caching helpers
β”‚   └── requirements.txt
β”œβ”€β”€ frontend/                # React + Vite + Electron
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx          # App shell, tabs, search dispatch
β”‚   β”‚   β”œβ”€β”€ components/      # AiInput, CommunityResults, ProductCarousel, …
β”‚   β”‚   β”œβ”€β”€ config/apiBase.js# API base resolution (web/Codespaces/Electron)
β”‚   β”‚   └── useContextManager.js
β”‚   └── electron/            # main.cjs, preload.cjs (desktop runtime)
β”œβ”€β”€ systemprompt/            # Persona system prompts (perplexity, sonnet, …)
└── .github/workflows/       # CI: star-check, auto-label

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for setup, issue-claim, branch-naming, and PR conventions, and review our Code of Conduct.

For GSSoC contributions, comment your proposed approach on an issue and wait for assignment before coding.

⭐ Please star this repository before submitting a pull request. Starring is required for your PR to be merged. A star-check workflow reports whether the PR author has starred the repo, and maintainers will not merge unstarred contributions.


πŸ“„ License

Released under the MIT License.


πŸ‘¨β€πŸ’» Authors

Profile Name GitHub
Jeet Pandya Jeet Pandya @PandyaJeet
Prince Patel Prince Patel @Princepatel-027

Contributors

Akanksha-73Antra1705Himanshujha7KrishtiyNicks-19PandyaJeetYashKrTripathianshul23102divyanshim27goyalpreeti009harshapriyag123itsdakshjainkhushboo-khatoonmittalsonalpranavv2707rishit537saurabhhhcodesshriyashkulkarni4-osstoufiq00007vipul674vishal-kushwaha-9912

Updates automatically as new contributors merge pull requests. Start contributing and see your profile here?


Built using React, FastAPI, and AI.
⭐ If SuperBrowser helps you, give it a star!

About

SuperBrowser is a next-generation browsing platform that unifies search engines, AI tools, and community insights into a single interface. It introduces mode-based browsing (SEO, AI, Review) along with a shared context window, allowing users to switch between workflows without losing context or repeating inputs-making browsing faster & smarter

Topics

Resources

Code of conduct

Contributing

Stars

23 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages