Project Specification Create a full-stack application that leverages Ollama with…
- User
Project Specification Create a full-stack application that leverages Ollama with Qwen2.5-Coder to generate and preview React components in real-time. Core Requirements Backend Integration Implement an API server that interfaces with Ollama to run the Qwen2.5-Coder model (7B or 32B variant)16 Create endpoints for code generation, validation, and compilation Handle real-time code updates and preview rendering Frontend Interface Build a split-screen interface similar to VS Code's preview functionality7 Left panel: Code editor with syntax highlighting and auto-completion Right panel: Live preview of the rendered React component5 Code Generation Features Implement intelligent code completion using Qwen2.5-Coder's capabilities1 Support for React component generation with props and state management Enable code fixing and optimization suggestions Include support for modern React patterns and hooks Preview System Create a sandboxed environment for safe code execution Implement hot-reloading for instant preview updates5 Support for different viewport sizes and responsive testing Error boundary implementation for graceful error handling Development Tools Integrate with package managers for dependency handling3 Include browser developer tools integration for debugging Implement version control system integration Add support for common React frameworks and libraries Technical Stack Required Technologies json { "backend": { "runtime": "Node.js", "ai": "Ollama with Qwen2.5-Coder", "api": "Express/FastAPI" }, "frontend": { "framework": "React", "editor": "Monaco Editor", "preview": "iframe-based renderer" }, "tooling": { "bundler": "Vite", "compiler": "Babel", "styling": "Sass" } }
Implementation Guidelines AI Integration Use Ollama's API to communicate with Qwen2.5-Coder model Implement proper error handling and rate limiting Cache common code patterns for faster responses Code Preview System javascript const PreviewSystem = { render: async (code) => { // Sanitize and validate code // Transform React code to executable format // Render in isolated environment // Return preview component }, update: (changes) => { // Handle real-time updates // Apply hot-reload // Update preview } }
User Interface Implement a clean, modern interface with proper spacing and typography Add keyboard shortcuts for common operations Include a command palette for quick actions Provide proper error messages and suggestions Export Capabilities Enable code export in multiple formats Include project scaffolding options Support for component library generation Add documentation generation This project should provide developers with a powerful tool for rapid React development while leveraging the advanced capabilities of Qwen2.5-Coder for code generation and optimization12.
- Assistant