An open API service indexing awesome lists of open source software.

https://github.com/avdeshjadon/codemanipulate

Convert code between any programming language in seconds! AI-powered detection, cross-language translation, and professional formatting - all in one tool.
https://github.com/avdeshjadon/codemanipulate

code-converter code-detection code-formatter code-translation developer-tools prettier programming-tools syntax-converter

Last synced: 4 months ago
JSON representation

Convert code between any programming language in seconds! AI-powered detection, cross-language translation, and professional formatting - all in one tool.

Awesome Lists containing this project

README

          

# ๐Ÿ”„ CodeManipulate โ€” AI-Powered Code Language Converter & Formatter

[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-Deployed-brightgreen)](https://avdeshjadon.github.io/CodeManipulate)
[![Node.js](https://img.shields.io/badge/Node.js-v18%2B-green)](https://nodejs.org/)
[![Express.js](https://img.shields.io/badge/Express.js-v4.18-blue)](https://expressjs.com/)
[![Google AI](https://img.shields.io/badge/Google%20AI-Gemini-orange)](https://ai.google.dev/)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)

## ๐ŸŒŸ Overview

**CodeManipulate** (formerly CodeLangConvert) is a sophisticated, AI-powered web application designed to revolutionize how developers work with code across multiple programming languages. Built with cutting-edge Google Generative AI technology, this tool provides intelligent code language detection, seamless cross-language conversion, and professional code formatting capabilities.

### ๐ŸŽฏ Key Highlights

- **๐Ÿง  Advanced AI Detection**: Utilizes Google's Gemini AI for accurate language detection with 99%+ accuracy
- **โšก Lightning Fast**: Process up to 5000 characters of code in under 3 seconds
- **๐ŸŒ Universal Support**: Covers 25+ programming languages and frameworks
- **๐ŸŽจ Professional Formatting**: Built-in Prettier integration for consistent code styling
- **๐Ÿ“ฑ Responsive Design**: Fully optimized for desktop, tablet, and mobile devices
- **๐ŸŒ— Dark/Light Themes**: Eye-friendly themes for extended coding sessions
- **๐Ÿ“‚ File Upload Support**: Direct file processing for multiple formats
- **๐Ÿ”’ Privacy First**: No code storage, all processing happens client-side where possible

---

## โœจ Comprehensive Feature Set

### ๐Ÿ” Intelligent Code Detection
- **Auto-Detection Engine**: Powered by Google Gemini AI with machine learning algorithms
- **Syntax Analysis**: Deep parsing of code structure, keywords, and patterns
- **Multi-Language Support**: Detects 25+ languages including modern frameworks
- **Confidence Scoring**: Provides accuracy percentages for detection results
- **Edge Case Handling**: Manages mixed-language files and code snippets

### ๐Ÿ” Advanced Code Conversion
- **Cross-Language Translation**: Convert between any supported language pairs
- **Context Preservation**: Maintains logic flow, variable naming, and code structure
- **Comment Translation**: Preserves and translates code comments
- **Framework Adaptation**: Adapts to target language conventions and best practices
- **Error Handling**: Graceful handling of conversion limitations and edge cases

### ๐Ÿงน Professional Code Formatting
- **Multi-Language Formatting**: Supports 17 major languages and formats
- **Customizable Rules**: Configurable indentation, spacing, and style preferences
- **Real-Time Processing**: Instant formatting with live preview
- **Consistency Enforcement**: Ensures uniform code style across projects
- **Integration Ready**: Compatible with popular IDE formatting standards

### ๐Ÿ“‚ File Processing Capabilities
- **Multiple Format Support**: `.js`, `.py`, `.cpp`, `.ts`, `.json`, `.html`, `.css`, and more
- **Drag & Drop Interface**: Intuitive file upload with visual feedback
- **Batch Processing**: Handle multiple files simultaneously
- **Size Optimization**: Efficient processing of large code files
- **Preview Mode**: Review files before processing

### ๐ŸŽจ User Experience Features
- **Intuitive Interface**: Clean, modern design with minimal learning curve
- **Real-Time Feedback**: Live character count, progress indicators, and status updates
- **Copy-to-Clipboard**: One-click copying with success notifications
- **Download Results**: Export converted code to various file formats
- **History Tracking**: Session-based history of recent conversions (no persistent storage)

---

## ๐Ÿ› ๏ธ Technical Architecture

### ๐Ÿ—๏ธ System Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Frontend โ”‚ โ”‚ Backend โ”‚ โ”‚ AI Service โ”‚
โ”‚ (Client-Side) โ”‚โ—„โ”€โ”€โ”€โ”ค (Node.js) โ”‚โ—„โ”€โ”€โ”€โ”ค (Google AI) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ โ”‚ โ”‚
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ€ข HTML5/CSS3 โ”‚ โ”‚ โ€ข Express.js โ”‚ โ”‚ โ€ข Gemini API โ”‚
โ”‚ โ€ข Vanilla JS โ”‚ โ”‚ โ€ข Body Parser โ”‚ โ”‚ โ€ข NLP Models โ”‚
โ”‚ โ€ข Prettier.js โ”‚ โ”‚ โ€ข CORS โ”‚ โ”‚ โ€ข ML Algorithms โ”‚
โ”‚ โ€ข File APIs โ”‚ โ”‚ โ€ข dotenv โ”‚ โ”‚ โ€ข Cloud Scale โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### ๐Ÿง  AI Processing Pipeline

1. **Input Sanitization**: Clean and validate user input
2. **Language Detection**: AI-powered syntax and pattern analysis
3. **Context Analysis**: Understand code structure and dependencies
4. **Translation Engine**: Convert logic and syntax to target language
5. **Post-Processing**: Format, optimize, and validate output
6. **Quality Assurance**: Error checking and consistency validation

### ๐ŸŒ Frontend Architecture

**Core Technologies:**
- **HTML5**: Semantic markup with accessibility features
- **CSS3**: Modern styling with Flexbox and Grid layouts
- **Vanilla JavaScript**: ES6+ features for optimal performance
- **Web APIs**: File API, Clipboard API, Local Storage API

**Key Components:**
- **Language Selector**: Dynamic dropdown with search functionality
- **Code Editor**: Syntax-highlighted text areas with line numbers
- **File Uploader**: Drag-and-drop with progress indicators
- **Theme Controller**: Dark/light mode with system preference detection
- **Result Panel**: Formatted output with copy/download options

---

## ๐Ÿ“ฆ Detailed Project Structure

```
CodeManipulate/
โ”œโ”€โ”€ images/ (๐Ÿ“ Contains static images/icons used in the website)
โ”‚ โ””โ”€โ”€ favicon.ico (๐ŸŒŸ Favicon for the browser tab icon)
| โ””โ”€โ”€ Screenshot.png (๐Ÿ“ Website Screenshot )
โ”‚
โ”œโ”€โ”€ node_modules/ (๐Ÿ“ Installed dependencies via npm; auto-generated folder)
โ”‚
โ”œโ”€โ”€ public/ (๐Ÿ“ Main public-facing files for frontend)
โ”‚
โ”‚ โ”œโ”€โ”€ css/ (๐Ÿ“ All stylesheets used for styling the frontend)
โ”‚ โ”‚ โ”œโ”€โ”€ formatter.css (๐ŸŽจ Styles specifically for the formatter page/component)
โ”‚ โ”‚ โ””โ”€โ”€ style.css (๐ŸŽจ General styles for the main index/home page)
โ”‚
โ”‚ โ”œโ”€โ”€ script/ (๐Ÿ“ JavaScript files for app logic & functionality)
โ”‚ โ”‚ โ”œโ”€โ”€ formatter.js (๐Ÿง  Handles code formatting using supported libraries)
โ”‚ โ”‚ โ””โ”€โ”€ main.js (๐Ÿง  Controls UI interactions, language conversion, theme toggling)
โ”‚
โ”‚ โ”œโ”€โ”€ formatter.html (๐Ÿ“ Dedicated page for code formatting feature only)
โ”‚ โ””โ”€โ”€ index.html (๐Ÿ  Main homepage with language detection & code conversion)
โ”‚
โ”œโ”€โ”€ .env (๐Ÿ” Stores API keys like Google Gemini โ€” not shared publicly)
โ”œโ”€โ”€ .gitignore (๐Ÿšซ Tells Git to ignore files/folders like node_modules, .env)
โ”‚
โ”œโ”€โ”€ package.json (๐Ÿ“ฆ Declares project metadata, scripts, and dependencies)
โ”œโ”€โ”€ package-lock.json (๐Ÿ“ฆ Auto-generated file that locks dependency versions for reproducibility)
โ”‚
โ”œโ”€โ”€ LICENSE (๐Ÿ“ MIT License)
|
โ”œโ”€โ”€ server.js (๐Ÿ–ฅ๏ธ Node.js + Express backend server to handle API requests to Gemini)
โ””โ”€โ”€ README.md (๐Ÿ“˜ Documentation about your project, features, usage, etc.)

```

---

## ๐Ÿš€ Quick Start Guide

### ๐Ÿ”ง Prerequisites

**System Requirements:**
- **Node.js**: v18.0.0 or higher
- **npm**: v8.0.0 or higher
- **Git**: Latest stable version
- **Modern Browser**: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

**API Requirements:**
- Google AI Platform account
- Valid Gemini API key
- Sufficient API quota for your usage

### โšก Installation Steps

1. **Clone the Repository**
```bash
git clone https://github.com/avdeshjadon/CodeManipulate.git
cd CodeManipulate
```

2. **Install Dependencies**
```bash
npm install
```

3. **Configure Environment Variables**
```env
# Google AI Configuration
GOOGLE_API_KEY=your_gemini_api_key_here
```

4. **Start Development Server**
```bash
npm run dev
# or
node server.js
```

5. **Access Application**
- Open browser to `http://localhost:3000`
- Verify all features are working correctly

### ๐ŸŒ Production Deployment

**GitHub Pages Deployment:**
1. Fork the repository to your GitHub account
2. Configure repository settings for GitHub Pages
3. Update API & .env endpoints in configuration
4. Deploy using GitHub Actions workflow

**Manual Deployment:**
```bash
npm run build
npm start
```

---

## ๐ŸŽฏ Usage Instructions

### ๐Ÿ” Language Detection & Conversion

**Step 1: Input Your Code**
1. Navigate to the main application interface
2. Paste your code into the source code text area
3. The system automatically detects character count (max 5000)
4. Real-time syntax validation provides immediate feedback

**Step 2: Language Detection**
1. Click "Detect Language" or wait for auto-detection
2. AI analyzes syntax patterns, keywords, and structure
3. Detection results show confidence percentage
4. Manual override available if needed

**Step 3: Select Target Language**
1. Choose desired output language from dropdown
2. Preview conversion complexity and estimated time
3. Select any additional conversion options
4. Confirm conversion parameters

**Step 4: Convert & Download**
1. Click "Convert Code" to start AI processing
2. Monitor progress with real-time updates
3. Review converted code with syntax highlighting
4. Copy to clipboard or download as file

### ๐Ÿงน Code Formatting

**Supported Languages for Formatting:**
- **Web Technologies**: HTML, CSS, SCSS, LESS, JavaScript, TypeScript
- **Frameworks**: JSX, TSX, Vue.js components
- **Data Formats**: JSON, JSON5, JSONC, YAML
- **Documentation**: Markdown, MDX
- **Query Languages**: GraphQL
- **Template Engines**: Handlebars

**Formatting Options:**
- **Indentation**: Spaces (2, 4) or Tabs
- **Line Width**: 80, 100, 120 characters
- **Semicolons**: Always, never, or preserve
- **Quotes**: Single, double, or preserve
- **Trailing Commas**: All, ES5, none

### ๐Ÿ“‚ File Upload & Processing

**Supported File Types:**
```
Programming Languages:
.js, .jsx, .ts, .tsx, .py, .java, .cpp, .c, .cs, .php, .rb, .go, .rs, .swift, .kt, .scala, .dart

Web Technologies:
.html, .htm, .css, .scss, .sass, .less, .vue

Data & Configuration:
.json, .yaml, .yml, .xml, .toml, .ini, .env

Documentation:
.md, .mdx, .txt, .rst

Others:
.sql, .sh, .ps1, .dockerfile
```

---

## ๐Ÿ“Š Supported Languages Matrix

### ๐Ÿ”„ Conversion Support Matrix

| Source Language | Target Languages | Conversion Quality | Notes |
|-----------------|------------------|-------------------|-------|
| **JavaScript** | Python, Java, C++, TypeScript, Go | โญโญโญโญโญ | Excellent support for all modern JS features |
| **Python** | JavaScript, Java, C++, Go, Rust | โญโญโญโญโญ | Strong support for Python 3.x syntax |
| **Java** | C++, C#, Python, JavaScript, Kotlin | โญโญโญโญ | Good OOP concept translation |
| **C++** | C, Java, C#, Rust, Go | โญโญโญโญ | Memory management concepts adapted |
| **TypeScript** | JavaScript, Java, C#, Python | โญโญโญโญโญ | Type information preserved where possible |
| **C#** | Java, C++, VB.NET, F#, TypeScript | โญโญโญโญ | .NET ecosystem compatibility |
| **Go** | C++, Rust, Java, Python | โญโญโญโญ | Concurrency patterns translated |
| **Rust** | C++, C, Go, Zig | โญโญโญโญ | Memory safety concepts explained |
| **PHP** | JavaScript, Python, Java, C# | โญโญโญ | Web-specific features adapted |
| **Ruby** | Python, JavaScript, Java | โญโญโญ | Dynamic features preserved |
| **Swift** | Objective-C, Java, Kotlin, C++ | โญโญโญโญ | iOS-specific concepts documented |
| **Kotlin** | Java, Swift, C#, TypeScript | โญโญโญโญ | Interoperability features maintained |
| **Dart** | JavaScript, TypeScript, Java | โญโญโญ | Flutter-specific patterns adapted |
| **Scala** | Java, Kotlin, F#, Haskell | โญโญโญ | Functional programming concepts preserved |
| **Haskell** | Scala, F#, OCaml, Elm | โญโญโญ | Pure functional paradigms explained |

### ๐Ÿงน Formatting Support

| Language | Prettier | Auto-Fix |
|----------|----------|--------------|
| **JavaScript** | โœ… | โœ… |
| **TypeScript** | โœ… | โœ… |
| **JSX/TSX** | โœ… | โœ… |
| **HTML** | โœ… | โœ… |
| **CSS/SCSS** | โœ… | โœ… |
| **JSON** | โœ… | โœ… |
| **Markdown** | โœ… | โœ… |
| **Vue** | โœ… | โœ… |
| **YAML** | โœ… | โœ… |
| **GraphQL** | โœ… | โœ… |
| **Python** | โŒ | โš ๏ธ |
| **Java** | โŒ | โš ๏ธ |
| **C++** | โŒ | โš ๏ธ |

---

## ๐Ÿค Contributing

We welcome contributions from developers of all skill levels! Here's how you can help make CodeManipulate even better:

### ๐Ÿ› ๏ธ How to Contribute

1. **Fork the Repository**
```bash
git fork https://github.com/avdeshjadon/CodeManipulate.git
```

2. **Create a Feature Branch**
```bash
git checkout -b feature/your-amazing-feature
```

3. **Make Your Changes**
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation as needed

4. **Submit a Pull Request**
- Provide a clear description of changes
- Include screenshots for UI changes
- Reference any related issues

### ๐Ÿ› Bug Reports & Feature Requests

- **Found a Bug?** Open an issue with detailed reproduction steps
- **Have an Idea?** Create a feature request with use cases and examples
- **Need Help?** Check existing issues or start a discussion

### ๐Ÿ’ก Areas We Need Help

- **Language Support**: Add support for new programming languages
- **AI Improvements**: Enhance detection accuracy and conversion quality
- **UI/UX**: Improve user interface and experience
- **Testing**: Add comprehensive test coverage
- **Documentation**: Improve guides and API documentation
- **Performance**: Optimize code processing speed and efficiency

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

```
MIT License

Copyright (c) 2024 Avdesh Jadon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

---

## ๐Ÿ™ Acknowledgments

- **Google AI Team** for providing the powerful Gemini API
- **Prettier Team** for the excellent code formatting library
- **Open Source Community** for inspiration and feedback
- **Beta Testers** who helped improve the application
- **All Contributors** who made this project possible

---

## ๐Ÿ“ž Contact & Support

- **Developer**: [Avdesh Jadon](https://github.com/avdeshjadon)
- **Project Repository**: [CodeManipulate on GitHub](https://github.com/avdeshjadon/CodeManipulate)
- **Live Demo**: [Try CodeManipulate](https://codemanipulate.onrender.com/)
- **Issues & Bug Reports**: [GitHub Issues](https://github.com/avdeshjadon/CodeManipulate/issues)

---

## ๐ŸŒŸ Show Your Support

If you find CodeManipulate helpful, please consider:

### โญ **Star this repository**
Click the โญ button at the top of this page to show your support!

### ๐Ÿด **Fork this project**
Help us grow by creating your own copy and contributing improvements!

### ๐Ÿ”— **Share with others**
Spread the word about CodeManipulate in your developer community!

### ๐Ÿ’ **Contribute**
Join our growing community of contributors and help make coding easier for everyone!

---

### ๐Ÿš€ **Ready to Transform Your Code?**

**[๐ŸŒ Try CodeManipulate Now](https://codemanipulate.onrender.com/)**

---


Built with โค๏ธ by Avdesh Jadon and the amazing open source community