Skip to content

Latest commit

Β 

History

240 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DeployX

Automated Deployment & Remote System Management Platform

License: MIT Python FastAPI React

DeployX is a full-stack deployment automation platform that enables centralized management of software installations, command execution, and system monitoring across multiple machines. Deploy, control, and monitor your entire infrastructure from a single dashboard.

Features β€’ Architecture β€’ Quick Start β€’ Agent Setup β€’ API


🌐 Overview

DeployX simplifies and automates deployment across distributed systems. Whether managing a handful of machines or an entire fleet, DeployX provides real-time control, automatic backup/rollback for destructive operations, scheduled tasks, and comprehensive monitoring β€” all from a web dashboard.

graph LR
    A[React Dashboard] -->|REST API| B[FastAPI Backend]
    B -->|Socket.IO| C[Agent 1]
    B -->|Socket.IO| D[Agent 2]
    B -->|Socket.IO| E[Agent N]
    B -->|SQLAlchemy| F[(Database)]
Loading
  • Frontend: React dashboard with real-time updates via Socket.IO
  • Backend: FastAPI server handling orchestration, auth, scheduling and state
  • Agent: Lightweight Python client on target machines (Windows/Linux/macOS)
  • Communication: Bidirectional Socket.IO events + REST APIs

✨ Features

πŸ–₯️ Agent Enrollment & Activation

  • πŸ”‘ Activation Keys: Generate time-limited keys from the dashboard; agents self-activate against the server
  • ⚑ One-Command Setup: Copy a single PowerShell or bash command per key β€” it downloads the right agent binary for the OS, installs it to the startup folder (Windows) or autostart/systemd-user (Linux), and activates it automatically
  • πŸ”„ Auto-Update Channel: Agents poll /api/agent/updates for new versions with checksum verification

🎯 Deployment Management

  • πŸ“¦ Software Deployment: Install catalog software or custom commands across multiple machines
  • πŸ“„ File Deployment: Upload files once (local or picked straight from Google Drive) and distribute them to target paths on many devices
  • πŸ” Retries: Re-run failed software deployments and reschedule failed scheduled tasks
  • πŸ“… Scheduled Tasks: One-time, interval, or cron-style recurrence for commands, software and file deployments
  • πŸ”™ Backup & Rollback: Automatic backups before destructive operations, with rollback/restore endpoints
  • πŸ›‘οΈ Destructive Command Detection: Dangerous commands (rm -rf, del /s, format, …) are flagged and backed up before execution

πŸ’» Command Execution

  • πŸ’» Remote Shell Access: Interactive CMD / PowerShell / Bash terminals in the browser (Xterm.js) with command-history navigation, interrupt (Ctrl+C), suspend and clear-screen support
  • πŸ‘₯ Group Operations: Execute commands or batches across device groups in parallel
  • ⏸️ Command Queue: Persistent queue with pause/resume/delete, live output streaming, status tracking and statistics
  • πŸ”€ Deployment Strategies: Sequential batch (with stop-on-failure), blue-green and canary flows

πŸ“Š Monitoring & Management

  • πŸ“ˆ Dashboard Analytics: Device health, deployment trends, system metrics and recent activity
  • ❀️ Heartbeats & Status: Continuous online/offline tracking of every agent
  • πŸ–₯️ Device Inventory: OS, CPU, memory, disk and network details collected from every agent
  • πŸ—‚οΈ Device Grouping: Organize machines into logical groups with membership management
  • πŸ“ Logs: Centralized activity logs with statistics and one-click Excel export
  • πŸ”” Real-time Notifications: Instant deployment/command results in the UI

πŸ” Security

  • πŸ” JWT Authentication with refresh tokens and Google OAuth (Firebase)
  • πŸ‘€ Account Management: username change, email change (with verification link) and self-service account deletion
  • 🧾 Audit trail of deployments, commands and results
  • πŸ“§ Email verification: signup OTPs, password resets and email-change links

πŸ—οΈ Architecture

Tech Stack

Backend

Technology Purpose
FastAPI REST APIs + Socket.IO server
SQLAlchemy ORM (PostgreSQL recommended, any DB via DB_URL)
python-socketio Real-time agent/frontend communication
APScheduler Task scheduling
JWT (python-jose) Authentication tokens
Uvicorn ASGI server

Frontend

Technology Purpose
React 18 + Vite UI framework and build tooling
Tailwind CSS Styling
Socket.IO Client Real-time event handling
Xterm.js In-browser terminal emulation
Firebase Google OAuth
fetch-based ApiClient Single HTTP client with token refresh

Agent

Technology Purpose
Python 3.8+ Core runtime (packaged with PyInstaller)
Socket.IO Client Server communication
psutil System information
aiohttp Async downloads

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • A database (PostgreSQL recommended)

Backend

cd backend
python -m venv venv
venv\Scripts\activate        # Windows
# source venv/bin/activate   # Linux/Mac
pip install -r requirements.txt

# Create a .env next to start_server.py (see Configuration below)
python start_server.py       # serves app + Socket.IO on port 8000

Frontend

cd frontend
npm install

# .env in frontend/:
#   VITE_API_URL=http://localhost:8000
#   VITE_SOCKET_URL=http://localhost:8000

npm run dev                  # http://localhost:5173

Agent

cd agent
pip install -r requirements.txt
python main.py --server http://localhost:8000 --activation-key XXXX-XXXX-XXXX-XXXX

Useful flags: --server, --agent-id, --advertise, --set-activation-key KEY. The key can also be provided via the DEPLOYX_ACTIVATION_KEY environment variable.

Quick Test

  1. Open the dashboard at http://localhost:5173 and sign up
  2. Run the agent on a target machine with a valid activation key
  3. Verify the device appears online, open its terminal and run echo hello
  4. Generate an activation key β†’ copy its setup command β†’ enroll more machines with one paste

πŸ–₯️ Agent Setup (One Command)

  1. Place built agent binaries on the backend host inside backend/agent_updates/:
    • DeployXAgent.exe (Windows, PyInstaller build)
    • deployx-agent-linux (Linux binary)
  2. In the dashboard go to Activation Keys β†’ ⌨ Setup Command for your key.
  3. Copy the line matching the target OS and run it there:

Windows (CMD or PowerShell):

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm 'https://your-server/api/agent/setup/bootstrap.ps1?key=XXXX-XXXX-XXXX-XXXX&server=https://your-server' | iex"

Linux:

curl -fsSL 'https://your-server/api/agent/setup/bootstrap.sh?key=XXXX-XXXX-XXXX-XXXX&server=https://your-server' | bash

What the script does: detects nothing it doesn't need to (it is already platform-specific), downloads the matching binary, installs it, registers autostart (%APPDATA%\...\Startup\DeployXAgent.cmd on Windows; systemd user service or desktop autostart entry on Linux), launches the agent, and activates it with your key.


πŸ“ Project Structure

DeployX/
β”œβ”€β”€ agent/                          # Python agent for target machines
β”‚   β”œβ”€β”€ main.py                     # Entry point (CLI flags, reconnect loop)
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ activation.py           # Activation-key handshake + local state
β”‚   β”‚   β”œβ”€β”€ backup_manager.py       # Backup creation/restore/delete
β”‚   β”‚   β”œβ”€β”€ command_executor.py     # Execution engine + rollback
β”‚   β”‚   β”œβ”€β”€ connection.py           # Socket.IO connection manager
β”‚   β”‚   β”œβ”€β”€ destructive_detector.py # Dangerous command analysis
β”‚   β”‚   └── shell_manager.py        # Shell session management
β”‚   β”œβ”€β”€ handlers/socket_handlers.py # Socket event handlers
β”‚   β”œβ”€β”€ installers/                 # downloader.py + installer.py
β”‚   β”œβ”€β”€ network/service_advertiser.py # Optional mDNS advertising (--advertise)
β”‚   └── utils/machine_id.py         # Machine fingerprinting
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py                 # App composition root (routers, CORS)
β”‚   β”‚   β”œβ”€β”€ config.py               # CORS/environment helpers
β”‚   β”‚   β”œβ”€β”€ sockets/                # Socket.IO server, ConnectionManager,
β”‚   β”‚   β”‚                           # and all socket event handlers
β”‚   β”‚   β”œβ”€β”€ common/socket_base.py   # Shared executor plumbing
β”‚   β”‚   β”œβ”€β”€ auth/                   # Signup/login/OAuth/password flows
β”‚   β”‚   β”œβ”€β”€ activation/             # Activation keys CRUD + validation
β”‚   β”‚   β”œβ”€β”€ agent_setup/            # One-command bootstrap scripts + binaries
β”‚   β”‚   β”œβ”€β”€ agent_updates/          # Agent auto-update distribution
β”‚   β”‚   β”œβ”€β”€ agents/                 # Agent/device registry
β”‚   β”‚   β”œβ”€β”€ Devices/                # Device status endpoints
β”‚   β”‚   β”œβ”€β”€ grouping/               # Groups, group executor, target resolution
β”‚   β”‚   β”œβ”€β”€ command_deployment/     # Command queue, executor, strategies
β”‚   β”‚   β”œβ”€β”€ Deployments/            # Software deployments
β”‚   β”‚   β”œβ”€β”€ files/                  # Upload/deploy/file-system endpoints
β”‚   β”‚   β”œβ”€β”€ software/               # Software catalog
β”‚   β”‚   β”œβ”€β”€ schedule/               # Scheduled tasks + scheduler service
β”‚   β”‚   β”œβ”€β”€ dashboard/              # Analytics endpoints
β”‚   β”‚   └── logs/                   # Activity logs
β”‚   └── start_server.py             # Uvicorn startup script
β”‚
β”œβ”€β”€ frontend/src/
β”‚   β”œβ”€β”€ pages/                      # Home, Dashboard, ForgotPassword, ...
β”‚   β”œβ”€β”€ components/                 # Terminal, managers, modals, ...
β”‚   β”œβ”€β”€ services/api.js             # ApiClient (+ shared base URL export)
β”‚   β”œβ”€β”€ utils/format.js             # Shared date/size formatters
β”‚   └── App.jsx                     # Routes (Dashboard is lazy-loaded)
β”‚
β”œβ”€β”€ executable_agent_file/          # PyInstaller packaging + updater wrapper
β”œβ”€β”€ tests/test_backup_rollback.py   # Pytest suite (detector/backup/rollback)
└── LICENSE

πŸ“– API Documentation

Interactive docs once the backend is running:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Key Routes

Area Endpoints
Auth (/auth) POST /auth/signup-request, /auth/signup-complete, /auth/login, /auth/google-auth, /auth/refresh; password reset + email change flows under /auth/*
Devices (/devices) GET /devices/, POST /devices/ (status update)
Groups (/groups) Group CRUD; POST /groups/{id}/commands, POST /groups/{id}/commands/batch/sequential; executions/batches status
Commands (/api/deployment) POST /commands, /commands/batch, /commands/batch/sequential; /{cmd_id}/pause|resume|rollback|restore-backup; GET /stats
Software deployments (/deployments) POST /install, GET /{deployment_id}/progress, /details, GET /by-date/{date}, POST /retry
Files (/files) POST /files/upload, POST /files/deploy, GET /deployments (history), progress, DELETE /{file_id}, remote filesystem ops
Software catalog (/software) CRUD for catalog entries + categories
Logs (/api/logs) List, stats, log details
Scheduling (/api/schedule) Task CRUD, pause/resume/execute, executions history, stats
Dashboard (/api/dashboard) stats, recent-activity, deployment-trends, system-metrics, device-status-chart
Activation (/activation) POST /generate, POST /validate, GET /keys, GET /check/{machine_id}
Agent setup (/api/agent/setup) GET /commands/{key_id}, GET /bootstrap.ps1, GET /bootstrap.sh, GET /binary/{platform}
Agent updates (/api/agent/updates) GET /check, GET /download/{platform}/{version}, GET /versions

Real-time communication (shell I/O, command output, agent registration, heartbeats) runs over Socket.IO β€” see backend/app/sockets/handlers.py.


πŸ”§ Configuration

Backend environment variables (.env next to start_server.py)

Variable Description Default
DB_URL Database connection string (required) –
JWT_SECRET_KEY JWT signing key –
ENVIRONMENT development or production (controls CORS defaults) development
FRONTEND_URL / FRONTEND_LOCAL_URL Allowed frontend origins https://deployxsystem.vercel.app / http://localhost:5173
SMTP_EMAIL / SMTP_PASSWORD SMTP account for OTP/reset/email-change mails – (email disabled if unset)
SMTP_HOST / SMTP_PORT SMTP server smtp.gmail.com / 465
PUBLIC_SERVER_URL Override public URL used in generated setup commands request origin
AGENT_UPDATES_DIR Where agent binaries are served from ./agent_updates

Agent configuration

The agent is configured entirely via CLI flags and environment:

--server URL                 Backend URL (default http://localhost:8000)
--agent-id ID                Custom agent ID (else derived from machine ID)
--activation-key KEY         Activate immediately on startup
--set-activation-key KEY     Store a key for service mode and exit
--advertise                  Advertise presence via mDNS (optional)
DEPLOYX_ACTIVATION_KEY       Env-var alternative for the activation key

πŸ§ͺ Testing

From the repository root:

pytest tests

Covers destructive-command classification, backup create/info/list/delete, restore (default + custom path) and full command-executor rollback.


🚒 Production Deployment

  • Backend: Render (or any host) β€” start command python start_server.py; set the env vars above.
  • Frontend: Vercel β€” build npm run build, output dist/; set VITE_API_URL / VITE_SOCKET_URL.
  • Agents: build executables with executable_agent_file/build_all.bat|.sh, drop them into backend/agent_updates/, then enroll machines with the one-command setup from the dashboard.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes
  4. Push and open a Pull Request

Guidelines: PEP 8 for Python, ESLint conventions for JS/React, add tests for new features.


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘₯ Contributors

Chetan Chaudhari
Chetan Chaudhari
Nischay Chavan
Nischay Chavan
Parth Shikhare
Parth Shikhare

⭐ Star this repository if you find it helpful!

Made with ❀️ by the DeployX Team

About

DeployX is a specially curated platform designed to streamline and automate bulk software deployment across multiple systems with ease and efficiency.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages