Web2Gif is a modern, high-performance web application that captures any website URL and converts it into a smooth, optimized GIF. Built with Next.js 15, Playwright, and Prisma, it provides a seamless experience for capturing website interactions, animations, or portfolio showcases.
- High-Quality Captures: Uses Playwright (Chromium) to capture pixel-perfect frames of any URL.
- Optimized GIFs: Advanced encoding using
gifskiandgifsiclefor the best quality-to-size ratio. - Job Polling Architecture: Lightweight, reliable background processing using SQLite polling.
- Flexible Storage: Support for both local filesystem storage and AWS S3/Cloudflare R2.
- Responsive UI: Modern interface with smooth animations (Framer Motion) and Tailwind CSS v4.
- Secure: Built-in SSRF protection and rate limiting.
- Frontend: Next.js 15 (App Router), React 19, Framer Motion, Tailwind CSS v4
- Database: Prisma + SQLite (Primary store for jobs and workers)
- Engine: Playwright (Headless Chromium)
- Encoding: FFmpeg, gifski, and gifsicle
- Storage: Local Filesystem or S3-compatible (S3, R2, Minio)
Before running the project locally, ensure you have the following installed on your machine:
- Node.js: version 20.0.0 or higher.
- npm or yarn or pnpm.
- System Binaries (for GIF encoding):
- macOS (Homebrew):
brew install ffmpeg gifski gifsicle
- Ubuntu/Debian:
sudo apt-get update sudo apt-get install -y ffmpeg gifski gifsicle
- macOS (Homebrew):
-
Clone the repository:
git clone https://github.com/your-username/web2gif.git cd web2gif -
Install dependencies:
npm install
-
Install Playwright Browsers: This ensures the worker has the necessary browser binaries to capture screenshots.
npx playwright install --with-deps chromium
-
Environment Setup: Copy the example environment file and update your configuration.
cp .env.example .env.local
(For SQLite, the default
DATABASE_URL="file:./prisma/dev.db"is already configured.) -
Initialize Database (Prisma): Create the SQLite database and apply migrations.
npx prisma migrate dev --name init
You need at least two terminals running simultaneously for the project to work:
Starts the Next.js development server on http://localhost:3000.
npm run devStarts the background process that polls the database and processes the GIF generation.
npm run worker:devIf you prefer to run the application using Docker, a docker-compose.yml is provided. While development focuses on SQLite, you can containerize the application as follows:
First, ensure you have a Dockerfile in the root. Then run:
docker-compose up --buildWhen running in Docker, ensure your DATABASE_URL in .env points to a path that is persistent (e.g., inside a volume).
.
├── prisma/ # Database schema and migrations
├── src/
│ ├── app/ # Next.js App Router (API and UI)
│ ├── components/ # UI components
│ └── lib/ # Shared utilities (DB, Storage, Queue)
├── worker/ # Background job processor (Playwright + FFmpeg)
├── public/ # Static assets and local GIF outputs
└── package.json # Project scripts and dependencies
POST /api/generate
{
"url": "https://remix.run",
"options": {
"preset": "standard"
}
}GET /api/status/:jobId
{
"status": "PROCESSING",
"progress": "Capturing frame 8/15"
}This project is licensed under the MIT License.