Deploy Magic Patterns Apps
Deploy AI-designed UI components and applications to production
Overview
Transform your Magic Patterns AI-designed UI into a production application on Chita Cloud with full backend support.
What is Magic Patterns?
Magic Patterns is an AI-powered design tool that generates beautiful, production-ready React and Next.js components from prompts. Perfect for creating modern UIs without design skills.
Why Use Chita Cloud?
Magic Patterns generates frontend code. Chita Cloud provides:
- Production hosting for your UI
- Backend services (PostgreSQL, Redis)
- Custom domains + SSL
- API integration support
- Always-on infrastructure
Deployment Steps
Step 1: Design with Magic Patterns
- Go to magicpatterns.com
- Describe your UI component or page
- AI generates React/Next.js code
- Customize colors, layout, interactions
- Export production-ready code
Step 2: Export Your Code
Magic Patterns Export Options:
- Click "Export" button
- Choose framework:
- React (standalone components)
- Next.js (full pages)
- Tailwind CSS (included)
- Copy code or download files
- Get responsive, accessible components
Step 3: Set Up Your Project
For React Components:
# Create new React app
npx create-react-app my-app
cd my-app
# Add Tailwind CSS (Magic Patterns uses it)
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
# Paste Magic Patterns components into src/components/For Next.js Pages:
# Create Next.js app
npx create-next-app@latest my-app
cd my-app
# Magic Patterns components go in:
# - pages/ (page components)
# - components/ (reusable components)Step 4: Push to GitHub
git init
git add .
git commit -m "Magic Patterns UI"
git remote add origin git@github.com:yourusername/repo.git
git push -u origin mainStep 5: Deploy to Chita Cloud
- Go to app.chitacloud.com
- Click "Deploy" button
- Select "GitHub Repository"
- Authorize GitHub
- Choose your repository
- Framework auto-detected:
- React (Create React App, Vite)
- Next.js
- Click "Deploy"
Step 6: Add Backend Services
Magic Patterns creates beautiful frontends. Add backend:
PostgreSQL for Data:
- Go to "Add-ons" tab
- Add PostgreSQL (100MB free or from €7/month)
- Use for user data, content, forms
Redis for Sessions:
- Included in all paid plans ✅
- Perfect for user sessions, caching
Database: PostgreSQL setup | Sessions: Redis cache
Step 7: Connect to APIs
Add environment variables for backend:
- Go to "Environment Variables" tab
- Add API endpoints:
NEXT_PUBLIC_API_URLDATABASE_URL(auto-provided)REDIS_URL(auto-provided)
- Add third-party APIs:
STRIPE_PUBLISHABLE_KEYOPENAI_API_KEY- etc.
Secure variables: Environment Variables
Step 8: Custom Domain
- Go to "Domains" tab
- Add your domain (e.g.,
myapp.com) - Configure DNS
- SSL issued automatically
- Your beautiful UI now on custom domain ✅
Integration Patterns
Magic Patterns + API
// Magic Patterns component with API integration
import { useState, useEffect } from 'react';
export default function Dashboard() {
const [data, setData] = useState([]);
useEffect(() => {
// Call your backend API
fetch(process.env.NEXT_PUBLIC_API_URL + '/api/data')
.then(res => res.json())
.then(setData);
}, []);
// Magic Patterns UI renders data beautifully
return (
<div className="grid grid-cols-3 gap-4">
{data.map(item => (
<Card key={item.id} {...item} />
))}
</div>
);
}Magic Patterns + PostgreSQL
// pages/api/data.js - Backend for Magic Patterns UI
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL
});
export default async function handler(req, res) {
const { rows } = await pool.query('SELECT * FROM items');
res.json(rows);
}Magic Patterns + Forms
// Magic Patterns form with backend submission
async function handleSubmit(formData) {
await fetch('/api/submit', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(formData)
});
}Common Use Cases
Landing Page
- Design landing page in Magic Patterns
- Export Next.js code
- Add contact form backend
- Deploy with custom domain
- Launch in under 1 hour
SaaS Dashboard
- Design dashboard UI with Magic Patterns
- Export components
- Add PostgreSQL for user data
- Add Redis for sessions
- Integrate authentication
- Production-ready SaaS UI
E-commerce Storefront
- Design product cards, checkout in Magic Patterns
- Export React components
- Add PostgreSQL for products
- Integrate Stripe
- Deploy on custom domain
Pricing Example
Magic Patterns App on Chita Cloud:
| Service | Cost | Details |
|---|---|---|
| Magic Patterns Hobby | $19/month | AI UI design |
| Chita Cloud Starter | €16/month | Hosting + Redis |
| PostgreSQL 1GB | €7/month | User/product data |
| Total | €42/month | Full application |
Compare to Vercel Pro ($20) + Supabase Pro ($25) + Redis ($25) = Save ~€45/month
Best Practices
Responsive Design
Magic Patterns generates responsive code. Test on:
- Desktop (1920px)
- Tablet (768px)
- Mobile (375px)
All automatically responsive with Tailwind CSS.
Component Organization
src/
├── components/
│ ├── magicpatterns/ # All exported components
│ │ ├── Hero.jsx
│ │ ├── Pricing.jsx
│ │ └── Dashboard.jsx
│ └── custom/ # Your custom components
├── pages/
└── api/ # Backend logicTailwind Configuration
Magic Patterns uses custom colors. Keep tailwind.config.js:
module.exports = {
theme: {
extend: {
colors: {
// Magic Patterns custom colors
primary: '#...',
secondary: '#...',
}
}
}
}Troubleshooting
Tailwind Styles Not Working
Ensure tailwind.config.js has correct content paths:
module.exports = {
content: [
'./pages/**/*.{js,jsx}',
'./components/**/*.{js,jsx}',
],
}Images Not Loading
Use Next.js Image component:
import Image from 'next/image';
// Replace <img> with <Image>
<Image src="/hero.jpg" width={800} height={600} alt="Hero" />API Routes 404
Ensure API routes in pages/api/ directory:
pages/
└── api/
├── submit.js
└── data.js