{"id":34501363,"url":"https://github.com/sabithulla-16/codeforge","last_synced_at":"2026-04-07T22:31:06.783Z","repository":{"id":329911001,"uuid":"1120955609","full_name":"Sabithulla-16/CodeForge","owner":"Sabithulla-16","description":"CodeForge is a React-based AI-powered coding platform featuring a Monaco editor, live terminal execution, Google \u0026 Ollama AI integration, smart token management, and real-time usage analytics.","archived":false,"fork":false,"pushed_at":"2025-12-22T14:06:39.000Z","size":2866,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T19:49:23.687Z","etag":null,"topics":["ai-assistant","ai-code-editor","c","code-execution","cpp","developer-tools","google-ai","javascript","monaco-editor","ollama","online-compiler","python","react","token-analysis","web-ide"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sabithulla-16.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-22T07:56:53.000Z","updated_at":"2025-12-22T14:06:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Sabithulla-16/CodeForge","commit_stats":null,"previous_names":["sabithulla-16/codeforge"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Sabithulla-16/CodeForge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sabithulla-16%2FCodeForge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sabithulla-16%2FCodeForge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sabithulla-16%2FCodeForge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sabithulla-16%2FCodeForge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sabithulla-16","download_url":"https://codeload.github.com/Sabithulla-16/CodeForge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sabithulla-16%2FCodeForge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-assistant","ai-code-editor","c","code-execution","cpp","developer-tools","google-ai","javascript","monaco-editor","ollama","online-compiler","python","react","token-analysis","web-ide"],"created_at":"2025-12-24T02:01:16.210Z","updated_at":"2025-12-24T02:01:52.016Z","avatar_url":"https://github.com/Sabithulla-16.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/badge/version-1.0.0-blue)\n![License](https://img.shields.io/badge/license-Apache%202.0-green)\n![React](https://img.shields.io/badge/React-19.x-61DAFB?logo=react)\n![Node](https://img.shields.io/badge/Node.js-Required-339933?logo=node.js)\n![Status](https://img.shields.io/badge/status-Stable-success)\n![AI](https://img.shields.io/badge/AI-Google%20%7C%20Ollama-purple)\n\n\n# ⚡ CodeForge — AI-Powered Code Editor \u0026 Execution Platform\n\nCodeForge 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.\n\nIt is designed for **students, developers, and learners** who want clarity, control, and transparency while coding with AI.\n\n---\n\n## 📌 CodeForge \u0026 Its Functions\n\nCodeForge provides:\n\n- 🧠 **AI-assisted coding**\n  - Explain code\n  - Explain errors\n  - Optimize code\n  - Convert code between languages\n  - Custom AI prompts\n\n- 🧑‍💻 **Multi-language editor**\n  - JavaScript\n  - Python\n  - C\n  - C++\n\n- ▶️ **Real-time code execution**\n  - Compile + run flow for C/C++\n  - Direct execution for JS \u0026 Python\n  - Interactive input handling\n\n- 📊 **AI token usage tracking**\n  - Google \u0026 Ollama usage meters\n  - Per-response token history\n  - Combined usage graphs\n\n- 🔒 **AI safety controls**\n  - Token-based cooldowns\n  - Session-based Google lock\n  - Auto-switching between providers\n\n---\n\n## 🛠 Implementation\n\n### Frontend\n- Built using **React (Create React App)**\n- Monaco Editor (VS Code engine)\n- Custom Radeon-style dark UI\n- Chart.js for visual analytics\n\n### Backend\n- Node.js server\n- WebSocket-based code execution\n- AI routing and token estimation logic\n\n### AI Providers\n- **Google AI (Cloud-based)**\n- **Ollama (Local / Offline)**\n\n---\n\n## 📦 Resources Used\n\n- React\n- Monaco Editor\n- Chart.js\n- WebSockets\n- Node.js\n- Google AI API\n- Ollama\n- Custom CSS (no UI frameworks)\n\n---\n\n## ⚔️ How CodeForge Is Different From Other Editors\n\n| Feature | CodeForge | Other Editors |\n|------|---------|--------------|\n| Token visibility | ✅ Yes | ❌ Hidden |\n| AI usage graphs | ✅ Yes | ❌ No |\n| Google AI auto-lock | ✅ Yes | ❌ No |\n| Ollama fallback | ✅ Yes | ❌ Rare |\n| Compile vs Run logic | ✅ Correct | ❌ Mixed |\n| Session-based limits | ✅ Yes | ❌ No |\n| Transparent AI cost | ✅ Yes | ❌ No |\n\n---\n\n## 📸 Screenshots\n\n### 🧑‍💻 Code Editor \u0026 Terminal\n\n**JavaScript**\n![JavaScript Editor](screenshots/editor/javascript.png)\n\n**Python**\n![Python Editor](screenshots/editor/python.png)\n\n**C**\n![C Editor](screenshots/editor/c.png)\n\n**C++**\n![C++ Editor](screenshots/editor/cpp.png)\n\n---\n\n### 🤖 AI Assistant\n\n**Google AI Provider**\n![Google AI](screenshots/ai/google.png)\n\n**Ollama (Local AI)**\n![Ollama AI](screenshots/ai/ollama.png)\n\n---\n\n### 📊 Token Usage Analytics\n\n**Per-Response Token Usage**\n![Per Response Usage](screenshots/usage/per-response.png)\n\n**Combined Token Usage Graph**\n![Combined Usage](screenshots/usage/combined.png)\n---\n\n## 🚀 How to Use It\n\n### Requirements\n- Node.js ≥ 18\n- npm ≥ 9\n- Git\n\n### Installation\n```bash\ngit clone https://github.com/Sabithulla-16/CodeForge.git\ncd CodeForge\nnpm install\n```\n\n### Run Frontend\n```bash\nnpm start\n```\nRuns at:\nhttp://localhost:3000\n\n### Run Backend\n```bash\ncd backend\nnode server.js\n```\nRuns at:\nhttp://localhost:5000\n---\n\n## 🧠 AI Providers Setup\n\n### 🔹 Ollama (Local AI)\n\n- Official Site: [https://ollama.com](https://ollama.com)\n- Documentation: [https://ollama.com/docs](https://ollama.com/docs)\n- GitHub: [https://github.com/ollama/ollama](https://github.com/ollama/ollama)\n\n### Pull a Model\n\n```bash\nollama pull qwen2.5-coder:0.5b\nollama serve\n```\n\n### 🔹 Google AI (Cloud)\n\n- Google AI Studio: [https://aistudio.google.com](https://aistudio.google.com)\n- Google Cloud Console: [https://console.cloud.google.com](https://console.cloud.google.com)\n- Generative AI Docs: [https://ai.google.dev](https://ai.google.dev)\n\n---\n\n### Google API Key Generation\n\n1. Open [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project\n3. Enable **Generative AI API**\n4. Go to **APIs \u0026 Services → Credentials**\n5. Click **Create API Key**\n6. Add key to backend .env\n```bash\nGOOGLE_API_KEY=your_api_key_here\n```\n---\n\n### ✅ Advantages\n\n- No hidden AI costs\n- Clear compile/run behavior\n- Offline AI support (Ollama)\n- Beginner-friendly UI\n- Visual understanding of AI usage\n- Safe usage controls\n\n---\n\n### 🧠 Advancements Used\n\n- Session-based AI governance\n- Dynamic token estimation\n- Cooldown-based AI throttling\n- Auto AI provider switching\n- Per-response analytics visualization\n- Real-time WebSocket execution\n\n---\n\n### 🔬 New Logics Implemented\n\n1. 🔢 Token Estimation Logic\n\n- 1 token ≈ 4 characters\n- Pre-request estimation\n- Post-response reconciliation\n\n2. 🔒 Google AI Lock Logic\n\n- 4000 tokens → cooldown (120s)\n- 10 high-usage responses → session lock\n- Auto fallback to Ollama\n\n3. 🔁 Smart AI Routing\n\n- Payload size \u0026 token checks\n- Google → Ollama auto-switch\n- User transparency messages\n\n4. 📊 Usage Analytics\n\n- Per-response token logging\n- Provider-separated graphs\n- Combined usage visualization\n\n---\n\n### 🔮 Future Upgrades\n\n- Authentication \u0026 profiles\n- Persistent usage history\n- Cost estimation ($)\n- More languages (Java, Rust, Go)\n- AI debugging mode\n- Export usage reports\n- Cloud deployment support\n\n---\n\n### 👨‍💻 Developer Info\n\n- Project Name: CodeForge\n- Developer: Sabithulla\n- Role: Student / Full Stack Developer\n- Purpose: Learning, transparency, and safe AI-assisted coding\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabithulla-16%2Fcodeforge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabithulla-16%2Fcodeforge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabithulla-16%2Fcodeforge/lists"}