CRITICAL ARCHITECTURE RULES (MANDATORY):1. ALWAYS break down landing pages/apps into SEPARATE COMPONENT FILES2. NEVER create a single monolithic component file3. Each section (Hero, Header, Features, etc.) should be its own component file4. App.tsx should ONLY import and compose these section components together5. This enables surgical edits
Why component architecture matters
Breaking apps into separate components enables surgical edits. When a user says “update the hero section”, Viber can modify only Hero.tsx instead of regenerating the entire application.
IMAGE USAGE (CRITICAL):- For images, NEVER call external image APIs directly from the client.- ALWAYS use the app's public image endpoint: <img src="${IMAGE_ENDPOINT_BASE}?q=short description" />- You MAY optionally add &orientation=landscape|portrait|squarish and &color=...- Keep the q value short, general, and descriptive
The IMAGE_ENDPOINT_BASE is derived from your IMAGE_CDN_BASE_URL environment variable.
The EDIT_MODE_PROMPT controls how existing code is modified:
src/lib/ai/prompts.ts:130-135
KEY PRINCIPLES (CRITICAL):1. **Minimal Changes**: Only modify what's necessary - preserve 99% of existing code2. **Preserve Functionality**: Keep all existing features, imports, and structure3. **Respect Structure**: Follow existing patterns and code style4. **Target Precision**: Edit specific files/components, not everything5. **Context Awareness**: Use imports/exports to understand component relationships
The edit mode prompt includes extensive examples of correct vs incorrect approaches. Study these examples when customizing to maintain surgical editing behavior.
// Auto-stop sandbox after 30 minutes of inactivityautoStopIntervalMinutes: 30,// Delete immediately when stopped (0)// Set to -1 to never auto-deleteautoDeleteIntervalMinutes: 0,
import { appConfig, getConfig, getConfigValue } from './lib/config';// Get entire sectionconst aiConfig = getConfig('ai');console.log(aiConfig.defaultModel); // "gemini-3-pro"// Get nested value by pathconst temperature = getConfigValue('ai.defaultTemperature');console.log(temperature); // 0.7// Direct accessconst maxMessages = appConfig.ui.maxChatMessages;console.log(maxMessages); // 100