Skip to content

Nischay-loq/DeployX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

238 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 β€’ Documentation β€’ Contributors


🌐 Overview

DeployX is designed to simplify and automate the deployment process across distributed systems. Whether managing a handful of machines or an entire fleet, DeployX provides real-time control, automated backup/rollback capabilities, and comprehensive monitoringβ€”all from an intuitive web dashboard.

πŸ’‘ Key Components

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 -->|PostgreSQL| F[Database]
Loading
  • Frontend: React-based dashboard with real-time updates and intuitive UI
  • Backend: FastAPI server with PostgreSQL database for orchestration and state management
  • Agent: Lightweight Python client running on target machines with auto-update capabilities
  • Communication: Real-time bidirectional communication via Socket.IO and REST APIs

✨ Features

🎯 Core Capabilities

Deployment Management

  • πŸ“¦ Software Deployment: Automated installation across multiple machines
  • πŸ”„ Auto-Update: Self-updating agent mechanism for seamless updates
  • πŸ“… Scheduled Deployments: Schedule installations for specific times
  • 🌍 Multi-Environment Support: Development, staging, and production environments
  • πŸ”™ Backup & Rollback: Automatic backups before destructive operations

Command Execution

  • πŸ’» Remote Shell Access: Execute terminal commands (CMD, PowerShell, Bash)
  • πŸ‘₯ Group Operations: Execute commands across device groups simultaneously
  • ⚑ Parallel & Sequential: Support for both parallel and sequential batch execution
  • 🎯 Selective Targeting: Run commands on specific machines or groups
  • πŸ“Š Real-time Output: Live command output streaming

System Monitoring

  • πŸ“ˆ Resource Monitoring: CPU, RAM, disk, and network usage
  • πŸ” Agent Discovery: Automatic agent detection via Zeroconf/mDNS
  • ❀️ Health Checks: Continuous heartbeat and status monitoring
  • πŸ“ Comprehensive Logging: Detailed activity and error logs
  • πŸ”” Real-time Notifications: Instant updates on deployment status

File Management

  • πŸ“ File Transfer: Upload/download files to/from remote machines
  • πŸ—‚οΈ Directory Operations: Remote file system navigation and management
  • πŸ“¦ Batch Operations: Multiple file operations in one go

Security & Authentication

  • πŸ” JWT Authentication: Secure token-based authentication
  • 🌐 Firebase Integration: Support for Google OAuth and social logins
  • πŸ‘€ User Management: Role-based access control
  • πŸ”’ Secure Communication: Encrypted agent-server communication
  • πŸ“‹ Action Logging: Complete audit trail of all operations

Advanced Features

  • πŸŽ›οΈ Device Grouping: Organize machines into logical groups
  • πŸ” Destructive Command Detection: Automatic backup before dangerous operations
  • 🏷️ Software Inventory: Track installed software across machines
  • πŸ“Š Dashboard Analytics: Visual insights into deployment status
  • πŸ”„ State Management: Persistent tracking of deployment states

πŸ—οΈ Architecture

Tech Stack

Backend

Technology Purpose
FastAPI Modern Python web framework for APIs
PostgreSQL Relational database for persistent storage
SQLAlchemy ORM for database interactions
Socket.IO Real-time bidirectional communication
JWT Secure authentication tokens
APScheduler Task scheduling and cron jobs
Uvicorn ASGI server for production deployment

Frontend

Technology Purpose
React 18 Component-based UI framework
Vite Fast build tool and dev server
Axios HTTP client for API communication
Socket.IO Client Real-time event handling
Xterm.js Terminal emulation in browser
Tailwind CSS Utility-first CSS framework
Framer Motion Animation library
Firebase Authentication and OAuth integration

Agent

Technology Purpose
Python 3.8+ Core agent runtime
Socket.IO Server communication
Zeroconf Service discovery (mDNS)
psutil System information gathering
aiohttp Async HTTP client

DevOps & Deployment

  • Hosting: Render (Backend) + Vercel (Frontend)
  • Version Control: Git
  • Build Tools: PyInstaller (Agent executables)
  • CI/CD: Automated deployment pipelines

πŸš€ Quick Start

Prerequisites

  • Python: 3.8 or higher
  • Node.js: 16.x or higher
  • PostgreSQL: 12 or higher
  • Git: For cloning the repository

Installation

1️⃣ Clone the Repository

git clone https://github.com/your-username/DeployX.git
cd DeployX

2️⃣ Backend Setup

cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env
# Edit .env with your database credentials and settings

# Run database migrations (if applicable)
# python migrate.py

# Start the backend server
python start_server.py

Backend Environment Variables (.env):

DATABASE_URL=postgresql://user:password@localhost/deployx
SECRET_KEY=your-secret-key-here
ENVIRONMENT=development
FRONTEND_URL=http://localhost:5173
JWT_SECRET_KEY=your-jwt-secret

3️⃣ Frontend Setup

cd frontend

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env
# Edit .env with your backend URL

# Start development server
npm run dev

Frontend Environment Variables (.env):

VITE_API_URL=http://localhost:8000
VITE_SOCKET_URL=http://localhost:8000

4️⃣ Agent Setup

cd agent

# Install dependencies
pip install -r requirements.txt

# Configure agent settings (optional)
# Edit config.json for custom server URL

# Run the agent
python main.py --server http://localhost:8000

Or use the standalone executable (from Exe/ directory):

# Windows
DeployX-Agent.exe

# Linux
./DeployX-Agent

# macOS
./DeployX-Agent

🎯 Quick Test

  1. Access Dashboard: Navigate to http://localhost:5173
  2. Login: Create an account or use OAuth
  3. Start Agent: Run agent on target machine
  4. Verify Connection: Check dashboard for connected agents
  5. Execute Command: Test a simple command like echo "Hello from DeployX!"

πŸ“ Project Structure

DeployX/
β”œβ”€β”€ agent/                          # Python agent for target machines
β”‚   β”œβ”€β”€ main.py                    # Agent entry point
β”‚   β”œβ”€β”€ core/                      # Core agent functionality
β”‚   β”‚   β”œβ”€β”€ backup_manager.py     # Automatic backup system
β”‚   β”‚   β”œβ”€β”€ command_executor.py   # Command execution engine
β”‚   β”‚   β”œβ”€β”€ connection.py         # Server connection management
β”‚   β”‚   β”œβ”€β”€ destructive_detector.py # Dangerous command detection
β”‚   β”‚   └── shell_manager.py      # Shell session management
β”‚   β”œβ”€β”€ handlers/                  # Event handlers
β”‚   β”‚   └── socket_handlers.py    # Socket.IO event handling
β”‚   β”œβ”€β”€ installers/                # Software installation
β”‚   β”‚   β”œβ”€β”€ downloader.py         # File download utilities
β”‚   β”‚   └── installer.py          # Installation automation
β”‚   β”œβ”€β”€ network/                   # Network utilities
β”‚   β”‚   β”œβ”€β”€ server_discoverer.py  # Server discovery (mDNS)
β”‚   β”‚   └── service_advertiser.py # Service advertisement
β”‚   └── utils/                     # Helper utilities
β”‚       └── machine_id.py         # Unique agent identification
β”‚
β”œβ”€β”€ backend/                        # FastAPI backend server
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py               # Application entry point
β”‚   β”‚   β”œβ”€β”€ agents/               # Agent management
β”‚   β”‚   β”‚   β”œβ”€β”€ routes.py        # Agent API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ crud.py          # Database operations
β”‚   β”‚   β”‚   └── schemas.py       # Pydantic models
β”‚   β”‚   β”œβ”€β”€ auth/                 # Authentication system
β”‚   β”‚   β”‚   β”œβ”€β”€ routes.py        # Auth endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ database.py      # User database
β”‚   β”‚   β”‚   β”œβ”€β”€ utils.py         # JWT & password hashing
β”‚   β”‚   β”‚   └── schemas.py       # Auth models
β”‚   β”‚   β”œβ”€β”€ Deployments/          # Deployment management
β”‚   β”‚   β”‚   β”œβ”€β”€ routes.py        # Deployment endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ executor.py      # Deployment execution
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py        # Database models
β”‚   β”‚   β”‚   └── scheduler.py     # Scheduled deployments
β”‚   β”‚   β”œβ”€β”€ command_deployment/   # Command execution
β”‚   β”‚   β”‚   β”œβ”€β”€ routes.py        # Command endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ executor.py      # Command execution
β”‚   β”‚   β”‚   β”œβ”€β”€ queue.py         # Command queue
β”‚   β”‚   β”‚   └── strategies.py    # Execution strategies
β”‚   β”‚   β”œβ”€β”€ grouping/             # Device grouping
β”‚   β”‚   β”‚   β”œβ”€β”€ route.py         # Group endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ command_executor.py # Group command execution
β”‚   β”‚   β”‚   β”œβ”€β”€ crud.py          # Group operations
β”‚   β”‚   β”‚   └── models.py        # Group models
β”‚   β”‚   β”œβ”€β”€ files/                # File management
β”‚   β”‚   β”‚   β”œβ”€β”€ routes.py        # File endpoints
β”‚   β”‚   β”‚   └── crud.py          # File operations
β”‚   β”‚   β”œβ”€β”€ software/             # Software catalog
β”‚   β”‚   β”œβ”€β”€ Devices/              # Device management
β”‚   β”‚   └── dashboard/            # Dashboard data
β”‚   └── start_server.py           # Server startup script
β”‚
β”œβ”€β”€ frontend/                       # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx               # Main application component
β”‚   β”‚   β”œβ”€β”€ main.jsx              # Entry point
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/                # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx         # Landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx    # Main dashboard
β”‚   β”‚   β”‚   └── ...              # Other pages
β”‚   β”‚   β”œβ”€β”€ contexts/             # React contexts
β”‚   β”‚   β”œβ”€β”€ services/             # API services
β”‚   β”‚   β”‚   └── auth.js          # Authentication service
β”‚   β”‚   └── utils/                # Helper functions
β”‚   β”œβ”€β”€ public/                    # Static assets
β”‚   β”œβ”€β”€ package.json              # Dependencies
β”‚   └── vite.config.js            # Vite configuration
β”‚
β”œβ”€β”€ executable_agent_file/         # Agent executable builder
β”‚   β”œβ”€β”€ agent_with_updater.py    # Agent with auto-update
β”‚   β”œβ”€β”€ updater.py                # Update mechanism
β”‚   β”œβ”€β”€ version.py                # Version tracking
β”‚   β”œβ”€β”€ build_all.bat             # Windows build script
β”‚   └── build_all.sh              # Linux/Mac build script
β”‚
β”œβ”€β”€ Exe/                           # Compiled agent executables
β”‚   β”œβ”€β”€ windows/                  # Windows .exe
β”‚   β”œβ”€β”€ linux/                    # Linux binaries
β”‚   └── macos/                    # macOS binaries
β”‚
β”œβ”€β”€ LICENSE                        # MIT License
└── README.md                      # This file

πŸ“– API Documentation

REST API Endpoints

Once the backend is running, access the interactive API documentation:

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

Key API Routes

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • POST /api/auth/google-login - Google OAuth login
  • POST /api/auth/refresh - Refresh JWT token

Agents

  • GET /api/agents - List all agents
  • GET /api/agents/{agent_id} - Get agent details
  • POST /api/agents/{agent_id}/command - Execute command
  • DELETE /api/agents/{agent_id} - Remove agent

Deployments

  • POST /api/deployments - Create deployment
  • GET /api/deployments - List deployments
  • GET /api/deployments/{deployment_id} - Get deployment status
  • POST /api/deployments/{deployment_id}/rollback - Rollback deployment

Groups

  • POST /api/groups - Create device group
  • GET /api/groups - List all groups
  • POST /api/groups/{group_id}/execute - Execute command on group

πŸ”§ Configuration

Agent Configuration

Create config/config.json in agent directory:

{
  "server_url": "http://your-server.com:8000",
  "auto_reconnect": true,
  "reconnect_interval": 5,
  "heartbeat_interval": 30,
  "enable_auto_update": true,
  "update_check_interval": 3600,
  "backup_enabled": true,
  "backup_retention_days": 7,
  "allowed_shells": ["cmd", "powershell", "bash"]
}

Backend Configuration

Key environment variables:

Variable Description Default
DATABASE_URL PostgreSQL connection string -
SECRET_KEY Application secret key -
JWT_SECRET_KEY JWT signing key -
ENVIRONMENT Environment (dev/staging/prod) development
FRONTEND_URL Frontend URL for CORS http://localhost:5173
MAX_COMMAND_TIMEOUT Max command execution time (seconds) 300

πŸ§ͺ Testing

Backend Tests

cd backend
pytest

Agent Tests

cd agent
python test_backup_rollback.py

Frontend Tests

cd frontend
npm test

🚒 Deployment

Production Deployment

Backend (Render)

  1. Connect your GitHub repository
  2. Set environment variables
  3. Deploy using start_server.py

Frontend (Vercel)

  1. Import project from GitHub
  2. Configure build settings:
    • Build Command: npm run build
    • Output Directory: dist
  3. Set environment variables
  4. Deploy

Agent Distribution

  1. Build executables:
    cd executable_agent_file
    # Windows
    build_all.bat
    # Linux/Mac
    ./build_all.sh
  2. Distribute executables from Exe/ directory

🀝 Contributing

We welcome contributions! Here's how you can help:

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

Development Guidelines

  • Follow PEP 8 for Python code
  • Use ESLint rules for JavaScript/React
  • Write tests for new features
  • Update documentation for API changes

πŸ“„ 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

πŸ™ Acknowledgments

  • FastAPI for the excellent web framework
  • Socket.IO for real-time communication
  • React team for the amazing UI library
  • Open source community for various libraries used

⭐ 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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors