Skip to content

UKbhatt/SupremeCoding

Repository files navigation

image SupremeCoding

An online code compiler & coding platform powered by a custom-built Node.js backend.


🚀 Features

  • 🔥 Real-time code execution for JavaScript, Python, Java, and C++
  • ✨ Code editor with Monaco Editor (VS Code UI)
  • ✅ Run test cases and custom input
  • 📚 Question database powered by MongoDB
  • 🧠 LeetCode-style question screen with constraints, examples, difficulty tags
  • 🛠️ Built from scratch: custom compiler backend using child process

🛠️ Tech Stack

Frontend Backend Database Code Execution
React.js Node.js + Express MongoDB (Mongoose) Native Compiler (child_process)

📦 Local Setup

1. Clone the repo

git clone https://github.com/your-username/SupremeCoding.git
cd SupremeCoding

2. Backend Setup

cd server
npm install
node index.js

NOTE: Ensure compilers (g++, javac, python, node) are installed on your system.

3.Frontend Setup

cd client
npm install
npm run dev

🔄 API Overview

POST /api/compile
{
  code: "...",
  language: "cpp" | "python" | "java" | "javascript",
  input: "user input"
}
✅ Returns output or error based on compilation

📁 Folder Structure

SUPREME_CODING/
├── public/                      # Static assets (if any)
│
├── server/                     # Backend (Node.js + Compiler)
│   ├── compiler/               # Custom compiler logic
│   │   ├── temp/               
│   │   └── index.js         
│   ├── data/                   
│   │   └── questions.js        # Array of questions (acts like DB)
│   ├── routes/
│   │   ├── compiler.js         # /api/compile route
│   │   └── questions.js        
│   ├── index.js                #Express server
│   ├── package.json
│   └── package-lock.json
│
├── src/                        # Frontend
│   ├── assets/                 
│   ├── components/             
│   ├── screens/                # Pages like SolutionScreen.jsx
│   ├── App.jsx
│   ├── App.css
│   ├── main.jsx                # ReactDOM root
│   ├── index.css               # Tailwind or global styles
│
├── .env                        # Environment variables
├── .gitignore
├── index.html
├── package.json               # React app config
├── package-lock.json
└── README.md

🛠️ Compiler Flow

Frontend ➜ POST /api/compile ➜<br>
  Backend (child_process)<br>
    ➜ Saves code + input<br>
    ➜ Compiles (if needed)<br>
    ➜ Runs & captures output<br>
    ➜ Deletes temp folder<br>

🧪 Test Case Execution

  1. ✅ Compare output with expected
  2. 💥 Show Pass/Fail with color indicators using "react-hot-toast"
  3. 🕐 Execution time is recorded

✨ Future Enhancements

  1. 🔐 Add Auth (JWT)
  2. 📈 Leaderboard
  3. 🧠 Save Submissions
  4. 📊 Code Metrics + Time

🤝 Contributing

git checkout -b feature/your-feature
git commit -m "Add: new feature"
git push origin feature/your-feature

🌍 Contact

💻 Author: Utkarsh
📧 Email: [email protected]
🐙 GitHub: https://github.com/UKbhatt

Built in Dark Theme because Light Attracts Bugs 🐞

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages