diff --git a/PRD.md b/PRD.md index 44b2d51..4841e91 100644 --- a/PRD.md +++ b/PRD.md @@ -1,6 +1,6 @@ # Planning Guide -A visual low-code platform for generating Next.js applications with Material UI styling, integrated Monaco code editor, and Prisma schema designer. +A visual low-code platform for generating Next.js applications with Material UI styling, integrated Monaco code editor, Prisma schema designer, and persistent project management. **Experience Qualities**: 1. **Empowering** - Users feel in control with both visual and code-level editing capabilities @@ -8,10 +8,17 @@ A visual low-code platform for generating Next.js applications with Material UI 3. **Professional** - Output-ready code that follows modern best practices and conventions **Complexity Level**: Complex Application (advanced functionality, likely with multiple views) -This is a full-featured low-code IDE with multiple integrated tools (code editor, visual designers, schema builder), state management across views, and code generation capabilities that require sophisticated UI organization. +This is a full-featured low-code IDE with multiple integrated tools (code editor, visual designers, schema builder), state management across views, persistent project storage, and code generation capabilities that require sophisticated UI organization. ## Essential Features +### Project Save/Load Management +- **Functionality**: Complete project persistence system using Spark KV database with save, load, duplicate, export, import, and delete operations +- **Purpose**: Allow users to work on multiple projects over time without losing progress, share projects via JSON export, and maintain a library of saved work +- **Trigger**: Save/Load/New Project buttons in the header toolbar +- **Progression**: Click Save → Enter project name and description → Project saved to database → View saved projects list → Load any project → All state restored including files, models, components, trees, workflows, lambdas, themes, tests, and settings +- **Success criteria**: Projects persist between sessions; all application state is saved and restored correctly; can duplicate, export (JSON), import, and delete projects; project list shows metadata (name, description, dates); smooth loading experience with no data loss + ### Monaco Code Editor Integration - **Functionality**: Full-featured code editor with syntax highlighting, autocomplete, multi-file editing, and AI-powered code improvement and explanation - **Purpose**: Allows direct code manipulation for users who want precise control, with AI assistance for learning and optimization diff --git a/README.md b/README.md index c28c48b..5320858 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,30 @@ # 🔨 CodeForge - Low-Code Next.js App Builder -![CodeForge](https://img.shields.io/badge/CodeForge-v4.0-blueviolet) +![CodeForge](https://img.shields.io/badge/CodeForge-v5.2-blueviolet) ![Next.js](https://img.shields.io/badge/Next.js-14-black) ![React](https://img.shields.io/badge/React-18-blue) ![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue) ![AI Powered](https://img.shields.io/badge/AI-Powered-green) -A comprehensive visual low-code platform for generating production-ready Next.js applications with Material UI, Prisma, Flask backends, and comprehensive testing suites. Built with AI-powered code generation at its core. +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 at its core. ## ✨ Features ### 🎯 Core Capabilities +- **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 - **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 @@ -41,19 +47,33 @@ A comprehensive visual low-code platform for generating production-ready Next.js ## 🚀 Getting Started ### Quick Start -1. Open the **Documentation** tab in the app for comprehensive guides -2. Use **AI Generate** to scaffold a complete application from a description -3. Navigate between tabs to design models, components, themes, and backend APIs -4. Click **Export Project** to download your complete Next.js application +1. **Save Your Work** - Use **Save Project** button to persist your work to the database +2. **Load Projects** - Click **Load Project** to view and switch between saved projects +3. Open the **Documentation** tab in the app for comprehensive guides +4. Use **AI Generate** to scaffold a complete application from a description +5. Navigate between tabs to design models, components, themes, and backend APIs +6. Click **Export Project** to download your complete Next.js application + +### 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 1. **Models Tab** - Create your database schema with Prisma models 2. **Components Tab** - Build your UI component hierarchy -3. **Styling Tab** - Design your theme with custom colors and typography -4. **Flask API Tab** - Configure your backend REST API -5. **Settings Tab** - Configure Next.js and npm packages -6. **Code Editor Tab** - Fine-tune generated code directly -7. **Export** - Download your complete, production-ready application +3. **Component Trees Tab** - Organize components into named trees +4. **Workflows Tab** - Design automation workflows visually +5. **Lambdas Tab** - Create serverless functions +6. **Styling Tab** - Design your theme with custom colors and typography +7. **Flask API Tab** - Configure your backend REST API +8. **Settings Tab** - Configure Next.js and npm packages +9. **Code Editor Tab** - Fine-tune generated code directly +10. **Export** - Download your complete, production-ready application ## 📋 Technology Stack @@ -92,10 +112,14 @@ Access documentation by clicking the **Documentation** tab in the application. ## 🗺️ Roadmap -### ✅ Completed (v1.0 - v4.1) +### ✅ Completed (v1.0 - v5.2) +- 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) @@ -105,15 +129,11 @@ Access documentation by clicking the **Documentation** tab in the application. - Custom Sass styling system with utilities and mixins - ZIP file export with README generation - Keyboard shortcuts for power users - -### ✅ Recently Added (v4.2) - Complete CI/CD configurations (GitHub Actions, GitLab CI, Jenkins, CircleCI) - Docker containerization with multi-stage builds -- Nginx configuration for production deployment -- Automated release workflow with versioning -- Security scanning integration (Trivy, npm audit) -- Slack notification integration -- Health check endpoints +- Feature toggle system for customizable workspace +- Project export/import as JSON +- Project duplication and deletion ### 🔮 Planned - Real-time preview with hot reload diff --git a/ROADMAP.md b/ROADMAP.md index c94c9ad..d130f67 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -111,9 +111,53 @@ Improved export and comprehensive documentation: - ✅ Keyboard shortcuts for power users - ✅ Search functionality in documentation +### v5.0 - Workflows, Lambdas & Feature Toggles (Completed) +**Release Date:** Week 10 + +Advanced automation and customization: +- ✅ n8n-style workflow designer with visual node editor +- ✅ Workflow nodes: triggers, actions, conditions, transforms, lambdas, API calls, database queries +- ✅ Visual workflow connections and data flow +- ✅ Lambda function designer with Monaco editor +- ✅ Multi-runtime lambda support (JavaScript, TypeScript, Python) +- ✅ Lambda triggers (HTTP, schedule, event, queue) +- ✅ Environment variable management for lambdas +- ✅ Multiple Component Trees management system +- ✅ Feature toggle system to enable/disable designers +- ✅ Customizable workspace based on user needs + +### v5.1 - CI/CD Integration (Completed) +**Release Date:** Week 11 + +Comprehensive DevOps pipeline configuration: +- ✅ GitHub Actions workflow generator +- ✅ GitLab CI/CD pipeline configuration +- ✅ Jenkins pipeline (Jenkinsfile) generation +- ✅ CircleCI configuration +- ✅ Multi-stage builds and deployments +- ✅ Environment-specific configurations +- ✅ Automated testing in pipelines +- ✅ Docker integration in CI/CD +- ✅ Deployment strategies configuration + +### v5.2 - Project Persistence (Completed) +**Release Date:** Week 12 + +Complete project management system: +- ✅ Save projects to Spark KV database +- ✅ Load projects from database +- ✅ Project listing with metadata (name, description, timestamps) +- ✅ Duplicate existing projects +- ✅ Delete projects from database +- ✅ Export projects as JSON files +- ✅ Import projects from JSON +- ✅ New project creation with state reset +- ✅ Current project indicator +- ✅ Complete state persistence (files, models, components, trees, workflows, lambdas, themes, tests, settings) + ## Upcoming Releases -### v4.2 - Real-Time Preview (In Planning) +### v5.3 - Real-Time Preview (In Planning) **Estimated:** Q2 2024 Live application preview: @@ -164,7 +208,7 @@ Visual form design: - Zod schema validation - Material UI form components -### v5.0 - Authentication & Security (In Planning) +### v4.5 - Authentication & Security (In Planning) **Estimated:** Q3 2024 Complete authentication system: diff --git a/src/App.tsx b/src/App.tsx index 95da508..1bcf143 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,7 +7,7 @@ import { Badge } from '@/components/ui/badge' import { Card } from '@/components/ui/card' import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable' import { Code, Database, Tree, PaintBrush, Download, Sparkle, Flask, BookOpen, Play, Wrench, Gear, Cube, FileText, ChartBar, Keyboard, FlowArrow, Faders } from '@phosphor-icons/react' -import { ProjectFile, PrismaModel, ComponentNode, ComponentTree, ThemeConfig, PlaywrightTest, StorybookStory, UnitTest, FlaskConfig, NextJsConfig, NpmSettings, Workflow, Lambda, FeatureToggles } from '@/types/project' +import { ProjectFile, PrismaModel, ComponentNode, ComponentTree, ThemeConfig, PlaywrightTest, StorybookStory, UnitTest, FlaskConfig, NextJsConfig, NpmSettings, Workflow, Lambda, FeatureToggles, Project } from '@/types/project' import { CodeEditor } from '@/components/CodeEditor' import { ModelDesigner } from '@/components/ModelDesigner' import { ComponentTreeBuilder } from '@/components/ComponentTreeBuilder' @@ -27,6 +27,7 @@ import { SassStylesShowcase } from '@/components/SassStylesShowcase' import { ProjectDashboard } from '@/components/ProjectDashboard' import { KeyboardShortcutsDialog } from '@/components/KeyboardShortcutsDialog' import { FeatureToggleSettings } from '@/components/FeatureToggleSettings' +import { ProjectManager } from '@/components/ProjectManager' import { useKeyboardShortcuts } from '@/hooks/use-keyboard-shortcuts' import { generateNextJSProject, generatePrismaSchema, generateMUITheme, generatePlaywrightTests, generateStorybookStories, generateUnitTests, generateFlaskApp } from '@/lib/generators' import { AIService } from '@/lib/ai-service' @@ -454,6 +455,43 @@ Navigate to the backend directory and follow the setup instructions. } } + const handleLoadProject = (project: Project) => { + if (project.files) setFiles(project.files) + if (project.models) setModels(project.models) + if (project.components) setComponents(project.components) + if (project.componentTrees) setComponentTrees(project.componentTrees) + if (project.workflows) setWorkflows(project.workflows) + if (project.lambdas) setLambdas(project.lambdas) + if (project.theme) setTheme(project.theme) + if (project.playwrightTests) setPlaywrightTests(project.playwrightTests) + if (project.storybookStories) setStorybookStories(project.storybookStories) + if (project.unitTests) setUnitTests(project.unitTests) + if (project.flaskConfig) setFlaskConfig(project.flaskConfig) + if (project.nextjsConfig) setNextjsConfig(project.nextjsConfig) + if (project.npmSettings) setNpmSettings(project.npmSettings) + if (project.featureToggles) setFeatureToggles(project.featureToggles) + } + + const getCurrentProject = (): Project => { + return { + name: safeNextjsConfig.appName, + files: safeFiles, + models: safeModels, + components: safeComponents, + componentTrees: safeComponentTrees, + workflows: safeWorkflows, + lambdas: safeLambdas, + theme: safeTheme, + playwrightTests: safePlaywrightTests, + storybookStories: safeStorybookStories, + unitTests: safeUnitTests, + flaskConfig: safeFlaskConfig, + nextjsConfig: safeNextjsConfig, + npmSettings: safeNpmSettings, + featureToggles: safeFeatureToggles, + } + } + return (
@@ -470,6 +508,10 @@ Navigate to the backend directory and follow the setup instructions.
+ {safeFeatureToggles.errorRepair && autoDetectedErrors.length > 0 && ( + + + +
+ + + + + Save Project + + Save your current project to the database + + +
+
+ + setProjectName(e.target.value)} + placeholder="My Awesome Project" + /> +
+
+ +