Scrapture is a powerful, self-hosted web scraping framework built with Next.js, Playwright, and BullMQ. It features a beautiful neumorphism design dashboard for monitoring crawl jobs, viewing results, and managing configurations.
- π¨ Neumorphism UI - Beautiful, modern dashboard with dark mode support
- π€ Playwright Integration - Scrape SSR & CSR pages with auto-scroll support
- π Job Queue System - BullMQ + Redis for reliable job processing
- π API Response Capture - Automatically capture XHR/API responses
- πΈ Screenshot Support - Take full-page screenshots
- π§ AI Extraction - Optional Ollama integration for intelligent data extraction
- βοΈ Domain Configs - Per-domain rate limiting, delays, and custom selectors
- π Real-time Logging - Monitor crawl progress with detailed logs
- π³ Docker Ready - Complete Docker Compose setup
- π» CLI Tool - Command-line interface for quick crawls
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Crawler: Playwright (Chromium)
- Queue: BullMQ + Redis
- Database: SQLite (default) or PostgreSQL
- Charts: Recharts
- State: Zustand
- AI: Ollama (optional)
- Node.js 20+
- Redis (or use Docker)
- Ollama (optional, for AI extraction)
- Clone the repository
git clone <repository-url>
cd scrapture- Install dependencies
npm install- Setup environment
cp .env.example .envEdit .env if needed:
DATABASE_URL="file:./dev.db"
REDIS_URL="redis://localhost:6379"
PORT=3000
NODE_ENV=development
OLLAMA_API_URL="http://localhost:11434"- Initialize database
npm run db:push
npm run db:generate- Install Playwright browsers
npx playwright install chromium- Start Redis (if not using Docker)
redis-server- Start the Next.js development server
npm run dev- Start the worker (in a new terminal)
npm run worker- Open the dashboard
http://localhost:3000
The easiest way to run Scrapture is with Docker Compose:
npm run docker:upThis will start:
- Redis server
- Next.js app (port 3000)
- BullMQ worker
Stop services:
npm run docker:downView logs:
npm run docker:logsThe main dashboard provides:
- Quick job submission form
- Real-time job statistics
- Visual charts for job status
- Navigation to all features
View and monitor all crawl jobs:
- Filter by status (pending, queued, running, completed, failed)
- Click any job to see detailed results
- Real-time updates every 3 seconds
Browse completed crawls:
- Thumbnail previews
- Screenshot gallery
- Extracted JSON data
- API responses captured
Create per-domain configurations:
- Custom delays between requests
- Concurrency limits
- Rate limiting
- Custom user agents
- CSS selectors for data extraction
- Enable AI extraction with Ollama
Monitor system logs:
- Real-time log streaming
- Filter by level (info, warn, error)
- Job-specific logs
- Timestamps and detailed messages
Scrapture includes a powerful CLI for quick operations:
Queue a new crawl:
npm run cli crawl https://example.comWith options:
npm run cli crawl https://example.com --priority 10 --no-screenshotView job statistics:
npm run cli statusGET /api/jobs- List all jobs (query:?status=completed&limit=50)POST /api/jobs- Create new crawl jobGET /api/jobs/[id]- Get job detailsDELETE /api/jobs/[id]- Delete job
GET /api/stats- Get job statistics
GET /api/configs- List domain configsPOST /api/configs- Create new configGET /api/configs/[id]- Get configPUT /api/configs/[id]- Update configDELETE /api/configs/[id]- Delete config
Scrapture can use Ollama for intelligent data extraction from HTML.
- Install Ollama
# Visit https://ollama.ai for installation
ollama pull llama2- Enable in Domain Config
- Go to Configs page
- Create or edit a domain config
- Check "Enable AI Extraction"
- Add a custom prompt (e.g., "Extract product title, price, and description")
- Results
- AI-extracted data will appear in job results
- Look for
aiExtractedfield in JSON data
scrapture/
βββ src/
β βββ app/ # Next.js pages
β β βββ api/ # API routes
β β βββ jobs/ # Jobs pages
β β βββ configs/ # Config pages
β β βββ results/ # Results pages
β β βββ logs/ # Logs pages
β βββ components/ # React components
β β βββ NeuCard.tsx
β β βββ NeuButton.tsx
β β βββ NeuInput.tsx
β β βββ Sidebar.tsx
β β βββ DarkModeToggle.tsx
β βββ lib/ # Core libraries
β β βββ crawler.ts # Playwright crawler
β β βββ queue.ts # BullMQ setup
β β βββ db.ts # Prisma client
β βββ types/ # TypeScript types
β βββ generated/ # Prisma generated client
βββ prisma/
β βββ schema.prisma # Database schema
βββ public/
β βββ screenshots/ # Captured screenshots
βββ worker.ts # BullMQ worker process
βββ cli.ts # CLI tool
βββ docker-compose.yml # Docker setup
βββ Dockerfile # App container
βββ Dockerfile.worker # Worker container
Edit src/app/globals.css to customize the neumorphism theme:
:root {
--background: #e0e5ec;
--foreground: #2c3e50;
--shadow-light: #ffffff;
--shadow-dark: #a3b1c6;
}
[data-theme="dark"] {
--background: #1a1a2e;
--foreground: #eaeaea;
--shadow-light: #252540;
--shadow-dark: #0f0f1e;
}We love contributions! Please read our Contributing Guidelines to get started.
- π Report bugs and issues
- π‘ Suggest new features
- π Improve documentation
- π§ Submit pull requests
- β Star the project if you find it useful!
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - feel free to use this project for personal or commercial purposes.
- Built with Next.js
- Powered by Playwright
- Queue system by BullMQ
- UI inspired by neumorphism design principles
Security is important to us. If you discover a security vulnerability, please review our Security Policy for information on how to report it responsibly.
For issues, questions, or contributions, please open an issue on GitHub.
- π Read the Documentation
- π¬ Check existing issues
- β Ask a question by creating a new issue with the
questionlabel - π‘ Suggest features through feature requests
Happy Scraping! π·οΈβ¨