Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vercel Clone

A small learning project where I tried to understand how Vercel works under the hood — taking a Git repo, building it, and serving the static output on a URL — and then built a simplified version of it myself.

I took inspiration from Harkirat Singh's YouTube video on building a Vercel clone.

How it works

The project is split into three services that talk to each other through a Redis queue:

  1. upload-service — Accepts a POST /deploy with a repoURL, clones the repo, generates a unique deploy id, uploads all the files to object storage (S3 / Cloudflare R2), and pushes the id onto a Redis build-queue. Runs on port 3000.

  2. deploy-service — A background worker that pops ids off the build-queue, downloads the project files, runs the build (npm install && npm run build), and uploads the final dist output back to storage.

  3. request-handler — Serves the built sites. It reads the project id from the request subdomain (e.g. <id>.localhost:3001) and fetches the matching file from storage. Runs on port 3001.

client ──POST /deploy──▶ upload-service ──┐
                                          │ push id
                                     Redis build-queue
                                          │ pop id
                                          ▼
                                    deploy-service ──build──▶ storage
                                          
browser ──<id>.localhost──▶ request-handler ──fetch──▶ storage

Tech

  • TypeScript + Node.js
  • Express
  • Redis (build queue)
  • AWS S3 / Cloudflare R2 for storage
  • simple-git for cloning repos

Running locally

Each service is its own package. You'll need Redis running and storage credentials set in a .env file inside each service.

# in each of upload-service / deploy-service / request-handler
npm install
npm run dev

Note

This is a learning project built to understand the concepts — it is not meant for production use.

About

A small learning project where I tried to understand how Vercel works under the hood — taking a Git repo, building it, and serving the static output on a URL

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages