# Rapid Full-Stack Prototyping Build working full-stack web apps quickly (1-4 hours). Design first, code second, test third. ## When to Use - User says "WEBAPP", "PROTOTYPE", "full-stack app", or "build a web application" - Need both backend API + frontend UI - Want speed + quality ## What You'll Build - **Stack**: React + Vite + RESTful API (FastAPI/Express) + SQLite - **Timeline**: 1-4 hours from idea to working app - **Output**: Polished, functional prototype with keyboard shortcuts and clean UI ## The 3-Step Process ### Step 1: Design (5-10 min) Create a text-based design showing: ``` UI LAYOUT: [Header with Logo, Nav, Actions] [Main Content - Left Sidebar | Center Panel | Right Info] [Footer with Status] USER INTERACTIONS: 1. Click "New" → Opens editor 2. Type text → Updates state 3. Press ⌘S → Saves via API 4. Click "History" → Opens panel DATA MODELS: - Item: {id, content, created_at} - Revision: {id, item_id, content, timestamp} API ENDPOINTS: GET /api/items → List all POST /api/items → Create new GET /api/items/:id → Get one PUT /api/items/:id → Update GET /api/history/:id → Get revisions ``` ### Step 2: Get Approval (30 sec) Show the design → User says "looks good" → Start coding ### Step 3: Build (1-3 hours) Use this stack (don't ask, just use): - **Frontend**: React + Vite - **Backend**: FastAPI (Python) or Express (Node) - **Database**: SQLite - **State**: useState + useEffect Build in order: 1. Backend skeleton (30 min) 2. Core features (1-2 hours) 3. Polish + keyboard shortcuts (30 min) 4. Test with WEBTEST --- ## Rules for Claude ✅ **DO:** - Design mock UI before any code - Use React + RESTful API (default) - Start coding immediately after approval - Add keyboard shortcuts (⌘S, ⌘/, etc.) ❌ **DON'T:** - Ask user to choose frameworks - Skip the design phase - Spend 30+ min researching simple features - Build custom solutions for standard problems ## Core Principles 1. **Design Before Code** - Mock UI + interactions first, then build 2. **Use What You Know** - Familiar tools > "perfect" tools you don't know 3. **Single Source of Truth** - One state for each piece of data, sync explicitly 4. **Right Tool for Job** - Fighting a component's design? Wrong component 5. **Test Early** - Automated tests + real user feedback before launch ## Default Stack (Use This) ``` Frontend: React + Vite Backend: FastAPI (Python) or Express (Node) Database: SQLite State: useState + useEffect Styling: Vanilla CSS ``` **Why?** Fast setup, familiar patterns, good docs, zero config database. **When to deviate:** - User explicitly requests different stack → use their choice - User needs SEO/SSR → use Next.js instead of Vite - User says "no code" → suggest Bubble/Retool (explain trade-offs) ## Choosing Libraries **When to add a library:** - ✅ Would take > 1 hour to build from scratch - ✅ Well-maintained (updated in last 6 months) - ✅ You need > 30% of its features **When to build it yourself:** - ✅ Can be done in < 30 lines of code - ✅ Only need 10% of library features - ✅ Fighting the library's design **Quick research (spend max 15 min):** ```bash # 1. Search WebSearch: "best [feature] library react 2025" # 2. Check npm npm info [package-name] # Look at: downloads/week, last publish, dependencies count # 3. Test # Try basic example - works in 15 min? Keep it. Doesn't? Try next option. ``` **Examples:** ```javascript // ❌ Don't need library for: fetch() // axios is overkill