Technologies & Frameworks:
TypeScript • Node.js • Express • Redis • AWS SDK • Cloudflare R2 • React • Vite • Tailwind CSS • Axios
This workspace contains four parts:
-
vercel-upload-service (Port 3000)
- Endpoint: POST
/deploy& GET/status - Clones a GitHub repo, uploads all files to S3 (Cloudflare R2), and enqueues the build job in Redis.
- Workflow:
- Receive repository URL in POST body.
- Clone into
output/{id}. - Upload each file under the
output/{id}prefix. - Set Redis status to
uploadedand push ID into thebuild-queuelist. - Respond with
{ id, message }.
- Endpoint: POST
-
vercel-deploy-service (Worker)
- No HTTP interface; runs as a background worker.
- Listens on Redis
build-queue, then for each ID:- Download files from S3 (prefix
output/{id}) to localt/{id}folder. - Run
npm install && npm run buildinsidet/{id}. - Copy the built
distfolder back into S3 underdist/{id}/.... - Update Redis status to
deployed.
- Download files from S3 (prefix
-
vercel-request-handler (Port 3001)
- Serves files from
dist/{id}in S3 via HTTP. - Uses the incoming host header (
{id}.solo.com) to select which site to serve. - Example: GET
/index.htmlon hostmyid.solo.comreturns objectdist/myid/index.html.
- Serves files from
-
frontend (Vite + React)
- UI for entering a GitHub URL and kicking off a deployment.
- Polls the
/status?id={id}endpoint until status isdeployed, then shows a link.
- Node.js >= 18
- Redis server running locally on default port
- AWS/R2 credentials in a
.envfile at each service root:AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_ENDPOINT=https://<your-r2-endpoint> AWS_BUCKET=vercel AWS_REGION=auto - Install dependencies in each folder:
cd vercel-upload-service && npm install cd ../vercel-deploy-service && npm install cd ../vercel-request-handler && npm install cd ../frontend && npm install
- Start Redis.
- In
vercel-upload-service:npm run dev(port 3000) - In
vercel-deploy-service:npm run dev(worker loop) - In
vercel-request-handler:npm run dev(port 3001) - In
frontend:npm run dev(opens at http://localhost:5173)
To preview deployed sites by hostname ({id}.solo.com), add an entry to /etc/hosts:
sudo vi /etc/hosts
# add line:
127.0.0.1 exampleid.solo.comThen, after deployment is deployed, visit:
http://exampleid.solo.com:3001/index.html
You can repeat the hosts entry for any new {id} returned by the upload service.