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 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
- Built using React (Create React App)
- Monaco Editor (VS Code engine)
- Custom Radeon-style dark UI
- Chart.js for visual analytics
- Node.js server
- WebSocket-based code execution
- AI routing and token estimation logic
- Google AI (Cloud-based)
- Ollama (Local / Offline)
- React
- Monaco Editor
- Chart.js
- WebSockets
- Node.js
- Google AI API
- Ollama
- Custom CSS (no UI frameworks)
| 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 |
- Node.js โฅ 18
- npm โฅ 9
- Git
git clone https://github.com/Sabithulla-16/CodeForge.git
cd CodeForge
npm installnpm startRuns at: http://localhost:3000
cd backend
node server.jsRuns at: http://localhost:5000
- Official Site: https://ollama.com
- Documentation: https://ollama.com/docs
- GitHub: https://github.com/ollama/ollama
ollama pull qwen2.5-coder:0.5b
ollama serve- Google AI Studio: https://aistudio.google.com
- Google Cloud Console: https://console.cloud.google.com
- Generative AI Docs: https://ai.google.dev
- Open Google Cloud Console
- Create a new project
- Enable Generative AI API
- Go to APIs & Services โ Credentials
- Click Create API Key
- Add key to backend .env
GOOGLE_API_KEY=your_api_key_here- No hidden AI costs
- Clear compile/run behavior
- Offline AI support (Ollama)
- Beginner-friendly UI
- Visual understanding of AI usage
- Safe usage controls
- Session-based AI governance
- Dynamic token estimation
- Cooldown-based AI throttling
- Auto AI provider switching
- Per-response analytics visualization
- Real-time WebSocket execution
- ๐ข Token Estimation Logic
- 1 token โ 4 characters
- Pre-request estimation
- Post-response reconciliation
- ๐ Google AI Lock Logic
- 4000 tokens โ cooldown (120s)
- 10 high-usage responses โ session lock
- Auto fallback to Ollama
- ๐ Smart AI Routing
- Payload size & token checks
- Google โ Ollama auto-switch
- User transparency messages
- ๐ Usage Analytics
- Per-response token logging
- Provider-separated graphs
- Combined usage visualization
- Authentication & profiles
- Persistent usage history
- Cost estimation ($)
- More languages (Java, Rust, Go)
- AI debugging mode
- Export usage reports
- Cloud deployment support
- Project Name: CodeForge
- Developer: Sabithulla
- Role: Student / Full Stack Developer
- Purpose: Learning, transparency, and safe AI-assisted coding







