Skip to content

Repository files navigation

CodeHost Logo

CodeHost

A minimalist, beginner-friendly Cloud Hosting (PaaS) platform designed for students and developers.
Deploy your project in one click — even if you don't know what a terminal is.

Discord License Node.js Docker


✨ Key Features

  • 🚀 One-Click Deployment: Upload a .zip file or connect a GitHub Repository to get a live URL in seconds.
  • 🐙 GitHub Integration: Deploy directly from any public GitHub repository with branch and subdirectory support.
  • 🔮 Auto-Detection: Automatically detects 20+ frameworks and languages (Next.js, React, Nuxt, Angular, SvelteKit, Astro, Django, FastAPI, Flask, Go, Rust, Java, Laravel, Deno, Bun, .NET, and more).
  • 🛠️ Modern Build Stack: Smart package manager detection (npm/yarn/pnpm) and optimized multi-stage Docker builds.
  • 🌍 Subdomain Hosting: Projects are hosted at {project}.code-host.online.
  • 📊 Real-time Logs: Stream build and runtime logs directly to your browser via WebSockets.
  • 🔒 Safe by Default: Sandboxed container isolation with strict resource limits.
  • 🛡️ Admin Console: Enhanced panel for monitoring platform health, users, and detailed deployment stats.
  • 🔑 Multi-Provider Auth: Sign in with email/password, Google, or GitHub.
  • 💳 Prepaid Billing: Comprehensive system with Razorpay integration, wallet credits, and tiered resource allocation.

🏗️ Architecture

CodeHost follows a robust distributed architecture:

  • 🧠 Control Plane: Central brain managing users, projects, and scheduling.
  • Data Plane: Worker nodes running the CodeHost Agent, responsible for building and running containers.
  • 🚦 Reverse Proxy: Dynamic routing managed by Nginx Proxy.

Tech Stack

  • Backend: Node.js (TypeScript) + Express
  • Frontend: Next.js + Tailwind CSS
  • Database: PostgreSQL (Prisma ORM)
  • Real-time: Socket.IO
  • Auth: JWT + Google OAuth + GitHub OAuth + Nodemailer
  • Infrastructure: Docker + Nginx + Redis

🚀 Quick Start (Local & VPS)

1. Prerequisites

  • Docker and Docker Compose
  • Node.js 20+

2. Environment Setup

Create a .env file in the infra/ folder. You can copy the template:

cd infra/
cp .env.example .env

Fill out the variables inside infra/.env (Database, JWT secrets, OAuth keys, etc.).

3. Launch

docker network create codehost_internal
cd infra/
docker compose up -d

4. Run Database Migration

After the stack is running, apply the Prisma migration to initialize your database:

docker exec -it codehost-api npx prisma migrate deploy --schema=./database/prisma/schema.prisma

📁 Project Structure

CodeHost/
├── backend/    # Express backend managing deployments & auth
├── frontend/   # Next.js frontend and Admin Console
├── packages/   # Shared logic for database, docker, logger, and config
└── infra/      # Deployment orchestration and proxy configuration

💳 Billing & Resource Tiers

Tier RAM CPU Storage Credits/Month
Free 128MB 0.5 1GB ₹0
Basic 256MB 1.0 2GB ₹100
Pro 512MB 2.0 5GB ₹300
Business 1GB 4.0 10GB ₹800
  • Prepaid Model: Buy credits (1 credit = ₹2), then select a tier for each project.
  • Auto-stop: If your wallet balance is insufficient for a monthly charge, the project container is automatically stopped.
  • Payment Methods: Seamless integration with Razorpay (UPI, Google Pay, Cards, Netbanking).

👑 Administrative Actions

To promote a user to Admin, run this directly on your server:

docker exec -it codehost-db psql -U codehost -d codehost -c "UPDATE \"User\" SET role = 'ADMIN' WHERE email = 'your@email.com';"

Wallet Management (Admin)

Admins can manually adjust user balances via the database if necessary:

# Add 500 credits to a user
docker exec -it codehost-db psql -U codehost -d codehost -c "UPDATE \"Wallet\" SET balance = balance + 500 WHERE \"userId\" = 'user-uuid';"

📄 License

MIT © Arsh Pathan

About

CodeHost is a minimalist, beginner-friendly Cloud Hosting (PaaS) platform designed for students and developers who want to deploy their code online without touching a terminal.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages