Skip to content

UltimateProdigy/shipdeck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShipDeck 🚀

Your Own Self-Hosted, Dynamic Developer PaaS

ShipDeck is a self-hosted developer platform (like a private, lightweight Heroku or Render) built from scratch using TypeScript and Java. It automates code compilation, container management, web traffic routing, and server health tracking on a single machine.


📖 ShipDeck in Plain English (Layman's Terms)

Usually, putting a website online is a chore: you have to buy a server, configure database links, set up security certificates, configure route mappings (like Nginx), and manually copy files over every time you make an update.

ShipDeck does all this for you in seconds with one command.

Here is the exact lifecycle of a deployment:

  1. You push code: You type git push shipdeck main in your terminal.
  2. It compiles your app: ShipDeck's SSH server intercepts the code, extracts it, and automatically builds an isolated software container (using Docker).
  3. Zero-Downtime Swap: ShipDeck starts the new version on a randomized port and checks its health. Once verified, it atomic-renames the container names to route traffic to the new version and shuts down the old one seamlessly.
  4. Dynamic Routing: The built-in proxy detects the healthy container and routes domain calls (e.g. http://my-app.localhost:8080) to the right port dynamically.
  5. Auto-Scaling Protection: A Java monitor agent watches the server load. If it detects a resource spike, it calls the proxy to automatically spin up duplicate containers and balance traffic across them!

📂 Project Structure

shipdeck/
├── proxy/                  <-- Gateway router, Load balancer & Dashboard server (TS)
│   ├── src/
│   │   ├── proxy.ts        <-- Raw TCP load-balancer, telemetry endpoint & SSE server
│   │   └── dashboard.html  <-- Live developer metrics & logs terminal web console
│   ├── package.json
│   └── tsconfig.json
│
├── deployer/               <-- SSH receiver & Git deployment compiler engine (TS)
│   ├── src/
│   │   └── git-daemon.ts   <-- Custom SSH Git handler, Docker builder & health poller
│   ├── package.json
│   └── tsconfig.json
│
├── agent/                  <-- Lightweight JVM resource monitor agent (Java)
│   ├── src/
│   │   └── main/
│   │       └── java/
│   │           └── com/
│   │               └── shipdeck/
│   │                   └── MonitorAgent.java <-- Reads cgroups & MXBean, streams metrics
│   └── pom.xml             <-- Maven setup rules
│
├── package.json            <-- Monorepo configuration
└── README.md               <-- You are here!

⚙️ System Requirements

Before running the cluster, ensure you have these installed:

  • Docker Desktop (Make sure Docker is active and running)
  • Node.js (v20+ or Bun runtime)
  • Java JDK (v11 or higher, JDK 21 recommended)
  • Git CLI

🚀 Execution Guide

To boot up the complete PaaS platform, open three terminal windows and run the following commands:

1. Start the Routing Gateway (Terminal 1)

Serves the proxy, balances traffic, handles telemetry, and hosts the visual dashboard:

cd proxy
npm run dev

2. Start the Git Deployment Daemon (Terminal 2)

Listens for incoming ssh code pushes on port 2222:

cd deployer
npm run dev

3. Start the Java Systems Monitor Agent (Terminal 3)

Tracks CPU/RAM and streams metrics to the gateway:

cd agent
java -cp target/classes com.shipdeck.MonitorAgent

💻 How to Deploy Your First Application

With all three servers running, let's deploy a test application.

Step A: Initialize a local test repository (Terminal 4)

cd ~/Desktop
mkdir test-deploy && cd test-deploy
git init
git commit --allow-empty -m "Initial commit"

Step B: Link your project to ShipDeck

Add your self-hosted PaaS as a Git remote:

git remote add shipdeck ssh://git@127.0.0.1:2222/test-deploy.git

Step C: Push to Deploy!

git push shipdeck main

📊 Live Monitoring & Auto-Scaling Demo

  1. Open your browser and navigate to http://127.0.0.1:8080/dashboard.
  2. Push your code using git push shipdeck main.
  3. Watch the dashboard's Orchestrator Activity Log console. You will see the entire git clone, Docker compile steps, container startup, and successful blue-green swap logs stream live!
  4. Once completed, your application is live at http://test-deploy.localhost:8080 (tested via curl -H "Host: test-deploy.localhost" http://127.0.0.1:8080).
  5. Keep the dashboard open. In a few seconds, the Java Agent will simulate a resource spike. The dashboard will trigger a system warning, and you will see the auto-scaler dynamically spin up a duplicate container and add it to the Active Domain Routing Pools table automatically!

About

A self-hosted developer PaaS (like Heroku) written in TypeScript & Java supporting zero-downtime blue-green deployments.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors