Skip to content

CodeForge is a React-based AI-powered coding platform featuring a Monaco editor, live terminal execution, Google & Ollama AI integration, smart token management, and real-time usage analytics.

License

Notifications You must be signed in to change notification settings

Sabithulla-16/CodeForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Version License React Node Status AI

โšก CodeForge โ€” AI-Powered Code Editor & Execution Platform

CodeForge is a modern AI-powered coding platform built with React that combines a real code editor, compiler/runtime, AI assistant, token-aware usage analytics, and smart safety controls โ€” all in one place.

It is designed for students, developers, and learners who want clarity, control, and transparency while coding with AI.


๐Ÿ“Œ CodeForge & Its Functions

CodeForge provides:

  • ๐Ÿง  AI-assisted coding

    • Explain code
    • Explain errors
    • Optimize code
    • Convert code between languages
    • Custom AI prompts
  • ๐Ÿง‘โ€๐Ÿ’ป Multi-language editor

    • JavaScript
    • Python
    • C
    • C++
  • โ–ถ๏ธ Real-time code execution

    • Compile + run flow for C/C++
    • Direct execution for JS & Python
    • Interactive input handling
  • ๐Ÿ“Š AI token usage tracking

    • Google & Ollama usage meters
    • Per-response token history
    • Combined usage graphs
  • ๐Ÿ”’ AI safety controls

    • Token-based cooldowns
    • Session-based Google lock
    • Auto-switching between providers

๐Ÿ›  Implementation

Frontend

  • Built using React (Create React App)
  • Monaco Editor (VS Code engine)
  • Custom Radeon-style dark UI
  • Chart.js for visual analytics

Backend

  • Node.js server
  • WebSocket-based code execution
  • AI routing and token estimation logic

AI Providers

  • Google AI (Cloud-based)
  • Ollama (Local / Offline)

๐Ÿ“ฆ Resources Used

  • React
  • Monaco Editor
  • Chart.js
  • WebSockets
  • Node.js
  • Google AI API
  • Ollama
  • Custom CSS (no UI frameworks)

โš”๏ธ How CodeForge Is Different From Other Editors

Feature CodeForge Other Editors
Token visibility โœ… Yes โŒ Hidden
AI usage graphs โœ… Yes โŒ No
Google AI auto-lock โœ… Yes โŒ No
Ollama fallback โœ… Yes โŒ Rare
Compile vs Run logic โœ… Correct โŒ Mixed
Session-based limits โœ… Yes โŒ No
Transparent AI cost โœ… Yes โŒ No

๐Ÿ“ธ Screenshots

๐Ÿง‘โ€๐Ÿ’ป Code Editor & Terminal

JavaScript JavaScript Editor

Python Python Editor

C C Editor

C++ C++ Editor


๐Ÿค– AI Assistant

Google AI Provider Google AI

Ollama (Local AI) Ollama AI


๐Ÿ“Š Token Usage Analytics

Per-Response Token Usage Per Response Usage

Combined Token Usage Graph Combined Usage

๐Ÿš€ How to Use It

Requirements

  • Node.js โ‰ฅ 18
  • npm โ‰ฅ 9
  • Git

Installation

git clone https://github.com/Sabithulla-16/CodeForge.git
cd CodeForge
npm install

Run Frontend

npm start

Runs at: http://localhost:3000

Run Backend

cd backend
node server.js

๐Ÿง  AI Providers Setup

๐Ÿ”น Ollama (Local AI)

Pull a Model

ollama pull qwen2.5-coder:0.5b
ollama serve

๐Ÿ”น Google AI (Cloud)


Google API Key Generation

  1. Open Google Cloud Console
  2. Create a new project
  3. Enable Generative AI API
  4. Go to APIs & Services โ†’ Credentials
  5. Click Create API Key
  6. Add key to backend .env
GOOGLE_API_KEY=your_api_key_here

โœ… Advantages

  • No hidden AI costs
  • Clear compile/run behavior
  • Offline AI support (Ollama)
  • Beginner-friendly UI
  • Visual understanding of AI usage
  • Safe usage controls

๐Ÿง  Advancements Used

  • Session-based AI governance
  • Dynamic token estimation
  • Cooldown-based AI throttling
  • Auto AI provider switching
  • Per-response analytics visualization
  • Real-time WebSocket execution

๐Ÿ”ฌ New Logics Implemented

  1. ๐Ÿ”ข Token Estimation Logic
  • 1 token โ‰ˆ 4 characters
  • Pre-request estimation
  • Post-response reconciliation
  1. ๐Ÿ”’ Google AI Lock Logic
  • 4000 tokens โ†’ cooldown (120s)
  • 10 high-usage responses โ†’ session lock
  • Auto fallback to Ollama
  1. ๐Ÿ” Smart AI Routing
  • Payload size & token checks
  • Google โ†’ Ollama auto-switch
  • User transparency messages
  1. ๐Ÿ“Š Usage Analytics
  • Per-response token logging
  • Provider-separated graphs
  • Combined usage visualization

๐Ÿ”ฎ Future Upgrades

  • Authentication & profiles
  • Persistent usage history
  • Cost estimation ($)
  • More languages (Java, Rust, Go)
  • AI debugging mode
  • Export usage reports
  • Cloud deployment support

๐Ÿ‘จโ€๐Ÿ’ป Developer Info

  • Project Name: CodeForge
  • Developer: Sabithulla
  • Role: Student / Full Stack Developer
  • Purpose: Learning, transparency, and safe AI-assisted coding

About

CodeForge is a React-based AI-powered coding platform featuring a Monaco editor, live terminal execution, Google & Ollama AI integration, smart token management, and real-time usage analytics.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •