Skip to content

Latest commit

Β 

History

History
55 lines (41 loc) Β· 2.13 KB

PROJECT_SUMMARY.md

File metadata and controls

55 lines (41 loc) Β· 2.13 KB

Project Summary

What This Is

A web application for AI-powered browser automation. Users type natural language commands in a chat interface, and an AI vision model analyzes the browser screenshot to find and click elements.

Stack

  • Frontend: React 18, WebSocket, CSS (no UI libraries)
  • Backend: FastAPI, Playwright (headless Chromium), OpenAI SDK β†’ OpenRouter API
  • AI Models: Configurable vision model (default: nvidia/nemotron-nano-12b-v2-vl:free) + bbox processor (alibaba/tongyi-deepresearch-30b-a3b:free)

How It Works

  1. User enters a URL β†’ Playwright navigates to it
  2. User sends a chat message β†’ backend captures screenshot
  3. Screenshot + message sent to vision model β†’ returns bounding box coordinates
  4. Coordinates cleaned by a second model β†’ backend generates JS click code
  5. JS executed in browser β†’ updated screenshot sent back

Quick Start

# Backend
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
playwright install chromium
cd backend && uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Frontend (separate terminal)
cd frontend && npm install && npm start

Set your OpenRouter API key via the πŸ”‘ button in the UI.

Known Limitations

  • No authentication or user sessions
  • Single shared browser instance
  • API key saved in plaintext to backend/config.json
  • In-memory chat history (lost on restart)
  • AI-generated JavaScript executed without sandboxing
  • Not suitable for public/production deployment without additional security

File Overview

File Purpose
backend/main.py FastAPI app, WebSocket handler, bbox β†’ JS pipeline
backend/browser_manager.py Playwright lifecycle, screenshots, JS execution
backend/openrouter_client.py OpenAI SDK client, vision + bbox processor calls
frontend/src/App.js Main React component, WebSocket routing, modals
frontend/src/components/BrowserView.js Screenshot display, URL bar, bbox overlay
frontend/src/components/ChatPanel.js Chat message list and input
frontend/src/hooks/useWebSocket.js WebSocket connection with auto-reconnect