Transform natural language descriptions into production-ready Figma designs using AI.
UIgenie is a Figma plugin that generates complete UI designs from text prompts. Simply describe what you want, and UIgenie creates fully editable Figma components with proper styling, layout, and structure.
Example: "Create a modern login screen with email and password fields" β Generates a complete login screen with all elements properly styled and positioned.
- AI-Powered Generation: Uses multiple AI models (Google Gemini, OpenAI, Anthropic, OpenRouter)
- Smart Fallback: Automatically switches between providers if one is rate-limited
- Live Preview: See your design before importing to Figma
- Multiple Modes: Generate full mockups or reusable components
- Image-to-UI: Upload an image and convert it to a Figma design
- Screen Size Detection: Automatically detects device type (mobile, tablet, desktop)
- Authentication: User accounts with JWT-based authentication
- Coin System: Pay-per-use pricing with different plans
- Design History: Save and retrieve previous designs
- Refinement: Iterate on designs with additional prompts
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FIGMA PLUGIN UI (Preact) β
β User Input β Preview β Import to Figma β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HTTP
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND API (Node.js/Express) β
β Auth β Design Service β LLM Service β AI Models β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JSON
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FIGMA PLUGIN CODE β
β Controller β Generators β Node Creators β Figma Canvas β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Node.js 18+ and npm
- Figma Desktop App
- PostgreSQL 15+ (optional, for full features)
- API key for at least one AI provider
# Clone repository
git clone <repository-url>
cd UIgenie
# Install frontend dependencies
npm install
# Install backend dependencies
cd backend
npm install
cd ..cd backend
cp .env.example .envEdit backend/.env and add at least one API key:
# Google AI (FREE - Recommended)
GOOGLE_AI_API_KEY=your-key-from-makersuite.google.com
# OR OpenAI
OPENAI_API_KEY=your-openai-key
# OR Anthropic
ANTHROPIC_API_KEY=your-anthropic-key
# OR OpenRouter (17 free models)
OPENROUTER_API_KEY=your-openrouter-keycd backend
npm startBackend will run on http://localhost:3000
# From root directory
npm run build- Open Figma Desktop App
- Go to Plugins β Development β Import plugin from manifest
- Select
manifest.jsonfrom the project root - Plugin will appear in Plugins β Development β UIgenie
- Open UIgenie plugin in Figma
- Type a prompt: "Create a modern login screen"
- Click Generate
- Preview the design
- Click Import to Figma
UIgenie/
βββ src/ # Frontend (Preact)
β βββ components/ # UI components
β β βββ LeftPanel/ # Prompt input, header
β β βββ RightPanel/ # Canvas preview
β β βββ Sidebar/ # History, plans
β β βββ Auth/ # Login, signup, user menu
β β βββ shared/ # Buttons, modals, loading
β βββ hooks/ # React hooks
β β βββ usePrompt.ts # Design generation logic
β β βββ useCanvas.ts # Canvas state management
β β βββ useHistory.ts # Design history
β βββ services/ # API services
β β βββ llmService.ts # Backend API calls
β β βββ AuthService.ts # Authentication
β β βββ billingService.ts # Plans and billing
β β βββ figmaService.ts # Figma integration
β βββ utils/ # Utilities
β β βββ designParser.ts # JSON parsing
β β βββ componentGenerator.ts # Component creation
β β βββ responsiveHelper.ts # Screen size detection
β βββ shared/ # Shared code
β β βββ types/ # TypeScript types
β β βββ schemas/ # Zod schemas
β β βββ constants/ # Constants
β βββ __tests__/ # Tests
β
βββ backend/ # Backend API
β βββ src/
β β βββ routes/ # API routes
β β β βββ auth.routes.ts # Authentication
β β β βββ design.routes.ts # Design generation
β β β βββ billing.routes.ts # Plans
β β β βββ coins.routes.ts # Coin management
β β βββ services/ # Business logic
β β β βββ auth.service.ts # User auth
β β β βββ design.service.ts # Design generation
β β β βββ billing.service.ts # Plans
β β β βββ coins.service.ts # Coins
β β β βββ database.service.ts # PostgreSQL
β β β βββ llm/ # LLM adapters
β β β βββ llm.service.ts # Orchestration
β β β βββ gemini.adapter.ts # Google AI
β β β βββ openai.adapter.ts # OpenAI
β β β βββ anthropic.adapter.ts # Claude
β β β βββ openrouter.adapter.ts # OpenRouter
β β βββ middleware/ # Express middleware
β β β βββ auth.ts # JWT verification
β β βββ types/ # TypeScript types
β β βββ index.ts # Server entry
β βββ database/ # Database
β β βββ init.sql # Schema
β β βββ README.md # Setup guide
β βββ .env.example # Environment template
β
βββ plugin/ # Figma plugin code
β βββ controller.ts # Message handler
β βββ generators/ # Design generators
β β βββ mockupMode.ts # Full screen designs
β β βββ componentMode.ts # Reusable components
β βββ figmaAPI/ # Figma API wrappers
β β βββ nodeCreator.ts # Create nodes
β β βββ styleApplier.ts # Apply styles
β β βββ layoutBuilder.ts # Build layouts
β β βββ frameManager.ts # Frame management
β βββ utils/ # Utilities
β βββ layoutEngine.ts # Auto-layout
β βββ constraintsHelper.ts # Responsive constraints
β
βββ dist/ # Build output
βββ lib/ # Plugin entry point
βββ public/ # Static assets
βββ manifest.json # Figma plugin manifest
βββ package.json # Frontend dependencies
βββ tsconfig.json # TypeScript config
βββ vite.config.ts # Vite config
βββ vitest.config.ts # Test config
# Server
PORT=3000
NODE_ENV=development
# Database (Optional - for full features)
DATABASE_URL=postgresql://user:password@localhost:5432/uigenie
DB_HOST=localhost
DB_PORT=5432
DB_NAME=uigenie
DB_USER=uigenie_user
DB_PASSWORD=your_password
# JWT (Required for auth)
JWT_SECRET=your_very_long_random_secret_min_32_characters
JWT_REFRESH_SECRET=another_very_long_random_secret_min_32_chars
# LLM Providers (At least one required)
GOOGLE_AI_API_KEY=your-google-key
OPENAI_API_KEY=your-openai-key
ANTHROPIC_API_KEY=your-anthropic-key
OPENROUTER_API_KEY=your-openrouter-key
# Coin Pricing (Optional)
COIN_PRICE_SIMPLE=5
COIN_PRICE_MEDIUM=10
COIN_PRICE_COMPLEX=20
# Plans (Optional)
FREE_PLAN_COINS=50
PRO_PLAN_COINS=300
ENTERPRISE_PLAN_COINS=1000
# CORS (Optional)
CORS_ORIGIN=http://localhost:5173
# Rate Limiting (Optional)
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100Create .env in root directory:
VITE_BACKEND_URL=http://localhost:3000For full features (auth, billing, history), set up PostgreSQL:
# macOS
brew install postgresql@15
brew services start postgresql@15
# Ubuntu/Debian
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
# Windows
# Download from https://www.postgresql.org/download/windows/# Connect to PostgreSQL
psql -U postgres
# Create database and user
CREATE DATABASE uigenie;
CREATE USER uigenie_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE uigenie TO uigenie_user;
\qcd backend
psql -U uigenie_user -d uigenie -f database/init.sqlDATABASE_URL=postgresql://uigenie_user:secure_password@localhost:5432/uigenie
DB_HOST=localhost
DB_PORT=5432
DB_NAME=uigenie
DB_USER=uigenie_user
DB_PASSWORD=secure_passwordcd backend
npm startCreate a login screen
Design a product card
Build a dashboard with charts
Make a settings page
Create a modern login screen with:
- Email input field
- Password input field
- Blue login button
- "Forgot password?" link
- Social login buttons (Google, Facebook)
Create an iPhone 14 Pro login screen
Design a tablet dashboard (1024x768)
Build a desktop web app (1440x900)
- Click the image upload button
- Select an image
- Type: "Convert this to a Figma design"
- Click Generate
POST /api/auth/signup # Create account
POST /api/auth/login # Login
GET /api/auth/user # Get current user
POST /api/auth/refresh # Refresh token
POST /api/auth/logout # Logout
POST /api/design/generate # Generate design
POST /api/design/refine # Refine design
GET /api/design/history # Get history
GET /api/design/:id # Get specific design
GET /api/billing/plans # Get plans
POST /api/billing/upgrade # Upgrade plan
GET /api/coins/balance # Get coin balance
GET /api/coins/transactions # Get transactions
GET /api/llm/providers # Get available providers
POST /api/llm/select # Set preferred provider
- 50 coins/month
- Basic AI models
- 4 design variations
- Design history
- 300 coins/month
- All AI models
- 4 design variations
- Priority support
- 1000 coins/month
- All AI models
- Unlimited variations
- Priority support
- Custom integrations
- Simple designs (β€5 components): 5 coins
- Medium designs (6-15 components): 10 coins
- Complex designs (>15 components): 20 coins
npm testcd backend
npm testcd backend
node test-backend-services.jscd backend
node test-auth.js# Start dev server with hot reload
npm run devcd backend
# Start with auto-reload
npm run dev
# Or direct TypeScript execution
npm run dev:direct# Build frontend and plugin
npm run build
# Build backend
cd backend
npm run build# Check if port 3000 is in use
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
# Check environment variables
cd backend
cat .env
# Verify API keys
node check-api-keys.js- Ensure
dist/folder exists - Run
npm run build - Check
manifest.jsonis in root - Restart Figma Desktop App
- Re-import plugin manifest
# Check backend logs
cd backend
npm start
# Test LLM providers
curl http://localhost:3000/api/llm/providers
# Verify API keys are valid
node check-api-keys.js# Check PostgreSQL is running
sudo systemctl status postgresql # Linux
brew services list # macOS
# Test connection
psql -U uigenie_user -d uigenie -c "SELECT NOW();"
# Check DATABASE_URL in .env
echo $DATABASE_URL- Open browser console (F12)
- Check for errors
- Verify design JSON structure
- Clear cache: Delete
node_modules/.vite - Restart dev server
- UIGENIE_WORKFLOW.md - Complete workflow explanation
- PLUGIN_WORKFLOW.md - Technical workflow details
- BACKEND_SERVICES_GUIDE.md - Backend API guide
- AUTH_TESTING_GUIDE.md - Authentication testing
- backend/database/README.md - Database setup
- backend/SETUP.md - Backend setup guide
- Password hashing with bcrypt
- JWT access and refresh tokens
- Token expiry (1h access, 7d refresh)
- Rate limiting (100 req/15min)
- CORS protection
- SQL injection protection
- Input validation
- Secure environment variables
- Set
NODE_ENV=production - Use strong JWT secrets
- Enable SSL for database
- Use managed database (AWS RDS, etc.)
- Enable HTTPS
- Configure CORS for production domain
- Set up monitoring and logging
- Regular database backups
- Build production version:
npm run build - Test thoroughly in Figma
- Submit to Figma Community
- Follow Figma's plugin guidelines
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
MIT License - see LICENSE file for details
- Figma Plugin API
- Google Gemini AI
- OpenAI GPT models
- Anthropic Claude
- OpenRouter
- Preact framework
- Express.js
- PostgreSQL
For issues, questions, or feature requests:
- Open an issue on GitHub
- Check existing documentation
- Review troubleshooting section
Built with β€οΈ for designers and developers