A powerful AI-driven application that transforms outdated websites into modern, responsive designs using LangGraph.js, MCP (Model Context Protocol), TailwindCSS, Next.js 15, and Playwright.
- 🕷️ Intelligent Web Scraping: Automatically extract HTML, CSS, and content from any website using Playwright
- 🎨 AI-Powered Redesign: Generate modern, responsive designs using OpenRouter's cost-effective language models
- 💬 Interactive Chat Interface: Provide feedback and iterate on designs through natural language conversation
- 📱 Responsive Design: All generated websites are mobile-first and fully responsive
- 📦 One-Click Download: Get complete code packages including HTML, CSS, JavaScript, and assets
- ⚡ Modern Tech Stack: Built with Next.js 15, TailwindCSS, and shadcn/ui components
- Frontend: Next.js 15 (App Router), React 19, TypeScript
- Styling: TailwindCSS 4.0, shadcn/ui components
- AI Integration: LangGraph.js, OpenRouter API
- Web Scraping: Playwright
- Package Management: pnpm
- Deployment: Vercel-ready
- Node.js 18+ and pnpm
- OpenRouter API key (sign up at openrouter.ai)
- Clone the repository:
git clone <repository-url>
cd website-visual-optimizer-agent- Install dependencies:
pnpm install- Install Playwright browsers:
pnpm playwright install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your OpenRouter API key:
OPENROUTER_API_KEY=your_api_key_here
NEXT_PUBLIC_APP_URL=http://localhost:3000- Start the development server:
pnpm dev- Open http://localhost:3000 in your browser
- Enter a Website URL: Input any website URL you want to redesign
- Watch the Magic: The AI agent will:
- Scrape the website content
- Analyze the current design
- Generate a modern redesign
- Provide Feedback: Use the chat interface to request specific changes
- Download Your Code: Get a complete ZIP package with all files
Create a .env.local file with:
# Required: OpenRouter API key
OPENROUTER_API_KEY=your_openrouter_api_key_here
# Optional: Application URL (for production)
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Optional: Playwright settings
PLAYWRIGHT_HEADLESS=true
PLAYWRIGHT_TIMEOUT=30000src/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── scrape/ # Web scraping endpoint
│ │ ├── redesign/ # Design generation endpoint
│ │ └── download/ # File download endpoint
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── url-input.tsx # URL input component
│ ├── preview-panel.tsx # Website preview panels
│ ├── chat-interface.tsx # Chat interface
│ ├── download-panel.tsx # Download management
│ └── website-redesigner.tsx # Main app component
├── lib/ # Utility libraries
│ ├── utils.ts # Common utilities
│ ├── openrouter-client.ts # OpenRouter API client
│ ├── playwright-scraper.ts # Web scraping logic
│ ├── mcp-tools.ts # MCP tool definitions
│ └── langgraph-agent.ts # Agent workflow (simplified)
└── types/ # TypeScript type definitions
└── index.ts
POST /api/scrape- Scrape website contentPOST /api/redesign- Generate modern redesignPOST /api/download- Create downloadable ZIP package
The application uses cost-effective AI models:
- Primary:
meta-llama/llama-3.1-8b-instruct:free(free tier) - Fallback:
gpt-4o-mini(low cost) - Estimated monthly cost: < $20 for moderate usage
- Push your code to GitHub
- Connect to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
The application is compatible with any Node.js hosting platform that supports Next.js 15.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For support and questions:
- Open an issue on GitHub
- Check the documentation
- Review the technical design document in
doc/technical-design.md
Note: This application requires an OpenRouter API key. Free tier usage is available for testing, with upgrade options for production use.
