https://github.com/jaspermunene/vercel-clone
Vercel clone
https://github.com/jaspermunene/vercel-clone
aws docker nextjs nodejs socket-io
Last synced: 2 months ago
JSON representation
Vercel clone
- Host: GitHub
- URL: https://github.com/jaspermunene/vercel-clone
- Owner: JasperMunene
- License: mit
- Created: 2025-05-27T13:39:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-27T19:10:50.000Z (about 1 year ago)
- Last Synced: 2025-06-06T17:11:28.338Z (about 1 year ago)
- Topics: aws, docker, nextjs, nodejs, socket-io
- Language: TypeScript
- Homepage:
- Size: 339 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vercel‑Clone on AWS

A self‑hosted Vercel‑style deployment pipeline built with Node.js, AWS Fargate, Kafka, ClickHouse, and S3. Push your code to Git, trigger a build on demand, stream real‑time logs, and serve the static output via custom subdomains.
---
## 🚀 Features
- Project Management: Create new projects with random slug subdomains.
- On‑Demand Builds: Trigger builds via REST endpoint; runs isolated in AWS Fargate.
- Real‑Time Logs: Stream build logs through Kafka → ClickHouse → Socket.io.
- Artifact Storage: Upload dist/ artifacts to S3 under __outputs//….
- Custom Subdomains: Serve builds from S3 via an Express reverse proxy based on .yourdomain.com.
---
## 🛠️ Tech Stack
| **Component** | **Technology** |
|---------------------|----------------------------------|
| API Server | Node.js, Express, Zod, Prisma |
| Build Runner | Node.js, Docker, npm |
| Queue & Logs | AWS Fargate, KafkaJS, ClickHouse |
| Real‑Time Streaming | Socket.io |
| Artifact Hosting | AWS S3, http‑proxy |
| CI/CD | GitHub Actions, Docker Hub |
| Frontend | Nextjs, Tailwindcss |
## Setup Guide
This Project contains the following services and folders:
- `api-server`: REST API and Kafka consumer for scheduling builds and streaming logs.
- `build-server`: Dockerized build container that installs, builds, and uploads artifacts.
- `s3-reverse-proxy`: Express proxy to map subdomains to S3-hosted static assets.
## Prerequisites
- Node.js v18 or later
- Docker and Docker Compose
- AWS account with ECS, ECR, S3, and IAM permissions.
- Kafka cluster (SSL + SASL) and ClickHouse instance.
- DNS-configured custom domain for subdomains
## Installation
1. Clone the repository:
```markdown
git clone https://github.com/JasperMunene/vercel-clone.git
cd vercel-clone
```
2. Install dependencies for each service:
```markdown
cd api-server && npm install
cd ../build-server && npm install
cd ../s3-reverse-proxy && npm install
```
3. Build and push the build-server image to ECR:
```markdown
docker build -t your-ecr-repo/build-server:latest ./build-server
docker push your-ecr-repo/build-server:latest
```
4. Copy and configure environment variables in each service folder
At this point following services would be up and running:
| S.No | Service | PORT |
|------|--------------------|---------|
| 1 | `api-server` | `:9000` |
| 2 | `socket.io-server` | `:9002` |
| 3 | `s3-reverse-proxy` | `:8000` |
| 4 | `Frontend` | `:3000` |
### Architecture [Whiteboard Diagram](https://app.eraser.io/workspace/iKhB57YARYBWzPJYPCoy?origin=share)

### 🤝 Contributing
1. **Fork** the repository.
2. **Create a feature branch**:
```bash
git checkout -b feat/your-feature
3. **Commit your changes and push**:
```bash
git push origin feat/your-feature
4. **Open a Pull Request and describe your changes.**
### 📄 License
This project is licensed under the MIT License. See [LICENSE](LICENCE) for details.