π 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
-
Submission (Frontend β Upload Service)
User submits GitHub repo β generates unique ID β uploaded to R2 β job pushed to Redis queue.
-
Build (Deploy Service)
Worker picks job β installs deps β builds project β uploads build to R2.
-
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
git clone https://github.com/your-username/deploy-sphere.git
cd deploy-sphere
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
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.