An AI-powered tool that analyzes screenshots of webpages and generates pixel-perfect HTML, CSS, and JavaScript replicas using Google's Gemini API.
- Screenshot Analysis: Upload any webpage screenshot for AI analysis
- Code Generation: Automatically generates HTML, CSS, and JavaScript
- Visual Comparison: AI-powered similarity scoring between original and generated pages
- Unique URLs: Each generated page gets a unique URL for easy sharing
- Form Focused: Optimized for replicating signup forms, contact forms, and similar interfaces
- Responsive Design: Generated pages include responsive CSS for mobile compatibility
- Node.js 18+ installed
- Google Gemini API key
git clone <your-repo-url>
cd Signup-page-gen
cd backend
npm install
cp .env.example .env
Edit the .env
file and add your Gemini API key:
GEMINI_API_KEY=your_actual_api_key_here
cd ../frontend
npm install
Terminal 1 - Backend:
cd backend
npm run dev
Terminal 2 - Frontend:
cd frontend
npm start
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Generated pages: http://localhost:3001/{page-id}
- Upload Screenshot: Click the upload area or drag & drop a webpage screenshot
- Generate Page: Click "Generate Webpage" to create the HTML replica
- View Results: Access your generated page via the provided URL
- Compare Quality: Review the AI's similarity analysis and improvement suggestions
Upload a screenshot and generate a webpage replica.
Request:
screenshot
(file): Image file (PNG, JPG, etc.)
Response:
{
"success": true,
"pageId": "uuid-string",
"url": "http://localhost:3001/uuid-string",
"previewUrl": "http://localhost:3001/uuid-string/index.html"
}
Compare the generated page with the original screenshot.
Response:
{
"success": true,
"pageId": "uuid-string",
"comparison": {
"similarity_score": 8,
"layout_score": 9,
"color_score": 7,
"typography_score": 8,
"positioning_score": 9,
"feedback": "Detailed analysis...",
"improvements": ["suggestion1", "suggestion2"]
}
}
List all generated pages.
Health check endpoint.
Signup-page-gen/
├── backend/ # Express.js API server
│ ├── server.js # Main server file
│ ├── package.json # Backend dependencies
│ └── .env.example # Environment variables template
├── frontend/ # Static web interface
│ ├── index.html # Main frontend application
│ └── package.json # Frontend dependencies
├── generated-pages/ # Stores generated HTML files
└── README.md # Project documentation
This tool is particularly effective for:
- Signup Forms: User registration pages
- Contact Forms: Customer inquiry forms
- Onboarding Forms: Multi-step user onboarding
- Survey Forms: Data collection interfaces
- Login Pages: Authentication interfaces
- Landing Pages: Simple promotional pages
GEMINI_API_KEY
: Your Google Gemini API key (required)PORT
: Backend server port (default: 3001)GEMINI_MODEL
: AI model to use (default: gemini-2.0-flash-exp)
- PNG
- JPG/JPEG
- WebP
- GIF (static)
- Maximum upload size: 10MB
- Recommended: Under 5MB for best performance
- Requires active internet connection for AI processing
- Complex interactive elements may need manual refinement
- Dynamic content (data from APIs) cannot be replicated
- Performance depends on Gemini API availability
- API keys are stored in environment variables
- File uploads are validated for type and size
- Generated content is served from isolated directories
- No user data is permanently stored
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
"Failed to generate page"
- Check your Gemini API key is valid
- Ensure the image is under 10MB
- Try a different image format
"Cannot connect to backend"
- Verify backend is running on port 3001
- Check for CORS issues in browser console
"Poor similarity score"
- Try uploading a clearer screenshot
- Ensure the original page has good contrast
- Consider simpler layouts for better results
- Check the browser console for errors
- Review backend logs for API issues
- Ensure all dependencies are installed correctly
Built with ❤️ using Google Gemini AI