Skip to content

mojo3325/Craftopia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽจ Craftopia

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.

โœจ Key Features

๐Ÿค– Multi-Agent AI Pipeline

  • 4-Stage Generation Process: Planner โ†’ Themer โ†’ Coder โ†’ Reviewer
  • Specialized AI Models: Different models optimized for specific tasks
  • Intelligent Orchestration: Seamless coordination between agents

๐ŸŽจ Soft UI / Flat 2.0 Design System

Craftopia features a meticulously crafted design system inspired by modern Apple aesthetics:

Visual Language

  • 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

Color Palette

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)

Component System

  • 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

๐Ÿš€ Instant Prototyping

  • 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

๐Ÿ—๏ธ Clean Architecture

โ”Œโ”€ Presentation Layer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  SwiftUI Views + Components          โ”‚
โ”œโ”€ Business Logic Layer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  GenerationService + Agent Clients   โ”‚
โ”œโ”€ Data Layer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  GenerationStore + State Management  โ”‚
โ””โ”€ External Services โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
   Multi-Provider AI APIs

๐Ÿ”’ Security & Privacy

  • 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

๐Ÿ› ๏ธ Technology Stack

Frontend

  • SwiftUI: Modern declarative UI framework
  • Combine: Reactive programming for state management
  • WebKit: Secure HTML rendering

AI Integration

  • Cerebras AI: High-performance language models
  • Multi-Model Architecture: Specialized models for different tasks
  • Streaming Responses: Real-time generation feedback

Architecture Patterns

  • MVVM: Model-View-ViewModel with reactive bindings
  • Dependency Injection: Clean separation of concerns
  • Unidirectional Data Flow: Predictable state management

๐Ÿ“ฑ User Experience

Generation Flow

graph LR
    A[๐Ÿ’ญ Describe App] --> B[๐ŸŽฏ AI Planning]
    B --> C[๐ŸŽจ Design System]
    C --> D[โšก Code Generation]
    D --> E[โœจ Final Polish]
    E --> F[๐Ÿ“ฑ Live Preview]
Loading

Multi-Agent Pipeline

  1. Planner Agent: Analyzes requirements and creates detailed specifications
  2. Themer Agent: Generates design tokens and visual system
  3. Coder Agent: Implements functional HTML with the design system
  4. Reviewer Agent: Performs final optimization and bug fixes

๐Ÿš€ Getting Started

Prerequisites

  • Xcode 15.0+
  • iOS 15.0+
  • Swift 5.9+

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/craftopia.git
cd craftopia
  1. Configure API keys:
cp Config-Template.xcconfig Config.xcconfig
# Edit Config.xcconfig with your API keys

Config.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.

  1. Open in Xcode:
open Craftopia.xcodeproj
  1. Build and run on simulator or device

API Configuration

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

๐ŸŽฏ Example Prompts

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"

๐Ÿ—๏ธ Project Structure

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

๐ŸŽจ Design Philosophy

Craftopia embodies the Soft UI (Flat 2.0) design philosophy:

Core Principles

  • 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

Implementation Guidelines

  • Multi-layered shadows for realistic depth
  • CSS custom properties for theme switching
  • Generous spacing for premium aesthetic
  • Sophisticated hover states with smooth transitions

๐Ÿ”ง Advanced Features

Agent Logging System

  • Comprehensive session tracking
  • Performance metrics and debugging
  • Timestamped markdown logs in ~/Documents/AgentLogs/

Theme Adaptation

  • Automatic system theme detection
  • Manual theme override
  • Dynamic material effects (glassmorphism)

Security Measures

  • XSS protection in generated content
  • Secure API key storage
  • Content sanitization
  • Build-time credential injection

๐Ÿค Contributing

We welcome contributions! Please read our contributing guidelines and code of conduct.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Follow the existing code style
  4. Add tests for new functionality
  5. Submit a pull request

Transform your imagination into reality with AI-powered prototyping

About

IOS APP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages