How yashurade27/vercel-c works
Project type and purpose
• This is a full-stack, microservices-style deployment platform (“Vercel Clone”) for React apps.
• The frontend is a React/Vite/Tailwind UI; there are three separate Node.js/TypeScript back-end services (“vercel”, “vercel-request-handler”, “vercel-deploy-service”).
• Core features: file upload, build orchestration (via queues), object storage (Cloudflare R2), and deployment (AWS SDK).
File structure
• Top-level:
– README.md (project overview)
– frontend/ (static React app)
– vercel/ (main API entrypoint)
– vercel-request-handler/ (async request processor)
– vercel-deploy-service/ (build & deploy engine)
• Each backend has Express-style src/index.ts, plus aws.ts, utils.ts.
• Redis is used as a queue (implied by “Redis for Queuing System”).
• Cloudflare R2 is used for storing user-uploaded assets and build artifacts.
• Build: uses tsc (TypeScript compiler) and Node.js for each service.
README insights
• Frontend runs via npm run dev (Vite).
• Backends are started by building (tsc -b) then node dist/index.js.
• Stack: ReactJS, TypeScript, TailwindCSS, Redis (queue), Cloudflare R2 (object store), Node.js/Express, AWS SDK.
a. Main components (containers):
• Browser / React UI (frontend)
• API Gateway service (“vercel” Express app)
• Redis Queue
• Request Handler service (“vercel-request-handler”)
• Deploy Service (“vercel-deploy-service”)
• Cloudflare R2 (object storage)
• AWS (build & hosting, if used – via aws.ts)
b. Relationships & data flows:
1. User (Browser) → HTTPS → API Gateway (“vercel”)
2. API Gateway handles uploads → writes files to R2 → enqueues a job in Redis
3. Request Handler service pulls job from Redis → performs any preprocessing or validation → enqueues next job or calls Deploy Service
4. Deploy Service picks up build job → uses AWS SDK (see aws.ts) to spin up build environment, compile code, produce static assets → writes build output back to R2 (or AWS S3/CloudFront)
5. API Gateway or a status service can poll Redis or subscribe to job-complete events to report status back to the UI
c. Architectural patterns & design principles:
• Microservices / containerized Node.js services, each with a single responsibility
• Asynchronous, queue-based workflow (Redis)
• Externalized object storage (Cloudflare R2) for decoupling build artifacts from services
• Clear separation: frontend vs. API vs. worker vs. build engine
d. Key technologies & libraries:
• Frontend: React, Vite, TypeScript, TailwindCSS
• API & Workers: Node.js, Express, TypeScript
• Queue: Redis
• Storage: Cloudflare R2 (S3-compatible)
• Build/Deploy: AWS SDK (via aws.ts), Node child processes for tsc, Vite