Skip to content

Sridhar1030/Vortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒͺ️ Vortex - Cloud Deployment Platform

Vortex Logo

A powerful cloud deployment platform that automates the build and deployment process for web applications

Node.js Docker AWS MongoDB


πŸ“‹ Table of Contents


πŸš€ Overview

Vortex is a comprehensive cloud deployment platform inspired by modern deployment services like Vercel. It provides automated building, deployment, and hosting of web applications with custom domain support and real-time deployment status tracking.

✨ Key Features

  • πŸ”„ Automated Builds: Clone, build, and deploy applications automatically
  • 🌐 Custom Domains: Support for custom domain mapping
  • πŸ“Š Real-time Monitoring: Live deployment status and logs
  • πŸ”’ Secure Authentication: JWT-based user authentication
  • πŸ“ˆ Analytics: ClickHouse integration for deployment analytics
  • πŸš€ Scalable Infrastructure: AWS ECS-based container orchestration

πŸ—οΈ Architecture

graph TB
    A[Client] --> B[API Server :9000]
    B --> C[Build Server Container]
    B --> D[MongoDB]
    B --> E[Redis Cache]
    B --> F[ClickHouse Analytics]
    C --> G[AWS S3]
    H[S3 Reverse Proxy :8000] --> G
    A --> H
    B --> I[Socket.IO :9002]
    I --> A
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#fff3e0
    style G fill:#e8f5e8
    style H fill:#fff8e1
Loading

πŸ“¦ Services

πŸ”§ API Server (api-server/)

Port: 9000 | Main HTTP API server handling authentication, project management, and deployment orchestration

Key Features:

  • πŸ” User authentication and authorization
  • πŸ“‹ Project CRUD operations
  • πŸš€ Deployment management via AWS ECS
  • πŸ’¬ Real-time communication via Socket.IO
  • πŸ“Š Analytics integration with ClickHouse
  • πŸ”„ Kafka message queue integration

Tech Stack: Node.js, Express, MongoDB, Socket.IO, AWS SDK, Kafka, ClickHouse

πŸ—οΈ Build Server (build-server/)

Containerized | Docker-based build environment that clones, builds, and deploys applications

Key Features:

  • πŸ“₯ Git repository cloning
  • πŸ”¨ Automated build process
  • πŸ“€ Asset upload to AWS S3
  • πŸ“Š Build status reporting via Kafka
  • 🏷️ Multi-framework support

Tech Stack: Node.js, Docker, AWS S3, Kafka

🌐 S3 Reverse Proxy (s3-reverse-proxy/)

Port: 8000 | Intelligent reverse proxy for serving static assets from S3 with custom domain support

Key Features:

  • πŸ”„ Dynamic subdomain to S3 mapping
  • 🌍 Custom domain support
  • πŸ“ Static asset serving
  • ⚑ High-performance proxy

Tech Stack: Node.js, Express, HTTP Proxy, MongoDB


⚑ Quick Start

# Clone the repository
git clone <repository-url>
cd vortex

# Install dependencies for all services
npm run install:all

# Start all services
npm run dev

πŸ”§ Local Setup

Prerequisites

  • πŸ“¦ Node.js (v18+ recommended)
  • 🐳 Docker & Docker Compose
  • πŸƒ MongoDB
  • ☁️ AWS Account with ECS, S3, and ECR access
  • πŸ”§ Redis (optional, for caching)

Step-by-Step Setup

1️⃣ Install Dependencies

# Navigate to each service and install dependencies
cd api-server && npm install
cd ../build-server && npm install
cd ../s3-reverse-proxy && npm install

2️⃣ Environment Configuration

Create .env files in each service directory:

api-server/.env

PORT=9000
MONGO_URI=mongodb://localhost:27017/vortex
JWT_SECRET=your-jwt-secret
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=ap-south-1
ECS_CLUSTER_ARN=your-ecs-cluster-arn
ECS_TASK_DEFINITION_ARN=your-task-definition-arn
REDIS_URL=redis://localhost:6379
CLICKHOUSE_URL=your-clickhouse-url
KAFKA_BROKER=localhost:9092

build-server/.env

AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=ap-south-1
S3_BUCKET=your-s3-bucket-name
KAFKA_BROKER=localhost:9092

s3-reverse-proxy/.env

PORT=8000
MONGO_URI=mongodb://localhost:27017/vortex
S3_BASE_URL=https://your-s3-bucket.s3.ap-south-1.amazonaws.com/__outputs

3️⃣ Docker Setup for Build Server

cd build-server

# Build the Docker image
docker build -t vortex-build-server .

# Tag and push to AWS ECR
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin <your-ecr-uri>
docker tag vortex-build-server:latest <your-ecr-uri>/vortex-build-server:latest
docker push <your-ecr-uri>/vortex-build-server:latest

4️⃣ AWS ECS Configuration

  1. Create an ECS cluster
  2. Create a task definition using the pushed Docker image
  3. Update the ECS_CLUSTER_ARN and ECS_TASK_DEFINITION_ARN in api-server/.env

5️⃣ Start Services

# Terminal 1 - API Server
cd api-server && node index.js

# Terminal 2 - S3 Reverse Proxy
cd s3-reverse-proxy && node index.js

# MongoDB and Redis should be running as services

🌐 Service Endpoints

Service Port Purpose Health Check
API Server :9000 REST API & Authentication GET /health
Socket.IO Server :9002 Real-time Updates WebSocket connection
S3 Reverse Proxy :8000 Static Asset Serving GET /

πŸ”— API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/profile - Get user profile

Projects

  • GET /api/projects - List user projects
  • POST /api/projects - Create new project
  • GET /api/projects/:id - Get project details
  • PUT /api/projects/:id - Update project
  • DELETE /api/projects/:id - Delete project

Deployments

  • POST /api/deployments - Trigger new deployment
  • GET /api/deployments/:projectId - Get deployment history
  • GET /api/deployments/:id/logs - Get deployment logs

πŸ“„ API Documentation

Project Creation Example

curl -X POST http://localhost:9000/api/projects \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-jwt-token>" \
  -d '{
    "name": "my-awesome-app",
    "gitUrl": "https://github.com/username/my-awesome-app.git",
    "subDomain": "my-awesome-app"
  }'

Deployment Trigger Example

curl -X POST http://localhost:9000/api/deployments \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-jwt-token>" \
  -d '{
    "projectId": "project-id-here"
  }'

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. πŸ’» Make your changes
  4. βœ… Run tests
  5. πŸ“ Submit a pull request

Made with ❀️ by the Vortex Team

⭐ Star us on GitHub if you find this project useful!


πŸ“œ License

This project is licensed under the ISC License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •