Skip to content

Complete deployment automation platform with CI/CD integration, built with TypeScript, Express, and MariaDB.

License

Notifications You must be signed in to change notification settings

FutureSolutionDev/Deploy-Center-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸš€ Deploy Center

Modern Self-Hosted CI/CD Deployment Platform

License: Dual TypeScript Node.js Express MariaDB GitHub issues GitHub stars PRs Welcome Code Quality Security: OWASP

Deploy Center is an enterprise-grade, self-hosted CI/CD automation platform that transforms GitHub webhooks into intelligent deployment pipelines. Built from the ground up with TypeScript, SOLID principles, and production-ready architecture.

Quick Start β€’ Documentation β€’ API Reference β€’ Contributing β€’ Roadmap

Deploy Center Workflow


πŸ“‘ Table of Contents


🎯 Why Deploy Center?

Traditional CI/CD platforms are either too complex (Jenkins, GitLab CI), too expensive (CircleCI, Travis CI), or too limited (basic webhook handlers). Deploy Center strikes the perfect balance:

πŸ† What Makes Us Different

Feature Deploy Center Traditional Platforms Basic Webhooks
Self-Hosted βœ… Full control ⚠️ Limited options βœ… Yes
Easy Setup βœ… <5 minutes ❌ Hours/days βœ… Minutes
Web Dashboard βœ… Beautiful UI βœ… Complex ❌ No interface
Multi-Project βœ… Unlimited βœ… Yes (paid) ⚠️ Manual setup
Queue Management βœ… Built-in βœ… Yes ❌ None
Role-Based Access βœ… Admin/Dev/Viewer βœ… Complex RBAC ❌ None
Notifications βœ… Discord, Slack, Email, Telegram βœ… Limited ⚠️ Manual
Pipeline as Code βœ… JSON Config ⚠️ YAML (complex) ❌ Scripts only
Real-time Monitoring βœ… Live updates βœ… Yes ❌ Logs only
Free & Open βœ… Dual license ❌ Paid tiers βœ… DIY

πŸ’‘ Perfect For

  • πŸš€ Startups β€” Self-hosted, free, powerful
  • 🏒 SMEs β€” Multi-team deployment automation
  • πŸ‘¨β€πŸ’» Developers β€” Personal projects and portfolios
  • πŸŽ“ Learning β€” Study production-grade TypeScript architecture
  • 🏭 Agencies β€” Manage client deployments centrally

✨ Key Features

πŸ” Authentication & Authorization

  • JWT-based authentication with refresh tokens
  • Role-based access control (Admin, Developer, Viewer)
  • Secure password hashing with bcrypt (12 rounds)
  • Automatic admin recovery system
  • Cookie-based session management

πŸ“¦ Project Management

  • Unlimited project support
  • GitHub webhook integration
  • Automatic deployment on push
  • Path-based deployment triggers (deploy only when specific files change)
  • Project-level statistics and analytics
  • Webhook secret management and regeneration

βš™οΈ Smart Deployment Pipeline

  • Custom multi-step pipeline configuration
  • Variable substitution system ({{variable}})
  • Conditional step execution (RunIf conditions)
  • Per-step timeout configuration
  • Continue-on-error support
  • Working directory control
  • Command output capture and storage
  • Execution duration tracking

🚦 Queue Management

  • Prevents concurrent deployments per project
  • Priority-based queue (manual > auto)
  • Project-specific queues
  • Queue status monitoring
  • Bulk queue operations (cancel all pending)
  • Event-driven queue processing

πŸ”” Multi-Platform Notifications

  • Discord β€” Rich embeds with color-coded status
  • Slack β€” Formatted message attachments
  • Email β€” HTML email templates with SMTP
  • Telegram β€” Markdown-formatted messages
  • Per-project notification configuration
  • Deployment success/failure alerts

πŸ“Š Comprehensive Logging

  • Winston logger with daily rotation
  • Structured logging with metadata
  • Separate log files (combined, error, deployment)
  • Real-time log streaming
  • Log retention policies

πŸ›‘οΈ Enterprise Security

  • Helmet.js security headers
  • CORS configuration
  • Rate limiting (per-endpoint customization)
  • Input validation with Joi schemas
  • AES-256-GCM encryption for sensitive data
  • HMAC webhook signature verification
  • SQL injection prevention (Sequelize ORM)
  • XSS protection
  • CSRF protection ready

🎯 Developer Experience

  • Complete REST API (30+ endpoints)
  • Postman collection included
  • TypeScript with strict mode
  • Hot reload development
  • ESLint + Prettier
  • Comprehensive error messages
  • Health check endpoint

πŸ—οΈ Architecture

Deploy Center follows a clean layered architecture pattern with SOLID principles:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 GitHub Webhook                       β”‚
β”‚            (Push/PR/Release Events)                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚  Webhook Routes   β”‚
           β”‚   + Validation    β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚  WebhookService   β”‚
           β”‚  β€’ Verify HMAC    β”‚
           β”‚  β€’ Parse Payload  β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ DeploymentService β”‚
           β”‚  Create Record    β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚   Queue Service   β”‚
           β”‚  (Singleton)      β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ PipelineService   β”‚
           β”‚  Execute Steps    β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                             β”‚
β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Git Pull   β”‚            β”‚ NotificationSvc  β”‚
β”‚ npm installβ”‚            β”‚  Discord/Slack   β”‚
β”‚ npm build  β”‚            β”‚  Email/Telegram  β”‚
β”‚ PM2 restartβ”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer Breakdown

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Routes Layer                β”‚  ← URL Mapping
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚         Controllers Layer              β”‚  ← Request/Response
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚          Services Layer                β”‚  ← Business Logic
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚          Models Layer                  β”‚  ← Data Access (ORM)
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      Database Layer (MariaDB)          β”‚  ← Persistence
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design Patterns

  • βœ… Singleton β€” Config, Logger, Queue, Database
  • βœ… Repository β€” Data access abstraction
  • βœ… Service Layer β€” Business logic isolation
  • βœ… Factory β€” Response formatting, middleware creation
  • βœ… Dependency Injection β€” Loose coupling

πŸ“– View Detailed Architecture


πŸ“‹ Prerequisites

Required

  • Node.js β‰₯ 18.0.0
  • npm β‰₯ 9.0.0
  • MariaDB β‰₯ 10.6 (or MySQL β‰₯ 8.0)
  • Git β‰₯ 2.0

Recommended

  • PM2 β€” Process manager for production
  • Nginx β€” Reverse proxy
  • SSL Certificate β€” For webhook HTTPS

Quick Version Check

node --version   # Should show v18.0.0+
npm --version    # Should show 9.0.0+
mysql --version  # Should show MariaDB 10.6+ or MySQL 8.0+
git --version    # Should show 2.0+

⚑ Quick Start

Get up and running in 5 minutes:

1. Clone Repository

git clone https://github.com/FutureSolutionDev/Deploy-Center-Server.git
cd Deploy-Center-Server/server

2. Install Dependencies

npm install

3. Setup Database

CREATE DATABASE deploy_center CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'deploy_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON deploy_center.* TO 'deploy_user'@'localhost';
FLUSH PRIVILEGES;

4. Configure Environment

cp .env.example .env
# Edit .env with your settings (database, JWT secrets, etc.)

5. Start Development Server

npm run dev

Server starts at http://localhost:3000 πŸŽ‰

6. Create Admin User

curl -X POST http://localhost:3000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "Username": "admin",
    "Email": "admin@example.com",
    "Password": "Admin@12345",
    "Role": "admin"
  }'

πŸ“– Detailed Installation Guide


πŸ› οΈ Installation

For production setup, Docker deployment, PM2 configuration, and SSL setup:

πŸ“– Complete Installation Guide

Covers:

  • System requirements
  • Step-by-step installation (Linux/macOS/Windows)
  • Database setup and configuration
  • Environment variable reference
  • Production deployment with PM2
  • Nginx reverse proxy setup
  • SSL certificate with Let's Encrypt
  • Docker deployment
  • Firewall configuration
  • Backup automation

βš™οΈ Configuration

Environment Variables

Create .env from .env.example:

# Server
NODE_ENV=development
PORT=3000

# Database
DB_HOST=localhost
DB_PORT=3306
DB_NAME=deploy_center
DB_USER=deploy_user
DB_PASSWORD=your_secure_password
DB_DIALECT=mariadb
DB_AUTO_MIGRATE=true

# Default Admin (auto-created on first run)
DEFAULT_ADMIN_USERNAME=admin
DEFAULT_ADMIN_EMAIL=admin@example.com
DEFAULT_ADMIN_PASSWORD=changeme

# JWT
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRY=1h
JWT_REFRESH_SECRET=your-super-secret-refresh-key
JWT_REFRESH_EXPIRY=7d

# Encryption (32 characters)
ENCRYPTION_KEY=your-32-character-encryption-key

# CORS (comma-separated)
CORS_ORIGINS=http://localhost:3000,http://localhost:5173

# Paths
DEPLOYMENTS_PATH=./deployments
LOGS_PATH=./logs

Generate Secure Secrets

# Generate JWT secret
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"

# Generate encryption key (32 bytes)
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description Auth Required
POST /api/auth/register Register new user No
POST /api/auth/login Login user No
POST /api/auth/refresh Refresh access token Yes (Refresh Token)
GET /api/auth/profile Get user profile Yes
POST /api/auth/change-password Change password Yes

Projects

Method Endpoint Description Auth Required Role
GET /api/projects List all projects Yes All
GET /api/projects/:id Get project details Yes All
GET /api/projects/name/:name Get project by name Yes All
POST /api/projects Create project Yes Admin
PUT /api/projects/:id Update project Yes Admin
DELETE /api/projects/:id Delete project Yes Admin
POST /api/projects/:id/regenerate-webhook Regenerate webhook secret Yes Admin
GET /api/projects/:id/statistics Get project statistics Yes All

Deployments

Method Endpoint Description Auth Required Role
GET /api/deployments/:id Get deployment details Yes All
GET /api/deployments/projects/:projectId/deployments List project deployments Yes All
POST /api/deployments/projects/:projectId/deploy Trigger manual deployment Yes Developer+
POST /api/deployments/:id/cancel Cancel deployment Yes Developer+
POST /api/deployments/:id/retry Retry failed deployment Yes Developer+
GET /api/deployments/statistics Get deployment statistics Yes All
GET /api/deployments/queue/status Get global queue status Yes All
GET /api/deployments/projects/:projectId/queue/status Get project queue status Yes All
POST /api/deployments/projects/:projectId/queue/cancel-all Cancel all pending Yes Admin

Webhooks

Method Endpoint Description Auth Required
POST /webhook/github/:projectName GitHub webhook receiver No (HMAC)
GET /webhook/test/:projectName Test webhook endpoint No

Health & Info

Method Endpoint Description
GET /health Health check
GET / API information

πŸ“– Full API Documentation


πŸ”§ Pipeline Configuration

Basic Pipeline Example

{
  "Name": "my-app",
  "RepoUrl": "https://github.com/username/my-app.git",
  "Config": {
    "Branch": "main",
    "AutoDeploy": true,
    "Environment": "production",
    "Pipeline": [
      {
        "Name": "Install Dependencies",
        "Command": "npm ci",
        "Timeout": 300000
      },
      {
        "Name": "Build Project",
        "Command": "npm run build",
        "RunIf": "{{Environment}} === 'production'"
      },
      {
        "Name": "Run Tests",
        "Command": "npm test",
        "ContinueOnError": false
      },
      {
        "Name": "Deploy to Production",
        "Command": "pm2 restart my-app",
        "WorkingDirectory": "."
      }
    ]
  }
}

Advanced Pipeline Features

Variable Substitution

Available variables in pipeline commands:

  • {{Environment}} β€” Environment name
  • {{Branch}} β€” Git branch
  • {{CommitHash}} β€” Commit SHA
  • {{ProjectPath}} β€” Project directory
  • Custom variables from Config object

Conditional Execution

{
  "Name": "Production Build",
  "Command": "npm run build:prod",
  "RunIf": "{{Environment}} === 'production'"
}

Path-Based Deployment

Only deploy when specific files change:

{
  "DeployOnPaths": [
    "src/**",
    "package.json",
    "Dockerfile"
  ]
}

πŸ”— Webhook Setup

1. Get Webhook URL & Secret

After creating a project via API, you'll receive:

  • Webhook URL: https://your-domain.com/webhook/github/your-project-name
  • Webhook Secret: Generated automatically

2. Configure GitHub Webhook

  1. Go to your GitHub repository
  2. Settings β†’ Webhooks β†’ Add webhook
  3. Configure:
    • Payload URL: Your webhook URL
    • Content type: application/json
    • Secret: Your project's webhook secret
    • Events: Select "Just the push event"
    • Active: βœ… Checked
  4. Click Add webhook

3. Test Webhook

# Test webhook endpoint (no signature verification)
curl https://your-domain.com/webhook/test/your-project-name

4. Verify Webhook

Push to your repository and check:

  • GitHub webhook delivery status (green βœ…)
  • Deploy Center logs: tail -f logs/deployment-*.log
  • Deployment status via API

πŸ”” Notifications

Discord Setup

{
  "Notifications": {
    "Discord": {
      "Enabled": true,
      "WebhookUrl": "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
    }
  }
}

Creating Discord Webhook:

  1. Server Settings β†’ Integrations β†’ Webhooks
  2. Create Webhook β†’ Copy URL

Slack Setup

{
  "Notifications": {
    "Slack": {
      "Enabled": true,
      "WebhookUrl": "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
    }
  }
}

Email Setup

{
  "Notifications": {
    "Email": {
      "Enabled": true,
      "Host": "smtp.gmail.com",
      "Port": 587,
      "Secure": false,
      "User": "your-email@gmail.com",
      "Password": "your-app-password",
      "From": "Deploy Center <noreply@yourapp.com>",
      "To": ["team@example.com", "ops@example.com"]
    }
  }
}

Telegram Setup

{
  "Notifications": {
    "Telegram": {
      "Enabled": true,
      "BotToken": "YOUR_BOT_TOKEN",
      "ChatId": "YOUR_CHAT_ID"
    }
  }
}

πŸ“Š Deployment Workflow

Deployment Lifecycle

graph LR
    A[GitHub Push] --> B{Webhook Received}
    B --> C[Verify HMAC]
    C --> D{Valid?}
    D -->|No| E[Reject 401]
    D -->|Yes| F[Parse Payload]
    F --> G{Should Deploy?}
    G -->|No| H[Skip - Wrong Branch/Files]
    G -->|Yes| I[Create Deployment]
    I --> J[Add to Queue]
    J --> K{Queue Empty?}
    K -->|No| L[Wait in Queue]
    K -->|Yes| M[Start Execution]
    L --> M
    M --> N[Execute Pipeline]
    N --> O{Success?}
    O -->|Yes| P[Mark Success]
    O -->|No| Q[Mark Failed]
    P --> R[Send Notification]
    Q --> R
    R --> S[Process Next in Queue]
Loading

Deployment States

State Description Can Cancel? Can Retry?
queued Waiting in queue βœ… Yes ❌ No
inProgress Currently deploying ❌ No ❌ No
success Completed successfully ❌ No ❌ No
failed Deployment failed ❌ No βœ… Yes
cancelled Manually cancelled ❌ No βœ… Yes

πŸ›‘οΈ Security

Security Features

1. Authentication

  • βœ… JWT tokens with HS256 signing
  • βœ… Refresh token rotation
  • βœ… bcrypt password hashing (12 rounds)
  • βœ… Password strength requirements
  • βœ… Cookie-based sessions (HttpOnly, Secure, SameSite)

2. Authorization

  • βœ… Role-based access control (RBAC)
  • βœ… Endpoint-level permission enforcement
  • βœ… Resource-level access validation

3. Input Validation

  • βœ… Joi schema validation
  • βœ… Request sanitization
  • βœ… Type checking with TypeScript

4. API Protection

  • βœ… Rate limiting (configurable per endpoint)
  • βœ… Helmet.js security headers
  • βœ… CORS whitelisting
  • βœ… XSS protection
  • βœ… CSRF protection ready

5. Data Security

  • βœ… AES-256-GCM encryption for sensitive data
  • βœ… HMAC-SHA256 webhook verification
  • βœ… SQL injection prevention (Sequelize ORM)
  • βœ… Environment variable protection

Rate Limiting

Endpoint Type Rate Limit Window
General API 100 requests 15 minutes
Authentication 5 requests 15 minutes
Deployment 10 requests 5 minutes
Webhook 60 requests 1 minute

Security Best Practices

  1. βœ… Always use HTTPS in production
  2. βœ… Generate strong JWT secrets (64+ bytes)
  3. βœ… Never commit .env files
  4. βœ… Rotate webhook secrets periodically
  5. βœ… Use firewall to restrict database access
  6. βœ… Enable audit logging
  7. βœ… Regular dependency updates
  8. βœ… Review logs for suspicious activity

πŸ“– Security Policy


πŸ§ͺ Testing with Postman

Import Collection

  1. Download Postman Collection
  2. Open Postman β†’ Import β†’ Select file
  3. Collection will auto-configure variables

Quick Test Workflow

  1. βœ… Health Check β€” Verify server is running
  2. βœ… Register Admin β€” Create admin user (auto-saves token)
  3. βœ… Get Profile β€” Verify authentication works
  4. βœ… Create Project β€” Add your first project (auto-saves project ID)
  5. βœ… Manual Deployment β€” Test deployment pipeline
  6. βœ… Get Deployment β€” Monitor deployment status

Collection Features

  • βœ… Auto-saves access tokens
  • βœ… Auto-fills project/deployment IDs
  • βœ… Pre-configured request bodies
  • βœ… Test scripts for validation
  • βœ… Environment variables support

πŸ“– Postman Guide


πŸš€ Production Deployment

Using PM2

# Build project
npm run build

# Start with PM2
pm2 start ecosystem.config.js --env production

# Save PM2 configuration
pm2 save

# Enable startup on boot
pm2 startup

# Monitor
pm2 monit

Nginx Reverse Proxy

server {
    listen 80;
    server_name deploy.yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;

        # Increase timeout for long deployments
        proxy_read_timeout 300s;
    }
}

SSL with Let's Encrypt

sudo certbot --nginx -d deploy.yourdomain.com

πŸ“– Production Guide


πŸ“ˆ Monitoring & Logging

Log Files

Located in logs/ directory:

File Content Retention
combined-%DATE%.log All logs 14 days
error-%DATE%.log Errors only 30 days
deployment-%DATE%.log Deployment logs 30 days

View Logs

# Tail all logs
tail -f logs/combined-*.log

# Tail errors only
tail -f logs/error-*.log

# Tail deployment logs
tail -f logs/deployment-*.log

# PM2 logs (if using PM2)
pm2 logs deploy-center

Health Check

curl http://localhost:3000/health

# Expected response:
# {
#   "Success": true,
#   "Message": "Deploy Center API is running",
#   "Timestamp": "2025-01-28T..."
# }

πŸ› Troubleshooting

Common Issues

Database Connection Failed

Error: connect ECONNREFUSED 127.0.0.1:3306

Solution:

# Check if MariaDB is running
sudo systemctl status mariadb

# Start MariaDB
sudo systemctl start mariadb

# Test connection
mysql -u deploy_user -p deploy_center

Port Already in Use

Error: EADDRINUSE: address already in use :::3000

Solution:

# Find process using port 3000
lsof -i :3000

# Kill process (replace PID)
kill -9 PID

# Or change port in .env
PORT=3001

Webhook Not Triggering

Solutions:

  1. Verify webhook secret matches between GitHub and project
  2. Check server is accessible from internet (use ngrok for local testing)
  3. Review GitHub webhook delivery logs
  4. Test webhook: GET /webhook/test/:projectName
  5. Check server logs: tail -f logs/combined-*.log

401 Unauthorized

Solution:

# Login again to get new token
curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"Username":"admin","Password":"Admin@12345"}'

# Or use refresh token endpoint
curl -X POST http://localhost:3000/api/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{"RefreshToken":"YOUR_REFRESH_TOKEN"}'

πŸ“– Full Troubleshooting Guide


πŸ“ Architecture Diagrams

System Architecture

graph TB
    subgraph "External Services"
        GH[GitHub]
        DISCORD[Discord]
        SLACK[Slack]
        EMAIL[Email SMTP]
    end

    subgraph "Deploy Center"
        WH[Webhook Endpoint]
        API[REST API]
        AUTH[Auth Service]
        PS[Project Service]
        DSVC[Deployment Service]
        QS[Queue Service]
        PPS[Pipeline Service]
        NS[Notification Service]
        DB[(MariaDB)]
    end

    subgraph "Target Servers"
        TS1[Server 1]
        TS2[Server 2]
        TS3[Server N]
    end

    GH -->|POST Webhook| WH
    WH --> DSVC
    API --> AUTH
    API --> PS
    API --> DSVC
    DSVC --> QS
    QS --> PPS
    PPS -->|Execute| TS1
    PPS -->|Execute| TS2
    PPS -->|Execute| TS3
    PPS --> NS
    NS --> DISCORD
    NS --> SLACK
    NS --> EMAIL
    AUTH --> DB
    PS --> DB
    DSVC --> DB
Loading

Database Schema

erDiagram
    Users ||--o{ Projects : creates
    Users ||--o{ AuditLogs : generates
    Projects ||--o{ Deployments : has
    Deployments ||--o{ DeploymentSteps : contains

    Users {
        int Id PK
        string Username UK
        string Email UK
        string PasswordHash
        string Role
        boolean IsActive
        datetime CreatedAt
        datetime UpdatedAt
        datetime DeletedAt
    }

    Projects {
        int Id PK
        string Name UK
        string RepoUrl
        string WebhookSecret
        json Config
        int CreatedBy FK
        boolean IsActive
        datetime CreatedAt
        datetime UpdatedAt
        datetime DeletedAt
    }

    Deployments {
        int Id PK
        int ProjectId FK
        string Branch
        string CommitHash
        string CommitMessage
        string Status
        datetime StartedAt
        datetime FinishedAt
        int CreatedBy FK
        datetime CreatedAt
    }

    DeploymentSteps {
        int Id PK
        int DeploymentId FK
        string Name
        string Command
        string Status
        text Output
        text ErrorOutput
        int DurationMs
        datetime CreatedAt
    }

    AuditLogs {
        int Id PK
        int UserId FK
        string Action
        string Resource
        json Details
        datetime CreatedAt
    }
Loading

πŸ“‚ Project Structure

deploy-center/
β”œβ”€β”€ server/                      # Backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ Config/             # Application configuration
β”‚   β”‚   β”œβ”€β”€ Controllers/        # HTTP request handlers
β”‚   β”‚   β”œβ”€β”€ Database/           # Database connection & setup
β”‚   β”‚   β”œβ”€β”€ Middleware/         # Express middlewares
β”‚   β”‚   β”œβ”€β”€ Models/             # Database models (Sequelize)
β”‚   β”‚   β”œβ”€β”€ Routes/             # API route definitions
β”‚   β”‚   β”œβ”€β”€ Services/           # Business logic layer
β”‚   β”‚   β”œβ”€β”€ Types/              # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ Utils/              # Utility functions & helpers
β”‚   β”‚   β”œβ”€β”€ App.ts              # Express app setup
β”‚   β”‚   β”œβ”€β”€ Server.ts           # Server initialization
β”‚   β”‚   └── index.ts            # Entry point
β”‚   β”œβ”€β”€ docs/                   # Documentation
β”‚   β”œβ”€β”€ logs/                   # Log files (auto-generated)
β”‚   β”œβ”€β”€ deployments/            # Deployment workspaces
β”‚   β”œβ”€β”€ .env.example            # Environment template
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ client/                     # Web Dashboard (React)
β”œβ”€β”€ .github/                    # GitHub templates & workflows
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”œβ”€β”€ pull_request_template.md
β”‚   └── workflows/
β”œβ”€β”€ LICENSES/                   # License files
β”‚   β”œβ”€β”€ LICENSE-PERSONAL.md
β”‚   └── LICENSE-COMMERCIAL.md
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ SECURITY.md
└── SUPPORT.md

πŸ“– Detailed Structure Documentation


πŸ—ΊοΈ Roadmap

βœ… Completed (v2.0)

  • βœ… Complete TypeScript rewrite
  • βœ… Database integration (MariaDB)
  • βœ… JWT authentication & RBAC
  • βœ… Queue management system
  • βœ… Multi-platform notifications
  • βœ… Pipeline execution engine
  • βœ… REST API (30+ endpoints)
  • βœ… Comprehensive logging
  • βœ… Security hardening
  • βœ… Full documentation

🚧 In Progress (v2.1)

  • 🚧 Web dashboard (React + TypeScript)
  • 🚧 Real-time updates (Socket.IO)
  • 🚧 Database migrations (Sequelize CLI)
  • 🚧 Deployment rollback system
  • 🚧 Health checks for deployed apps

πŸ“… Planned (v3.0)

  • πŸ“… Multi-server deployment support
  • πŸ“… Docker & Kubernetes integration
  • πŸ“… Deployment scheduling (cron)
  • πŸ“… Environment variables management
  • πŸ“… Secrets vault integration
  • πŸ“… Approval workflows
  • πŸ“… Advanced analytics & reporting
  • πŸ“… GitLab & Bitbucket support
  • πŸ“… Plugin system
  • πŸ“… Marketplace for deployment templates

πŸ’‘ Future Ideas

  • Container registry integration
  • Blue-green deployments
  • Canary releases
  • A/B testing support
  • Performance metrics
  • Cost tracking
  • Multi-tenant support
  • SSO (OAuth, SAML)

Vote on features: GitHub Discussions


🀝 Contributing

We welcome contributions! Deploy Center is built with ❀️ by the community.

How to Contribute

  1. 🍴 Fork the repository
  2. πŸ”¨ Create a feature branch (git checkout -b feature/amazing-feature)
  3. βœ… Commit your changes (git commit -m 'Add amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. 🎯 Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/YOUR_USERNAME/Deploy-Center-Server.git
cd Deploy-Center-Server/server

# Install dependencies
npm install

# Setup database
mysql -u root -p < setup.sql

# Configure environment
cp .env.example .env
# Edit .env

# Start development server
npm run dev

Coding Standards

  • βœ… PascalCase for classes, interfaces, class properties, class methods
  • βœ… camelCase for variables, function parameters
  • βœ… TypeScript strict mode enforced
  • βœ… ESLint + Prettier for formatting
  • βœ… SOLID principles followed
  • βœ… Tests required for new features
  • βœ… Documentation updated

πŸ“– Contributing Guide


πŸ“œ License

Deploy Center is available under dual licensing:

πŸ†“ Personal Use License

Free for personal, non-commercial use.

Perfect for:

  • βœ… Personal projects
  • βœ… Learning & education
  • βœ… Open source contributions
  • βœ… Portfolio projects

View Personal License

πŸ’Ό Commercial Use License (FSD-CL)

Required for commercial use, businesses, and organizations.

Includes:

  • βœ… Commercial deployment rights
  • βœ… Integration into commercial products
  • βœ… White-label deployment
  • ⚠️ Restrictions on redistribution

View Commercial License


πŸ”’ License Selection

Use Case License Required
Personal projects Personal Use License
Learning & tutorials Personal Use License
Open source projects Personal Use License
Freelance client work Commercial License
Startup/business use Commercial License
SaaS platform Commercial License
Reselling software Commercial License

Need commercial license? Contact: licensing@futuresolutionsdev.com

⚠️ Violation Warning: Unauthorized commercial use violates copyright law and will be pursued legally.


πŸ’¬ Support

Community Support

Professional Support

Need help with deployment, customization, or integration?

πŸ“– Support Guide


πŸ‘₯ Maintainers

Sabry Dawood
Sabry Dawood

Lead Developer
FutureSolutionDev
FutureSolutionDev

Organization

Connect With Us


πŸ™ Acknowledgments

Built with these amazing technologies:


⭐ Star History

If you find Deploy Center useful, please consider giving it a star!

Star History Chart


πŸ“Έ Screenshots

Dashboard (Coming Soon)

Dashboard

Pipeline Execution (Coming Soon)

Pipeline

Project Management (Coming Soon)

Projects


πŸŽ‰ Made with ❀️ by FutureSolutionDev

Deploy Center β€” Deployment Automation Made Simple

GitHub Repo Website License

⬆ Back to Top

About

Complete deployment automation platform with CI/CD integration, built with TypeScript, Express, and MariaDB.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages