Transform your ideas into functional web applications using the power of AI
Craftopia is a iOS application that bridges the gap between conceptual ideas and functional prototypes. Simply describe your vision in natural language, and watch as AI transforms it into a complete, interactive HTML application with beautiful design.
- 4-Stage Generation Process: Planner โ Themer โ Coder โ Reviewer
- Specialized AI Models: Different models optimized for specific tasks
- Intelligent Orchestration: Seamless coordination between agents
Craftopia features a meticulously crafted design system inspired by modern Apple aesthetics:
- Soft Shadows: Multi-layered shadows (0 2px 6px โ 0 12px 24px) for depth without heaviness
- Subtle Gradients: 2-4% brightness variations for sophisticated surfaces
- Generous Corner Radius: 10-16px for modern, approachable feel
- Premium Spacing: 16-24px padding for breathing room
Light Theme:
โโโ Background: #F5F6F8 (Soft neutral base)
โโโ Surface: #FFFFFF (Pure white containers)
โโโ Primary: #186DEE โ #1B77FD (Dynamic blue gradient)
โโโ Borders: #E3E6EB (Subtle separation)
โโโ Text: #131B22 โ #4B5669 โ #99A1B3 (Hierarchy)
Dark Theme:
โโโ Background: #07090D (Deep space)
โโโ Surface: #15171F โ #0C0E12 (Elevated surfaces)
โโโ Borders: #3A3A3C (Refined separation)
โโโ Text: #FFFFFF โ #EBEBF5 โ #8E8E93 (Clarity)
- Buttons: Gradient backgrounds + soft shadows + 44px minimum touch targets
- Cards: Surface gradients + elevation shadows + 16px corner radius
- Inputs: Inset shadows + focus states + consistent 16px padding
- Glass Effects: Adaptive blur materials for overlays
- Natural Language Input: Describe apps in plain English
- Real-time Generation: Watch your ideas come to life
- Live Preview: WebView integration with secure rendering
- One-Click Export: Save generated HTML applications
โโ Presentation Layer โโโโโโโโโโโโโโโโโโ
โ SwiftUI Views + Components โ
โโ Business Logic Layer โโโโโโโโโโโโโโโโค
โ GenerationService + Agent Clients โ
โโ Data Layer โโโโโโโโโโโโโโโโโโโโโโโโโโค
โ GenerationStore + State Management โ
โโ External Services โโโโโโโโโโโโโโโโโโโ
Multi-Provider AI APIs
- Secure Keychain Storage: API keys protected with iOS Keychain
- Content Sanitization: XSS protection for generated HTML
- Local Processing: No data retention on external servers
- Build-time Configuration: Secure credential management
- SwiftUI: Modern declarative UI framework
- Combine: Reactive programming for state management
- WebKit: Secure HTML rendering
- Cerebras AI: High-performance language models
- Multi-Model Architecture: Specialized models for different tasks
- Streaming Responses: Real-time generation feedback
- MVVM: Model-View-ViewModel with reactive bindings
- Dependency Injection: Clean separation of concerns
- Unidirectional Data Flow: Predictable state management
graph LR
A[๐ญ Describe App] --> B[๐ฏ AI Planning]
B --> C[๐จ Design System]
C --> D[โก Code Generation]
D --> E[โจ Final Polish]
E --> F[๐ฑ Live Preview]
- Planner Agent: Analyzes requirements and creates detailed specifications
- Themer Agent: Generates design tokens and visual system
- Coder Agent: Implements functional HTML with the design system
- Reviewer Agent: Performs final optimization and bug fixes
- Xcode 15.0+
- iOS 15.0+
- Swift 5.9+
- Clone the repository:
git clone https://github.com/yourusername/craftopia.git
cd craftopia- Configure API keys:
cp Config-Template.xcconfig Config.xcconfig
# Edit Config.xcconfig with your API keysConfig.xcconfig is ignored by git and must never be committed.
Alternatively, you can set the API key inside the app (Settings) and it will be stored in Keychain.
- Open in Xcode:
open Craftopia.xcodeproj- Build and run on simulator or device
You can configure the Cerebras API key in two ways:
Option A (recommended): in-app Settings (Keychain)
- Open Settings โ โCerebras API Keyโ โ paste your key โ Save
Option B: local Config.xcconfig (gitignored)
Create a Config.xcconfig file with your API credentials:
// Cerebras AI API Configuration
CEREBRAS_API_KEY = your_api_key_here
CEREBRAS_BASE_URL = https://api.cerebras.ai/v1
Transform these ideas into functional apps:
๐งฎ "Create a beautiful calculator with a modern design"
โ
"Build a todo list with add, edit, and delete functionality"
๐ฎ "Design a memory card matching game"
๐ "Make a expense tracker with categories"
๐จ "Create a color palette generator tool"
Craftopia/
โโโ ๐ฑ App/
โ โโโ CraftopiaApp.swift # App entry point
โ โโโ ContentView.swift # Root view
โโโ ๐จ Views/
โ โโโ GenerateScreen/ # Main generation interface
โ โโโ SettingsView/ # Configuration & preferences
โ โโโ Components/ # Reusable UI components
โ โโโ StatusView/ # Generation status feedback
โโโ ๐ค API/
โ โโโ PlannerAgentAPIClient.swift # Specification generation
โ โโโ ThemerAgentAPIClient.swift # Design system creation
โ โโโ CoderAgentAPIClient.swift # Code implementation
โ โโโ ThinkingAgentAPIClient.swift # Final review & polish
โโโ ๐ง Services/
โ โโโ GenerationService.swift # AI orchestration
โ โโโ AgentLoggingService.swift # Debug & analytics
โโโ ๐ Store/
โ โโโ GenerationStore.swift # State management
โโโ ๐๏ธ Models/
โ โโโ GenerationState.swift # Data structures
โโโ ๐จ Design/
โโโ DesignStyle.md # Design system documentation
Craftopia embodies the Soft UI (Flat 2.0) design philosophy:
- Functional Beauty: Every element serves a purpose
- Gentle Hierarchy: Soft shadows and gradients create depth
- Tactile Interaction: Buttons feel pressable, surfaces feel real
- Adaptive Design: Seamless light/dark mode transitions
- Multi-layered shadows for realistic depth
- CSS custom properties for theme switching
- Generous spacing for premium aesthetic
- Sophisticated hover states with smooth transitions
- Comprehensive session tracking
- Performance metrics and debugging
- Timestamped markdown logs in
~/Documents/AgentLogs/
- Automatic system theme detection
- Manual theme override
- Dynamic material effects (glassmorphism)
- XSS protection in generated content
- Secure API key storage
- Content sanitization
- Build-time credential injection
We welcome contributions! Please read our contributing guidelines and code of conduct.
- Fork the repository
- Create a feature branch
- Follow the existing code style
- Add tests for new functionality
- Submit a pull request
Transform your imagination into reality with AI-powered prototyping