Clone any website and edit it with AI-powered precision.
- 🌐 Website Cloning: Clone any website by URL or upload HTML files
- ✏️ Visual Editing: Click to select and edit any element
- 🤖 AI-Powered Editing: Use AI to modify specific elements or entire pages
- 📸 Image Replacement: Click images to replace them instantly
- 🎯 Element-Specific AI: Select any element and apply AI changes to just that part
- 🔗 GitHub Integration: Push your edited projects directly to GitHub
- 📦 Export Options: Download as ZIP or push to version control
- 💾 Project Management: Save and manage multiple projects locally
You can now connect your GitHub account and push your edited projects directly to GitHub repositories!
- Click "Connect GitHub" in the editor sidebar
- Authorize PixelTwin with your GitHub account
- Enter a repository name
- Click "Push to GitHub" - the app will:
- Create the repository if it doesn't exist
- Push your edited HTML as
index.html - Open the repository in a new tab
See GITHUB_SETUP.md for detailed setup instructions.
git clone https://github.com/yourusername/pixeltwin.git
cd pixeltwinnpm installCopy env.example to .env and fill in your credentials:
cp env.example .envRequired environment variables:
GROQ_API_KEY: Get from Groq ConsoleGITHUB_ID&GITHUB_SECRET: See GITHUB_SETUP.mdNEXTAUTH_URL: Your app URL (http://localhost:3000 for development)NEXTAUTH_SECRET: Generate withopenssl rand -base64 32
npm run devOpen http://localhost:3000 in your browser.
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS v4
- Language: TypeScript
- Backend: Next.js API Routes
- Parsing: Cheerio
- Icons: Lucide React
-
Clone the repository
git clone <repo-url> cd pixeltwin
-
Install dependencies
npm install
-
Environment Variables Create a
.env.localfile in the root directory:# Optional: For Supabase integration (future use) NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key # Optional: For AI features (if using OpenAI/Gemini) AI_API_KEY=your_api_key
-
Run Locally
npm run dev
Open http://localhost:3000 in your browser.
The app is ready to be deployed on Vercel.
- Push code to GitHub.
- Import project in Vercel.
- Add environment variables if needed.
- Deploy.
- Clone a Site: Enter a URL (e.g.,
https://example.com) on the home page and click "Clone". - Edit:
- Click on any text to edit it inline.
- Use the sidebar tools to add/modify elements.
- Use the "AI Magic Edit" box to describe changes.
- Save: Click "Save" to store changes locally.
- Export: Click "Export" to download a Zip file of your site.
- Cloning Logic:
src/app/api/clone/route.tsfetches the HTML and resolves relative URLs to absolute ones to ensure assets load. Scripts are stripped to prevent conflicts. - Editor:
src/app/editor/[id]/page.tsxuses aniframeto sandbox the cloned site. It injects a script into the iframe to handle click events and communicate with the parent editor viapostMessage. - Project Storage: Currently uses
localStorageviasrc/lib/project-manager.ts. Can be easily swapped with Supabase by updating this file.
- Implement real AI integration in
src/app/api/ai/route.ts. - Connect Supabase for cloud storage and auth.
- Improve CSS parsing to handle complex stylesheets.