A modern, web-based code generator and template management system built with React and Vite. This tool provides an intuitive interface for creating, editing, and managing code templates across multiple programming languages.
- Multi-language Support: CSS, Dart (Flutter), HTML, JavaScript, Python, React, Ruby
- Live Code Editor: Monaco Editor with syntax highlighting and IntelliSense
- Template System: Pre-built templates for common coding scenarios
- Live Preview: Real-time code preview with syntax highlighting
- CSS Stylesheets
- HTML Page Template
- CSS within HTML header
- JS within HTML header
- Flutter Widgets using Dart Language
- Python Scripts
- React Components
- Ruby on Rails Components
- Node.js (version 14 or higher)
- npm or yarn package manager
- Clone or download the project files
- Navigate to the project directory
- Install dependencies:
npm install
Important: This is a React application that requires a development server to run properly.
To start the development server:
npm run devAfter running this command, you'll see output similar to:
> code-generator-tool@0.0.0 dev
> vite
VITE v4.2.0 ready in 500 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Open your browser and navigate to the localhost URL shown in the terminal (typically http://localhost:5173/).
Note: Do not open the index.html file directly in your browser - it will show a blank page because React applications need to be processed by the development server.
npm run dev- Starts the development servernpm run build- Builds the app for productionnpm run preview- Preview the production build locally
- Select a Template: Choose from the available templates in the Template Selector panel
- Edit Code: Use the Monaco code editor to modify or write new code
- Change Language: Select different programming languages from the dropdown to change how the syntax is processed for errors, or color coded
- Live Preview: View your code with syntax highlighting in the preview panel
src/
├── components/
│ ├── CodeEditor.jsx # Monaco editor component
│ ├── TemplateSelector.jsx # Template selection interface
│ ├── ExportOptions.jsx # Export functionality
│ ├── LivePreview.jsx # Code preview with syntax highlighting
│ └── TemplateSharing.jsx # Template sharing features
├── utils/
│ └── templateUtils.js # Template management utilities
├── styles/
│ └── globals.css # Global styles and Tailwind CSS
└── App.jsx # Main application component
- React 18 - UI framework
- Vite - Build tool and development server
- Monaco Editor - Code editor (same as VS Code)
- Tailwind CSS - Utility-first CSS framework
- React Syntax Highlighter - Code syntax highlighting
- PrismJS - Additional syntax highlighting support
If you see a blank page, make sure you're:
- Running
npm run dev(not justnpm run) - Accessing the localhost URL from the terminal output
- Not opening
index.htmldirectly in your browser
- Check available scripts:
npm run - Start development server:
npm run dev - Install dependencies:
npm install - Check for vulnerabilities:
npm audit
This project uses modern web development practices with React hooks, component-based architecture, and responsive design. Feel free to extend the functionality by adding new templates, export formats, or language support.
This project is open source and available under the MIT License.