Skip to content

ayush-sharaf/devploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Devploy - GitHub Repository Deployment Platform

A modern, full-stack deployment platform that automatically builds and deploys GitHub repositories with Docker containerization, S3 storage, and real-time status tracking.

๐Ÿš€ Features

Core Functionality

  • One-Click Deployment: Deploy any GitHub repository with a single click
  • Automatic Build Process: Automatically detects and builds projects using npm
  • Docker Containerization: Each deployment gets its own isolated Docker container
  • Real-time Status Tracking: Monitor deployment progress with live status updates
  • Unique URL Generation: Each deployment gets a unique subdomain for easy access
  • S3 File Storage: Secure cloud storage for all project files and builds

Technical Features

  • Multi-Service Architecture: Microservices-based design for scalability
  • Redis Queue System: Asynchronous job processing for deployments
  • AWS S3 Integration: Cloud storage for project files and build artifacts
  • TypeScript Support: Full TypeScript implementation across all services
  • Modern UI: React-based frontend with Tailwind CSS styling
  • Container Management: Built-in tools for managing Docker containers

๐Ÿ—๏ธ Architecture

The project consists of four main services:

1. Frontend Service (devploy-frontend)

  • Technology: Next.js 15, React 19, TypeScript, Tailwind CSS
  • Port: 4000
  • Features:
    • Modern, responsive UI
    • Real-time deployment status updates
    • GitHub repository URL input
    • Deployment progress tracking
    • Direct links to deployed applications

2. Upload Service (devploy-upload-service)

  • Technology: Express.js, TypeScript, AWS SDK, Redis
  • Port: 3000
  • Features:
    • GitHub repository cloning
    • File upload to S3
    • Deployment queue management
    • Status tracking via Redis
    • Unique ID generation for deployments

3. Deploy Service (devploy-deploy-service)

  • Technology: TypeScript, AWS SDK, Redis, Docker
  • Features:
    • Background job processing
    • S3 file download and project building
    • Docker container creation and management
    • Automatic port assignment
    • Build artifact management

4. Request Handler (devploy-request-handler)

  • Technology: Express.js, TypeScript, AWS SDK
  • Port: 3001
  • Features:
    • Static file serving from S3
    • Subdomain-based routing
    • Content-type detection
    • Direct file access for deployed applications

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Node.js 18+
  • Docker
  • Redis server
  • AWS S3 bucket (or compatible S3 service)
  • Git

Environment Variables

Create .env files in each service directory with the following variables:

# AWS S3 Configuration
AMAZON_S3_KEY=your_s3_access_key
AMAZON_S3_SECRET=your_s3_secret_key
AMAZON_S3_ENDPOINT=your_s3_endpoint

# Redis Configuration (if not using default)
REDIS_URL=redis://localhost:6379

Installation Steps

  1. Clone the repository

    git clone <repository-url>
    cd devploy
  2. Install dependencies for all services

    # Frontend
    cd devploy-frontend
    npm install
    
    # Upload Service
    cd ../devploy-upload-service
    npm install
    
    # Deploy Service
    cd ../devploy-deploy-service
    npm install
    
    # Request Handler
    cd ../devploy-request-handler
    npm install
  3. Build TypeScript services

    # Upload Service
    cd devploy-upload-service
    npm run build
    
    # Deploy Service
    cd ../devploy-deploy-service
    npm run build
    
    # Request Handler
    cd ../devploy-request-handler
    npm run build
  4. Start Redis server

    redis-server
  5. Start all services

    # Terminal 1 - Frontend
    cd devploy-frontend
    npm run dev
    
    # Terminal 2 - Upload Service
    cd devploy-upload-service
    npm start
    
    # Terminal 3 - Deploy Service
    cd devploy-deploy-service
    npm start
    
    # Terminal 4 - Request Handler
    cd devploy-request-handler
    npm start

๐Ÿš€ Usage

  1. Access the application: Open http://localhost:4000 in your browser
  2. Enter GitHub URL: Paste the URL of any GitHub repository you want to deploy
  3. Deploy: Click the "Upload" button to start the deployment process
  4. Monitor Progress: Watch the real-time status updates
  5. Access Your App: Once deployed, click the "Visit Website" button to access your application

๐Ÿ”ง Container Management

The deploy service includes a comprehensive container management script:

# List all devploy containers
./devploy-deploy-service/scripts/manage-containers.sh list

# Stop a specific project container
./devploy-deploy-service/scripts/manage-containers.sh stop <project-id>

# Start a specific project container
./devploy-deploy-service/scripts/manage-containers.sh start <project-id>

# Remove a specific project container
./devploy-deploy-service/scripts/manage-containers.sh remove <project-id>

# Show logs for a specific project
./devploy-deploy-service/scripts/manage-containers.sh logs <project-id>

# Clean up all devploy containers
./devploy-deploy-service/scripts/manage-containers.sh cleanup

๐Ÿ“ Project Structure

devploy/
โ”œโ”€โ”€ devploy-frontend/          # Next.js frontend application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ app/              # Next.js app router
โ”‚   โ”‚   โ”œโ”€โ”€ components/       # React components
โ”‚   โ”‚   โ””โ”€โ”€ lib/              # Utility functions
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ devploy-upload-service/    # File upload and repository cloning service
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ aws.ts           # S3 upload utilities
โ”‚   โ”‚   โ”œโ”€โ”€ file.ts          # File system operations
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts         # Main Express server
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts         # Utility functions
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ devploy-deploy-service/   # Build and deployment service
โ”‚   โ”œโ”€โ”€ scripts/
โ”‚   โ”‚   โ”œโ”€โ”€ docker-build.sh  # Docker build utilities
โ”‚   โ”‚   โ””โ”€โ”€ manage-containers.sh # Container management
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ aws.ts           # S3 download utilities
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts         # Main deployment logic
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts         # Build utilities
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ devploy-request-handler/  # Static file serving service
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts         # Express server for file serving
โ”‚   โ””โ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ”„ Deployment Flow

  1. Repository Input: User enters GitHub repository URL in the frontend
  2. Repository Cloning: Upload service clones the repository locally
  3. File Upload: All repository files are uploaded to S3
  4. Queue Processing: Deployment job is added to Redis queue
  5. Background Building: Deploy service processes the queue and builds the project
  6. Docker Containerization: Built project is containerized with Docker
  7. Status Update: Deployment status is updated in Redis
  8. File Serving: Request handler serves the deployed application
  9. Access: User can access the deployed application via unique URL

๐Ÿ›ก๏ธ Security Features

  • Isolated Containers: Each deployment runs in its own Docker container
  • Non-root Users: Docker containers run with non-root users
  • Environment Variables: Sensitive data stored in environment variables
  • S3 Security: Secure file storage with AWS S3
  • Port Isolation: Each deployment gets a unique port

๐Ÿš€ Performance Features

  • Asynchronous Processing: Non-blocking deployment queue
  • Parallel Builds: Multiple deployments can be processed simultaneously
  • Caching: S3 caching for faster subsequent deployments
  • Optimized Images: Alpine-based Docker images for smaller size
  • Efficient File Handling: Stream-based file operations

๐Ÿ”ง Configuration

Port Configuration

  • Frontend: 4000
  • Upload Service: 3000
  • Request Handler: 3001
  • Deploy Service: Background process
  • Redis: 6379 (default)

Docker Configuration

  • Base Image: Node.js 18 Alpine
  • Working Directory: /app
  • Exposed Port: 3000 (internal)
  • User: nodejs (non-root)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the ISC License.

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the GitHub repository
  • Check the container logs using the management script
  • Verify all services are running and Redis is accessible

๐Ÿ”ฎ Future Enhancements

  • Support for multiple programming languages
  • Custom domain support
  • SSL certificate automation
  • Database integration for persistent storage
  • User authentication and authorization
  • Deployment history and rollback functionality
  • Webhook integration for automatic deployments
  • Monitoring and analytics dashboard

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors