CodeGenius is an AI-powered application that generates high-quality code from natural language descriptions. It supports multiple programming languages, provides live syntax validation, and offers debugging assistance.
- Contextual Intent Recognition: Understands your requirements in natural language
- Multi-Language Code Generation: Supports JavaScript, TypeScript, Python, Java, C#, Go, Ruby, and more
- Live Syntax & Semantic Validation: Checks your code for errors and suggests improvements
- Interactive Debugging Support: Helps troubleshoot issues in your code
- Version Control Integration: Track your code changes
- Code Snippet Library & Templates: Store reusable code snippets for quick access
- Automated Unit Test Generation: Creates tests for your code automatically
- Security & Compliance Checks: Identifies potential security vulnerabilities
- Customizable AI Agent Workflows: Configure how the AI generates your code
- Node.js 20.x or higher
- npm 9.x or higher
- Hugging Face API Key (for AI features)
-
Clone the repository:
git clone https://github.com/yourusername/codegenius.git cd codegenius -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory with the following:HUGGINGFACE_API_TOKEN=your_huggingface_api_token -
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5000
To run the application in production mode:
npm run build
npm start-
Install electron and electron-builder:
npm install --save-dev electron electron-builder
-
Create an electron entry file (
electron.js) in the root directory:const { app, BrowserWindow } = require('electron'); const path = require('path'); const express = require('express'); const server = require('./server/index.js'); let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ width: 1200, height: 800, webPreferences: { nodeIntegration: true, contextIsolation: false } }); mainWindow.loadURL('http://localhost:5000'); mainWindow.on('closed', () => mainWindow = null); } app.on('ready', createWindow); app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit(); }); app.on('activate', () => { if (mainWindow === null) createWindow(); });
-
Update your
package.jsonwith electron configuration:{ "main": "electron.js", "scripts": { "electron": "electron .", "package-win": "electron-builder --win --x64" }, "build": { "appId": "com.yourdomain.codegenius", "productName": "CodeGenius", "win": { "target": "nsis", "icon": "assets/icon.ico" } } } -
Build the Windows installer:
npm run package-win
The installer will be available in the
distfolder.
To package the application for Android, we'll use Capacitor:
-
Install Capacitor:
npm install --save @capacitor/core @capacitor/android npm install --save-dev @capacitor/cli
-
Initialize Capacitor in your project:
npx cap init CodeGenius com.yourdomain.codegenius --web-dir dist
-
Build your web application:
npm run build
-
Add Android platform:
npx cap add android
-
Update the Android configuration:
npx cap copy android npx cap sync android
-
Open Android Studio to build and run:
npx cap open android
-
In Android Studio:
- Build -> Build Bundle(s) / APK(s) -> Build APK(s)
- Or Build -> Generate Signed Bundle/APK for release version
POST /api/code/generate
Content-Type: application/json
{
"prompt": "Create a function that calculates the Fibonacci sequence",
"language": "javascript",
"generateTests": true
}POST /api/code/validate
Content-Type: application/json
{
"code": "function example() { console.log('Hello') }",
"language": "javascript"
}POST /api/code/generate-tests
Content-Type: application/json
{
"code": "function sum(a, b) { return a + b; }",
"language": "javascript"
}The application uses a client-server architecture:
- Frontend: React with TypeScript, using tailwind CSS and shadcn components for the UI
- Backend: Express.js server with Qdrant for storage
- AI Model: Hugging Face models for code generation, validation, and test generation
MIT
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-new-feature - Submit a pull request