This project is a Vercel clone built using TypeScript, Redis, and AWS S3. The primary functionality allows users to upload a React project from a GitHub repository, build it, and serve the built files locally.
- Upload service to upload files from a GitHub repo to an S3 bucket
- Deploy service to build the project in the S3 bucket
- Request handler service to serve the built files
- Uses Redis for queue management
- Works entirely on a local setup with live link pointing to localhost
To run this project, you need the following:
- Node.js installed
- Redis server running
- AWS account with access to S3
git clone https://github.com/dhiyanesh-cyber/vercel-clone.git
cd vercel-clone
Install the necessary dependencies for all services:
npm install
Set up your AWS credentials and S3 bucket configurations. You can do this by setting environment variables or using an AWS configuration file. Make sure to replace the S3 credentials in each service with your own credentials.
Create an .env.local
file in the root directory of your project with the following content, replacing the placeholders with your actual credentials:
S3_BUCKET_NAME=your-bucket-name
S3_ACCESS_KEY_ID=your-access-key-id
S3_SECRET_ACCESS_KEY=your-secret-access-key
This service uploads files from a GitHub repository to your S3 bucket.
tsc -b
node dist/index.ts
This service builds the project in the S3 bucket and stores the built files in another location within the same bucket.
tsc -b
node dist/index.ts
This service handles requests for the built files.
tsc -b
node dist/index.ts
Start the frontend to interact with the services.
npm run dev
After starting all the services, you need to point the live link to your localhost by modifying your hosts file based on your operating system.
-
Open Notepad as an administrator.
-
Open the file
C:\Windows\System32\drivers\etc\hosts
. -
Add a new entry for your live link pointing to
127.0.0.1
.127.0.0.1 your_deploy_id.vercel-clone.com
-
Replace
your_deploy_id
with your actual deploy id. -
Save the file.
-
Open a terminal.
-
Open the hosts file using a text editor with sudo privileges.
sudo nano /etc/hosts
-
Add a new entry for your live link pointing to
127.0.0.1
.127.0.0.1 your_deploy_id.vercel-clone.com
-
Replace
your_deploy_id
with your actual deploy id. -
Save the file and exit the editor.
- Paste the GitHub repository link of a React project into the frontend.
- The Upload Service will upload the files to your S3 bucket.
- The Deploy Service will build the project and store the built files in S3.
- The Request Handler will serve the built files.
- Access your live project via the live link pointed to your localhost.