Skip to content
jjinendra3Public

About

A code running and sharing platform on AWS-EC2, leveraging Docker containers for efficient execution. Supports C, C++, Python, Go, Java & JavaScript. Users can perform Git operations, edit code, and share multiple files with ease.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

CodeBrim - Compiler on the Go! πŸš€

CodeBrim lets developers run, edit, and share code projects online with full Git integration, multi-file support, and Docker-secure execution – no GitHub required.

Live Demo License Version

CodeBrim is a deployed robust code execution platform supporting Python, JavaScript, Java, C++, C, and Go using Docker containerization on AWS EC2, ensuring complete runtime isolation security. Engineered with distinctive collaboration capabilities including Git integration, real-time multi-file support, and persistent code sharing via unique URLs - features unavailable in other competing platforms.

✨ Features

🌐 Multi-Language Support

  • C/C++ - Full compilation with GCC support
  • Java - Complete Java environment with JDK
  • Python - Latest Python runtime environment
  • JavaScript - Node.js execution engine
  • Go - Go compiler with full standard library
  • Text Files - Documentation and configuration file support

πŸ”— Distinctive Collaboration Features

  • Persistent Code Sharing - Share multiple files through a single unique URL
  • Access Control - Grant either editable or read-only access to shared projects
  • Real-time Multi-file Support - Collaborate on entire project structures with complete file and folder structure
  • Cross-platform Compatibility - Access from any device with a browser

πŸ”§ Integrated Git Operations

  • Direct Repository Management - Pull public repositories directly on the website
  • Live Code Editing - Make changes and run code in real-time
  • Push to Remote - Push changes back to remote repositories
  • Full Git Workflow - Complete version control through web interface
  • Branch Management - Switch and manage branches seamlessly

🐳 Enterprise-Grade Security & Performance

  • Docker Containerization - Complete runtime isolation on AWS EC2
  • 99.9% Uptime - Reliable infrastructure with high availability on ec2
  • Scalable Architecture - Message queue system for concurrent execution in the backend
  • AWS EC2 Deployment - Professional cloud infrastructure

πŸ› οΈ Tech Stack

Frontend

  • Next.js 14 - React framework for production
  • Tailwind CSS - Utility-first CSS framework
  • Zustand - State management
  • TypeScript - Type-safe development

Backend

  • Express.js - Fast Node.js web framework
  • TypeScript - End-to-end type safety
  • WebSockets - Real-time communication
  • Message Queues - Scalable task processing
  • Docker - Containerized code execution
  • Prisma - Modern database toolkit

Database & Storage

  • PostgreSQL - Primary relational database
  • Redis - Caching and session management

Infrastructure & DevOps

  • AWS EC2 - Backend hosting with 99.9% uptime
  • Docker Engine - Container orchestration
  • Linux - Server environment
  • Vercel - Frontend deployment

πŸš€ Quick Start

Prerequisites

  • Node.js 24
  • Docker (Docker Desktop on Windows/macOS) with Docker Compose

Postgres and Redis run in Docker, and so does every code execution.

Local Development

  1. Clone the repository
git clone https://github.com/jinendra3/codebrim.git
cd codebrim
  1. Install dependencies
npm install
cd Backend && npm install && cd ..
cd Frontend && npm install && cd ..
  1. Start Postgres and Redis
docker compose up -d
  1. Environment setup
cp Backend/.env.sample Backend/.env
cp Frontend/.env.local.sample Frontend/.env.local

The samples already point at the services from docker-compose.yml and at the local backend:

Variable File Purpose
DATABASE_URL Backend/.env Postgres connection string
DOCKER_SUDO Backend/.env true if docker only works via sudo
NEXT_PUBLIC_BACKEND Frontend/.env.local Backend URL, e.g. http://localhost:5000
  1. Create the database tables
cd Backend && npx prisma migrate deploy && cd ..
  1. Prepare the code execution images (one time, downloads ~6 GB; on Windows run it from Git Bash)
bash Backend/dock/prepare-images.sh
  1. Start the development servers
npm run dev

The application will be available at:

Production Build

bun start

Self-Hosting on a Linux Server

One-time setup, from Backend/, with Docker and Redis installed on the server:

# Postgres in Docker, bound to 127.0.0.1, data in /var/lib/codebrim/postgres
POSTGRES_PASSWORD=$(openssl rand -hex 24) bash db/start-postgres.sh   # keep the password

# Backend/.env (or the service's EnvironmentFile)
#   DATABASE_URL="postgresql://codebrim:<password>@127.0.0.1:5432/codebrim"
#   DOCKER_SUDO="true"   # if the app user is not in the docker group

npx prisma migrate deploy
DOCKER_SUDO=true bash dock/prepare-images.sh

On every deploy, .github/workflows/deploy.yml pulls the code, applies migrations, prepares the images and restarts the service.

πŸ“– Available Scripts

  • bun dev - Start both frontend and backend in development mode

  • bun dev:frontend - Start only frontend development server

  • bun dev:backend - Start only backend development server

  • bun start - Build and start production servers

  • bun start:frontend - Build and start production frontend

  • bun start:backend - Start production backend

  • bun install - Install all dependencies

  • bun format - Format code with Prettier

🎯 What's New in v3.0

CodeBrim has evolved through multiple versions:

  • v1.0: MVP with basic compilation features
  • v2.0: Major refactoring and design improvements
  • v3.0: Enhanced functionality with:
    • File and folder support
    • Fixed Git integrations
    • Improved workspace locking
    • Overall code refactoring
    • Performance optimizations

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

How to Contribute

  1. Fork the repository on GitHub
  2. Clone the forked repository to your local machine
  3. Follow the installation steps above
  4. Open an issue and get it assigned
  5. Create a feature branch (git checkout -b feature/amazing-feature)
  6. Open a Pull Request

Reporting Issues

Found a bug or have a feature request?

  1. Create a new issue with detailed description
  2. Wait for approval from maintainers
  3. Submit your Pull Request after approval

Types of Contributions Needed

  • πŸ› Bug fixes
  • ✨ New features
  • πŸ“š Documentation improvements
  • 🎨 UI/UX enhancements
  • ⚑ Performance optimizations
  • πŸ§ͺ Test coverage
  • πŸ”§ DevOps improvements

πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Benevolent Dictator for Life: Jinendra Jain

About

A code running and sharing platform on AWS-EC2, leveraging Docker containers for efficient execution. Supports C, C++, Python, Go, Java & JavaScript. Users can perform Git operations, edit code, and share multiple files with ease.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages