1. a browser security warning about an iframe sandbox configuration, and 2. a Codespaces/Vite dev-server reachability failure (the repeated 502 Bad Gateway), plus some resource-type mistakes (JS being loaded as CSS). ⸻ 1) The iframe sandbox warning (what it really means) “An iframe which has both allow-scripts and allow-same-origin … can escape its sandboxing.” This warning is essentially telling you: if the framed content can run JS and is treated as same-origin, it can usually undo most of the sandbox’s value (e.g., by navigating itself, rewriting content, interacting with storage in ways you likely didn’t intend). It’s commonly summarized as “don’t combine these unless you fully trust what’s inside.”  Practical fix • If the iframe is meant to display untrusted or semi-trusted content: • Remove allow-same-origin (best default). • Keep sandbox minimal and only add what you truly need. • If the iframe must be same-origin for functionality (hard requirement): • Remove allow-scripts and switch to safer communication patterns (postMessage from a trusted wrapper, server-side rendering, etc.), or accept that you are no longer getting meaningful sandbox isolation. In short: pick one: scripts or same-origin, not both, unless you’re intentionally relaxing security. ⸻ 2) The Vite/Codespaces failure: repeated 502 Bad Gateway These lines are the key: • GET https://…-5000.app.github.dev/@vite/client net::ERR_ABORTED 502 (Bad Gateway) • same for /@react-refresh, /src/main.tsx, etc. In Codespaces, a 502 at the forwarded URL typically means: the Codespaces reverse proxy cannot reach a server listening on that port, or the server is listening only on localhost and not on the external interface.  What to check/fix (high-probability) 1. Is Vite actually running on port 5000? • Vite defaults to 5173, not 5000. • If your Codespaces URL ends with -5000.app.github.dev, your preview is targeting port 5000 specifically. • Either: • forward/open the port Vite is actually using (likely 5173), or • configure Vite to run on 5000. 2. Bind Vite to all interfaces • In Codespaces you typically need Vite to listen on 0.0.0.0 (or host: true in Vite config). • Otherwise it binds to 127.0.0.1 and the proxy can’t reach it, producing 502s.  3. Ports tab sanity • Confirm the port is listed and forwarded. • If it’s missing, the server isn’t listening or Codespaces didn’t detect it. • If you’ve rebuilt the Codespace, sometimes toggling/stopping forwarding and re-forwarding helps; otherwise recreate as a last resort.  ⸻ 3) “Refused to apply style … MIME type (‘text/javascript’) … not a supported stylesheet” That message means the browser tried to treat a resource as CSS but the server said it’s JavaScript. Common causes: • A <link rel="stylesheet" href="…"> is pointing at a .js (or a Vite endpoint like @vite/client). • A rewrite/proxy rule is returning the app HTML/JS for a CSS URL (often happens when the dev server isn’t reachable, or fallback routing is misconfigured). • Your dev server is down (ties back to the 502s), and the proxy is returning something unexpected for asset URLs. Given you also have 502s for Vite endpoints, fix the dev-server reachability first; many MIME-type errors disappear once assets are served by the correct server. ⸻ Fast triage sequence (minimal effort, maximum signal) 1. Open the Ports panel in Codespaces and verify which port your dev server is actually listening on (5173 vs 5000). 2. In the terminal, ensure the dev server is started and bound externally: • If you’re using Vite defaults, open the forwarded URL for 5173 (not 5000). • If you must use 5000, configure Vite to run on 5000 and bind to 0.0.0.0. 3. Reload the preview URL and confirm /@vite/client returns JS (200), not 502. 4. Only then chase any remaining MIME-type/style issues by inspecting index.html for incorrect <link rel="stylesheet"> references. ⸻ If you paste (a) your vite.config.* and (b) the exact command you run in Codespaces to start the dev server, I can tell you precisely which single change will eliminate the 502s (port mismatch vs bind address vs both).
🔨 CodeForge - Low-Code Next.js App Builder
A comprehensive visual low-code platform for generating production-ready Next.js applications with Material UI, Prisma, Flask backends, comprehensive testing suites, and persistent project management. Built with AI-powered code generation and Progressive Web App capabilities for offline-first development.
✨ Features
🏗️ Architecture (Phase 4: Declarative System ✨)
- Declarative JSON-Driven Pages - Add new pages by editing a JSON file, no code changes needed
- Dynamic Component Loading - All pages are lazy-loaded based on configuration for optimal performance
- Automatic Keyboard Shortcuts - Shortcuts defined in JSON and automatically wired up
- Feature Toggle Integration - Pages show/hide based on feature flags without conditional rendering
- Comprehensive Hook Library - 12+ custom hooks for data, UI, and form management (all <150 LOC)
- Atomic Component Library - All components under 150 LOC for maximum maintainability
- Type-Safe Everything - Full TypeScript + Zod validation for hooks, components, and JSON schemas
- Centralized Configuration - Navigation, pages, and features configured via JSON
🎯 Core Capabilities
- Progressive Web App - Install on desktop/mobile, work offline, automatic updates, and push notifications
- Project Management - Save, load, duplicate, export, and import complete projects with full state persistence
- Project Dashboard - At-a-glance overview of project status, completion metrics, and quick tips
- Monaco Code Editor - Full-featured IDE with syntax highlighting, autocomplete, and multi-file editing
- Prisma Schema Designer - Visual database model builder with relations and field configuration
- Component Tree Builder - Hierarchical React component designer with Material UI integration
- Component Tree Manager - Manage multiple named component trees for different app sections
- Workflow Designer - n8n-style visual workflow builder with triggers, actions, conditions, and lambdas
- Lambda Designer - Serverless function editor with multi-runtime support and trigger configuration
- Theme Designer - Advanced theming with multiple variants (light/dark/custom) and unlimited custom colors
- Favicon Designer - Visual icon designer with shapes, text, emojis, and multi-size export (16px to 512px)
- Sass Styling System - Custom Material UI components with Sass, including utilities, mixins, and animations
- Flask Backend Designer - Python REST API designer with blueprints, endpoints, and CORS configuration
- Project Settings - Configure Next.js options, npm packages, scripts, and build settings
- CI/CD Integration - Generate workflow files for GitHub Actions, GitLab CI, Jenkins, and CircleCI
- Feature Toggles - Customize your workspace by enabling/disabling designer features
- Keyboard Shortcuts - Power-user shortcuts for rapid navigation and actions
🤖 AI-Powered Generation
- Complete App Generation - Describe your app and get a full project structure
- Smart Code Improvements - Optimize code for performance and best practices
- Model Generation - Create Prisma schemas from natural language
- Component Generation - Build complex React components with proper structure
- Theme Generation - Generate beautiful, accessible color palettes
- Test Generation - Create comprehensive E2E, unit, and integration tests
- Code Explanations - Understand any code snippet with detailed explanations
- Auto Error Repair - Detect and fix syntax, type, import, and lint errors automatically
🧪 Testing & Quality
- Playwright Designer - Visual E2E test builder with step-by-step configuration
- Storybook Designer - Component story builder with args and variations
- Unit Test Designer - Comprehensive test suite builder for components, functions, and hooks
- Error Detection - Automated scanning for syntax, type, and lint errors
- Auto Repair System - AI-powered context-aware error fixing
- Smoke Tests - 17 critical tests validating all major features (~30-60s execution)
- E2E Test Suite - 50+ comprehensive tests across all functionality (~3-5min execution)
🚀 Getting Started
Installation
# Install dependencies
npm install
# Install Playwright browsers (for testing)
npx playwright install
# Start development server
npm run dev
Quick Start
- Save Your Work - Use Save Project button to persist your work to the database
- Load Projects - Click Load Project to view and switch between saved projects
- Open the Documentation tab in the app for comprehensive guides
- Use AI Generate to scaffold a complete application from a description
- Navigate between tabs to design models, components, themes, and backend APIs
- Click Export Project to download your complete Next.js application
Running Tests
# Run smoke tests (quick validation - ~30-60 seconds)
npm run test:e2e:smoke
# Run all E2E tests (comprehensive - ~3-5 minutes)
npm run test:e2e
# Run tests in interactive UI mode (recommended for debugging)
npm run test:e2e:ui
# Run tests with browser visible
npm run test:e2e:headed
# View test report
npm run test:e2e:report
See docs/testing/RUN_TESTS.md for detailed test execution guide.
Project Management
- Save Project - Save current work with name and description to database
- Load Project - Browse and load any saved project
- New Project - Start fresh with a blank workspace
- Duplicate - Create a copy of any saved project
- Export - Download project as JSON file for backup or sharing
- Import - Load a project from an exported JSON file
- Delete - Remove projects from database
Manual Building
- Models Tab - Create your database schema with Prisma models
- Components Tab - Build your UI component hierarchy
- Component Trees Tab - Organize components into named trees
- Workflows Tab - Design automation workflows visually
- Lambdas Tab - Create serverless functions
- Styling Tab - Design your theme with custom colors and typography
- Favicon Designer Tab - Create app icons and favicons with visual designer
- Flask API Tab - Configure your backend REST API
- Settings Tab - Configure Next.js and npm packages
- Code Editor Tab - Fine-tune generated code directly
- Export - Download your complete, production-ready application
Accessing Features
- Global Search - Press
Ctrl+K(orCmd+K) to search all features, files, and navigate instantly - Hamburger Menu - Click the menu icon (☰) in the top-left to browse all available tabs
- Feature Toggles - Go to Features tab to enable/disable specific designers
- Need Help? - See docs/guides/FAVICON_DESIGNER_ACCESS.md for troubleshooting
🏗️ Phase 4: Refactored Architecture
CodeForge has been completely refactored with a modular, JSON-driven architecture:
📚 Complete Documentation
👉 View All Documentation in /docs
Quick Links:
- docs/PRD.md - 📋 Product Requirements Document
- docs/guides/QUICK_REFERENCE.md - ⚡ Fast lookup guide
- docs/api/COMPLETE_HOOK_LIBRARY.md - 🎣 Complete hook API reference
- docs/architecture/DECLARATIVE_SYSTEM.md - ⭐ JSON-driven system
- docs/architecture/ARCHITECTURE_VISUAL_GUIDE.md - 🎨 Architecture diagrams
- docs/testing/RUN_TESTS.md - 🧪 Testing guide
🎣 Hook Library (12+ Hooks, All <150 LOC)
Data Management (/src/hooks/data/)
useArray- Enhanced array operations with persistenceuseCRUD- Complete CRUD operations for entitiesuseSearch- Multi-field debounced searchuseSort- Multi-key sorting with direction toggleusePagination- Client-side paginationuseDebounce- Generic value debouncing
UI State (/src/hooks/ui/)
useDialog- Modal/dialog state managementuseTabs- Type-safe tab navigationuseSelection- Multi-select state managementuseClipboard- Copy to clipboard with feedback
Forms (/src/hooks/forms/)
useForm- Complete form management with validationuseFormField- Single field with validation rules
📄 JSON Orchestration Engine
Build entire pages using JSON schemas without writing React code:
{
"id": "my-page",
"name": "My Page",
"layout": { "type": "single" },
"dataSources": [
{ "id": "data", "type": "kv", "key": "my-data", "defaultValue": [] }
],
"components": [
{ "id": "root", "type": "Card", "children": [...] }
],
"actions": [
{ "id": "add", "type": "create", "target": "data" }
]
}
Engine Components:
- PageRenderer - Interprets JSON schemas and renders React components
- ActionExecutor - Executes CRUD, navigation, API, and custom actions
- DataSourceManager - Manages KV store, API, and computed data sources
- ComponentRegistry - Maps JSON component types to React components
🎯 Key Benefits
- ✅ All components <150 LOC - Maximum maintainability
- ✅ Reusable hooks - Extract and share business logic
- ✅ JSON-driven pages - Build pages without writing code
- ✅ Full type safety - TypeScript + Zod validation
- ✅ Easy testing - Small, focused units
- ✅ Rapid prototyping - Create pages by editing JSON
🏗️ Architecture Documentation
CodeForge uses modern patterns for maintainability and extensibility:
Declarative System (Primary)
- docs/architecture/DECLARATIVE_SYSTEM.md - ⭐ START HERE Complete guide to the JSON-driven architecture
- Learn how to add pages by editing JSON instead of writing React code
- Understand the component registry, keyboard shortcuts, and feature toggles
- Includes migration guide and best practices
Atomic Component Architecture (Legacy)
- docs/architecture/atomic/ATOMIC_README.md - Quick start guide
- docs/architecture/atomic/ATOMIC_REFACTOR_SUMMARY.md - Overview of the atomic structure
- docs/architecture/atomic/ATOMIC_COMPONENTS.md - Complete architecture guide
- docs/architecture/atomic/ATOMIC_USAGE_EXAMPLES.md - Code examples and patterns
- docs/architecture/atomic/COMPONENT_MAP.md - Visual dependency maps
Component Levels
- Atoms (7) - Basic building blocks:
AppLogo,StatusIcon,ErrorBadge, etc. - Molecules (10) - Simple combinations:
SaveIndicator,ToolbarButton,EmptyState, etc. - Organisms (4) - Complex components:
AppHeader,NavigationMenu,PageHeader, etc. - Features (20+) - Domain-specific:
CodeEditor,ModelDesigner,ProjectDashboard, etc.
📋 Technology Stack
Frontend
- Next.js 14 with App Router
- React 18 with TypeScript
- Material UI 5
- Sass/SCSS for custom styling
- Monaco Editor
- Tailwind CSS
- Framer Motion
Backend & Testing
- Flask REST API (Python)
- Prisma ORM
- Playwright (E2E Testing)
- Vitest + React Testing Library
- Storybook for Component Development
AI Integration
- OpenAI GPT-4 for code generation
- Context-aware prompt engineering
- Intelligent error detection and repair
- Natural language to code translation
📚 Documentation
The application includes comprehensive documentation organized in the /docs folder:
Core Documentation
- README - Complete feature overview and getting started guide (this file)
- docs/PRD.md - Product Requirements Document
- docs/reference/ROADMAP.md - Completed features and planned enhancements
Technical Guides
- docs/architecture/ - Architecture and design patterns
- docs/api/ - Hook library and API references
- docs/guides/ - User guides (PWA, CI/CD, Error Repair, etc.)
- docs/testing/ - Testing documentation and test execution guides
- docs/deployment/ - Deployment and operations guides
Navigation
- docs/README.md - 📖 Documentation index with quick navigation
Access in-app documentation by clicking the Documentation tab in the application.
📱 Progressive Web App Features
CodeForge is a full-featured PWA that you can install and use offline:
- Install Anywhere - Install on desktop (Windows, Mac, Linux) or mobile (iOS, Android)
- Offline Support - Work without internet connection; changes sync when reconnected
- Automatic Updates - Get notified when new versions are available
- Push Notifications - Stay informed about project builds and updates (optional)
- Fast Loading - Intelligent caching for near-instant startup
- App Shortcuts - Quick access to Dashboard, Code Editor, and Models from your OS
- Share Target - Share code files directly to CodeForge from other apps
- Background Sync - Project changes sync automatically in the background
To Install:
- Visit the app in a supported browser (Chrome, Edge, Safari, Firefox)
- Look for the install prompt in the address bar or use the "Install" button in the app
- Follow the installation prompts for your platform
- Access the app from your applications menu or home screen
PWA Settings:
- Navigate to PWA tab to configure notifications, clear cache, and check installation status
- Monitor network status and cache size
- Manage service worker and offline capabilities
🗺️ Roadmap
✅ Completed (v1.0 - v5.3)
- Progressive Web App with offline support and installability
- Project persistence with save/load functionality
- Project dashboard with completion metrics
- Monaco code editor integration
- Visual designers for models, components, and themes
- Multiple component trees management
- n8n-style workflow designer
- Lambda function designer with multi-runtime support
- AI-powered generation across all features
- Multi-theme variant support
- Testing suite designers (Playwright, Storybook, Unit Tests)
- Auto error detection and repair
- Flask backend designer
- Project settings and npm management
- Custom Sass styling system with utilities and mixins
- ZIP file export with README generation
- Keyboard shortcuts for power users
- Complete CI/CD configurations (GitHub Actions, GitLab CI, Jenkins, CircleCI)
- Docker containerization with multi-stage builds
- Feature toggle system for customizable workspace
- Project export/import as JSON
- Project duplication and deletion
- Service Worker with intelligent caching
- Push notifications and background sync
- App shortcuts and share target API
🔮 Planned
- Real-time preview with hot reload
- Database seeding designer
- API client generator
- Visual form builder
- Authentication designer (JWT, OAuth, sessions)
- GraphQL API designer
- State management designer (Redux, Zustand, Jotai)
- Component library export
- Design system generator
- Collaboration features
🎨 Design Philosophy
CodeForge combines the power of visual low-code tools with professional IDE capabilities:
- Empowering - Control at both visual and code levels
- Intuitive - Complex generation made approachable
- Professional - Production-ready, best-practice code output
🤝 Contributing
CodeForge is built on the Spark platform. Contributions, feature requests, and feedback are welcome!
📄 License
The Spark Template files and resources from GitHub are licensed under the terms of the MIT license, Copyright GitHub, Inc.
🔗 Resources
- Documentation Hub - 📖 Complete documentation index
- PRD - Product requirements and design decisions
- Error Repair Guide - Error detection and repair system
- CI/CD Guide - Complete CI/CD setup and configuration
- Favicon Designer Access - How to access and use the Favicon Designer
- E2E Test Documentation - Comprehensive Playwright test suite guide
- E2E Test Summary - Test coverage and validation details
- Run Tests Guide - How to execute smoke tests and full test suite
- PWA Guide - Progressive Web App features and setup
Built with ❤️ using GitHub Spark