Overview
This guide will walk you through setting up the Vercel For Frontend platform locally and deploying your first application. By the end, you’ll have both services running and a live deployment accessible via S3.Prerequisites
Before you begin, ensure you have the following installed and configured:Bun Runtime
Install from bun.sh - Required for running both services
Docker
Install Docker Desktop or Docker Engine - Required for building projects
Redis
Install Redis locally or use a cloud instance - Required for queue management
AWS Account
Active AWS account with S3 access - Required for storage and hosting
This platform was built using Bun v1.1.26. While newer versions should work, this is the tested version.
Installation
Install Dependencies
Install dependencies for all services. The platform consists of two separate services that need to be installed independently:Both services use the same core dependencies:
express- HTTP serveraws-sdk- S3 operationsredis- Queue managementsimple-git- Git operations (upload-service only)ignore- Gitignore parsing (upload-service only)
Create S3 Bucket
Create an S3 bucket named Enable static website hosting on the bucket:
vercel-frontend in your AWS account:Configure AWS Credentials
Both services require AWS credentials to access S3. Create IAM credentials with S3 full access and configure them.Required IAM Permissions:
s3:PutObject- Upload filess3:GetObject- Download filess3:ListBucket- List bucket contents
- Go to AWS IAM Console
- Create a new user or use existing
- Attach
AmazonS3FullAccesspolicy (or create a custom policy with the permissions above) - Generate access keys
Set Environment Variables
Configure environment variables for both services. The AWS credentials are read from environment variables as seen in the source code:For Upload Service:For Deploy Service:
You can also create
.env files in each service directory, but you’ll need to load them manually as the services don’t include dotenv by default.Running the Services
Both services need to run simultaneously for the platform to function:Upload Service
Deploy Service
The upload service runs on port 3000 by default (upload-service/src/server.ts:52). The deploy service doesn’t expose an HTTP port as it only processes queue jobs.
Deploy Your First Application
Now that both services are running, let’s deploy a frontend application:Prepare a Repository
You’ll need a GitHub repository with a frontend project. The project must have:
- A
package.jsonfile - A build script defined (
npm run build) - Build output to either
/buildor/distdirectory
- Create React App (outputs to
/build) - Vite (outputs to
/dist) - Next.js static export
- Vue CLI
Submit Deployment Request
Send a POST request to the upload service with your repository URL:Expected response:The
id field is your deployment identifier. Save this for accessing your deployed application.Monitor the Build
Watch the terminal outputs to monitor your deployment:Upload Service logs:Deploy Service logs:The build process creates a Docker container, installs dependencies, runs the build, and uploads the output to S3.
Understanding the Deployment Flow
Here’s what happens behind the scenes when you deploy:Repository Cloning
The upload service clones your repository to a local directory:The
getAllFiles function respects your .gitignore file, ensuring node_modules and other ignored files aren’t uploaded:Docker Build
The deploy service creates a Dockerfile and builds your project in an isolated container:The build command handles both common output directories:
Troubleshooting
Upload Service Issues
Error: “Failed to clone repository”- Verify the repository URL is correct and accessible
- Ensure the repository is public or you have access
- Check your network connection
- Verify AWS credentials are set correctly
- Check S3 bucket exists and is accessible
- Verify IAM permissions include
s3:PutObject
Deploy Service Issues
Error: “Redis Client Error”- Ensure Redis is running on port 6379
- Check Redis is accepting connections:
redis-cli ping
- Verify Docker daemon is running
- Ensure your project has a valid
package.json - Check that
npm run buildworks in your repository - Verify the build script outputs to
/buildor/dist
- Check AWS credentials are set for deploy service
- Verify S3 bucket permissions
- Ensure the upload service completed successfully
Production Considerations
Next Steps
API Reference
Explore all API endpoints and parameters
Build System
Learn about the Docker build system
Configuration
Customize bucket names, ports, and more
Deployment Guide
Deploy your frontend applications