CompileVerse is not just another online code compiler. It's an intelligent coding environment designed to help you write better, more efficient code by leveraging the power of Google's Gemini AI.
Here's a glimpse of CompileVerse in action:
- Multi-Language Support: Compile and run code in Java, C++, Python, and C.
- AI-Powered Complexity Analysis: Instantly get the accurate Time and Space Complexity for every execution.
- AI Code Review: Click "AI-Review" to receive an optimized version of your code, complete with its own complexity analysis. Learn best practices on the fly!
- User-Friendly Interface:
- Code Download: Easily save your code files locally.
- One-Click Copy: Copy your code or the output with a single click.
- Light & Dark Mode: Switch between themes for your comfort.
- Frontend: React, Tailwind CSS
- Backend: Node.js, Express.js
- AI Integration: Google Gemini API
- Containerization: Docker
Follow these steps in order to get the project running on your local machine.
First, clone the project repository from GitHub and navigate into the project directory.
git clone https://github.com/Varni1512/CompileVerse.git
cd CompileVerseNow that you have the code, you can proceed to set up the backend and frontend.
From the CompileVerse root directory, you can set up the backend.
This method uses Docker to run the backend in a containerized environment, which includes all necessary compilers (C, C++, Java) and runtimes (Python).
- Docker
-
Navigate to the backend directory:
cd backend -
Create the
Dockerfile: Create a file namedDockerfilein thebackenddirectory with the following content:# Use an official Node.js runtime as a parent image. # Using 'slim' is a good practice for smaller image sizes. FROM node:20-slim # Install all necessary compilers and runtimes in one layer. # build-essential: Installs gcc (for C) and g++ (for C++). # openjdk-17-jdk: Installs the Java Development Kit (JDK). # python3: Installs the Python 3 runtime. RUN apt-get update && apt-get install -y build-essential openjdk-17-jdk python3 && \ # Clean up the apt cache to keep the image size down rm -rf /var/lib/apt/lists/* # Set the working directory inside the container WORKDIR /app # Copy package.json and package-lock.json first to leverage Docker's layer caching. COPY package*.json ./ # Install Node.js dependencies RUN npm install # Copy the rest of your application's source code into the container COPY . . # Make the app port available to the world outside this container EXPOSE 8000 # Define the command to run your app CMD ["node", "index.js"]
-
Create a
.envfile in thebackenddirectory:touch .env
Add your Gemini API key to this file:
GEMINI_API_KEY=YOUR_API_KEY_HERE -
Build and Run the Docker Container: From inside the
backenddirectory, run the following commands:# Build the Docker image docker build -t compileverse-backend . # Run the container from the image docker run -d -p 8000:8000 --env-file .env --name compileverse-backend-container compileverse-backend
The backend server will now be running at http://localhost:8000.
This method requires you to have Node.js and all language compilers (GCC, G++, JDK, Python) installed on your local machine.
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Create a
.envfile and add your API key:Yourtouch .env
backend/.envfile should contain:GEMINI_API_KEY=YOUR_API_KEY_HERE - Start the server:
npx nodemon index.js
The backend server will start on http://localhost:8000.
After your backend is running, open a new terminal window. From the CompileVerse root directory, set up the frontend.
- Navigate to the frontend directory:
# Make sure you are in the root 'CompileVerse' directory first cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
The frontend will be available at http://localhost:5173 and will connect to your running backend.
- Fixie: An interactive AI chatbot that guides you through coding problems. It will access your code to give hints and explanations without providing the final answer, acting as a true programming tutor.
Contributions are welcome! Feel free to open an issue or submit a pull request to make CompileVerse even better.
Made with ❤️ by Varnikumar Patel
