Skip to content

A Personal Cloud Deployment Platform. DeploySphere is a sophisticated, vercel-like deployment pipeline built from the ground up with Node.js and React.

Notifications You must be signed in to change notification settings

tarunsaini04/deploy-sphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DeploySphere

A Personal Cloud Deployment Platform

DeploySphere is a Vercel-like deployment pipeline built from scratch with Node.js and React. It demonstrates a deep understanding of system design and backend engineering by creating a fully automated system that:

πŸ“‚ Clones a GitHub repository

βš™οΈ Builds the project

☁️ Deploys static assets to a cloud object store

🌐 Serves them on the local machine via custom subdomains

πŸ›οΈ Architecture & System Design

DeploySphere follows a decoupled microservices architecture powered by Redis as a central message broker.

πŸ”‘ Core Components

->API Gateway (upload-service) β†’ Handles requests, validates input, queues jobs

->Message Broker (Redis) β†’ Manages build-queue & deployment status

->Build Worker (deploy-service) β†’ CI/CD pipeline executor (clone β†’ build β†’ deploy)

->Reverse Proxy (request-handler) β†’ Serves deployed projects via subdomains

πŸ“Œ Result β†’ Resilient, scalable, and async system that mimics real-world cloud deployment platforms.

✨ Key Features

βœ… Microservices architecture (Upload, Deploy, Request Handler, Frontend)

βœ… Asynchronous job queue with Redis

βœ… Automated CI/CD pipeline (clone β†’ build β†’ deploy)

βœ… Cloud storage integration with Cloudflare R2 (S3-compatible)

βœ… Dynamic subdomain routing (project-id.localhost)

βœ… Real-time deployment status in the React frontend

πŸ› οΈ Tech Stack

Layer -> Technology

Backend -> Node.js, Express.js, TypeScript

Frontend -> React, Vite, CSS

Queueing -> Redis

Cloud -> Cloudflare R2 (S3-compatible)

Core Libs -> aws-sdk, simple-git, redis, dotenv, cors

βš™οΈ Deployment Lifecycle

  1. Submission (Frontend β†’ Upload Service)

    User submits GitHub repo β†’ generates unique ID β†’ uploaded to R2 β†’ job pushed to Redis queue.

  2. Build (Deploy Service)

    Worker picks job β†’ installs deps β†’ builds project β†’ uploads build to R2.

  3. Serve (Request Handler)

    Reverse proxy maps subdomain β†’ fetches files from R2 β†’ serves static assets.

πŸš€ Running the Project Locally

πŸ“‹ Prerequisites

->Node.js (v20+ recommended)

->npm

->Redis (local or via Docker)

->Cloudflare R2 credentials

πŸ”§ Setup Instructions

Clone the repo

git clone https://github.com/your-username/deploy-sphere.git

cd deploy-sphere

Install dependencies for all services

cd upload-service && npm install && cd ..

cd deploy-service && npm install && cd ..

cd request-handler && npm install && cd ..

cd vercel-frontend && npm install && cd ..

βš™οΈ Environment Variables

Each backend service (upload-service, deploy-service, request-handler) needs a .env file.

R2_ACCESS_KEY=your-key

R2_SECRET_KEY=your-secret

R2_BUCKET=your-bucket

πŸ–₯️ Modify Hosts File

Map project subdomains to localhost:

127.0.0.1 my-test-project.localhost

▢️ Start Services

Run each service in a separate terminal

npm run dev # inside upload-service

npm run dev # inside deploy-service

npm run dev # inside request-handler

npm run dev # inside vercel-frontend

πŸŽ‰ Then open http://localhost:5173, paste a GitHub repo link, and hit Deploy!

πŸ’‘ Challenges & Learnings

System Design β†’ Redis as message broker enabled true async processing.

S3 Key Consistency β†’ Fixed NoSuchKey by aligning deploy & request-handler logic.

Async Ops β†’ Switched from forEach to for...of for proper async/await handling.

🀝 Contributing

Contributions are welcome! Feel free to fork the repo, open issues, and submit PRs.

About

A Personal Cloud Deployment Platform. DeploySphere is a sophisticated, vercel-like deployment pipeline built from the ground up with Node.js and React.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published