Back to Astron Rpa

๐Ÿš€ AstronRPA Quick Start Guide

BUILD_GUIDE.md

1.1.617.5 KB
Original Source
<div align="center">

๐Ÿš€ AstronRPA Quick Start Guide

Fast, Simple, Powerful RPA Automation Platform Deployment Guide

Quick Start ยท Server Deployment ยท Client Deployment ยท FAQ

</div>

๐Ÿ“‹ Table of Contents

๐Ÿ’ป System Requirements

Operating System

OSVersionSupport Status
Windows10/11โœ… Primary Support

Hardware Configuration

ComponentMinimumRecommended
CPU2 cores4 cores+
Memory4GB8GB+
Disk10GB available20GB+
NetworkStable internet connection-

Environment Dependencies

ToolVersionDescription
Node.js>= 22JavaScript runtime
Python3.13.xRPA engine core
JavaJDK 8+Backend service runtime
pnpm>= 9Node.js package manager
UV0.8+Python package manager
7-Zip-Create deployment archives
SWIG-Connect Python with C/C++

๐Ÿ› ๏ธ Environment Setup

1๏ธโƒฃ Python (3.13.x)

๐Ÿ Core Dependency ยท AstronRPA requires Python 3.13.x as the RPA engine core

<details> <summary>๐Ÿ“ฆ <b>Installation Methods (Click to expand)</b></summary>

Method 1: Official Download (Recommended)

bash
# Visit https://www.python.org/downloads/
# Download and install Python 3.13.x

Method 2: Using Winget

bash
winget install Python.Python.3.13

Method 3: Using Chocolatey

bash
choco install python --version=3.13.x
</details>

๐Ÿ“ Python Installation Path

After installation, remember your Python installation path for later configuration:

Installation MethodTypical Path
๐ŸŸข Official InstallerC:\Users\{username}\AppData\Local\Programs\Python\Python313\
๐Ÿ”ต ChocolateyC:\Python313\ or C:\tools\python3\

๐Ÿ’ก Important Note:

  • โœ“ Python executable: {installation_directory}\python.exe
  • โœ“ Example: C:\Users\{username}\AppData\Local\Programs\Python\Python313\python.exe

2๏ธโƒฃ UV (0.8+)

โšก Fast Package Management ยท Next-generation Python package manager, 10-100x faster than pip

<details> <summary>๐Ÿ“ฆ <b>Installation Methods (Click to expand)</b></summary>
powershell
# Method 1: Official installation script (Recommended)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# Method 2: Using pip
pip install uv

# Method 3: Using Chocolatey
choco install uv
</details>

โœ… Verify Installation

bash
uv --version
# โœ“ Should display something like: uv 0.8.x (xxxxx)

๐Ÿ“– Learn More: UV Official Documentation

3๏ธโƒฃ pnpm (9+)

๐Ÿ“ฆ Efficient Package Management ยท Disk space-saving Node.js package manager

<details> <summary>๐Ÿ“ฆ <b>Installation Methods (Click to expand)</b></summary>
bash
# Method 1: Using npm (Recommended)
npm install -g pnpm@latest

# Method 2: Windows PowerShell
iwr https://get.pnpm.io/install.ps1 -useb | iex

# Method 3: macOS/Linux
curl -fsSL https://get.pnpm.io/install.sh | sh -

# Method 4: Homebrew (macOS)
brew install pnpm
</details>

โœ… Verify Installation

bash
pnpm --version
# โœ“ Should display 9.x.x or higher

๐Ÿ“– Learn More: pnpm Official Documentation

4๏ธโƒฃ Docker

๐Ÿณ Containerization Platform ยท For rapid server deployment

<details> <summary>๐Ÿ“ฅ <b>Download & Install (Click to expand)</b></summary>
PlatformDownload Link
๐ŸชŸ Windows/MacDocker Desktop
๐Ÿง LinuxDocker Engine
</details>

โœ… Verify Installation

bash
docker --version
docker compose --version
# โœ“ Confirm both Docker and Docker Compose are installed correctly

5๏ธโƒฃ 7-Zip

๐Ÿ“ฆ Compression Tool ยท For creating deployment archive files

<details> <summary>๐Ÿ“ฅ <b>Download & Install (Click to expand)</b></summary>

Official Website: https://www.7-zip.org/

Download and install to system, or extract to a custom directory

</details>

โœ… Verify Installation

bash
# If installed to system path
7z

# Or use full path
"C:\Program Files\7-Zip\7z.exe"

6๏ธโƒฃ SWIG

๐Ÿ”— Interface Generator ยท For connecting Python with C/C++ programs

<details> <summary>๐Ÿ“ฅ <b>Installation Steps (Click to expand)</b></summary>

Step 1: Download SWIG

Visit http://www.swig.org/download.html
Download swigwin-x.x.x.zip and extract to any directory

Step 2: Add to System Environment Variables

Add the directory containing swig.exe to PATH environment variable
For example: C:\swig\swigwin-4.1.1

Step 3: Verify Installation

bash
swig -version
# โœ“ Confirm SWIG is installed correctly
</details>

๐Ÿ—๏ธ Deployment Architecture

AstronRPA adopts a Server-Client architecture:

Deployment Overview

  1. Server Deployment - Quick deployment using Docker

    • Web management interface
    • Backend API services
    • Database and cache
    • AI services
  2. Client Deployment - Deploy using packaging scripts

    • RPA execution engine
    • Desktop management application
    • Connect to server for task execution

๐ŸŒ Server Deployment (Docker)

Quick Deployment ยท Launch all server components with Docker Compose in one command

The server provides web management interface, API services, database and other core services.


๐Ÿ“ฆ Deployment Steps

Step 1๏ธโƒฃ: Clone Repository

bash
git clone https://github.com/iflytek/astron-rpa.git
cd astron-rpa

Step 2๏ธโƒฃ: Start Server

bash
# Enter Docker directory
cd docker

# Copy .env file
cp .env.example .env

# Modify casdoor service configuration in .env
CASDOOR_EXTERNAL_ENDPOINT="http://{YOUR_SERVER_IP}:8000"

# ๐Ÿš€ Start all services
docker compose up -d

# ๐Ÿ“Š Check service status
docker compose ps
<details> <summary>๐Ÿ’ก <b>Expected Output Example</b></summary>
NAME                STATUS              PORTS
robot-service       Up 30 seconds       0.0.0.0:8080->8080/tcp
ai-service          Up 30 seconds       0.0.0.0:8001->8001/tcp
openapi-service     Up 30 seconds       0.0.0.0:8002->8002/tcp
mysql               Up 30 seconds       0.0.0.0:3306->3306/tcp
redis               Up 30 seconds       0.0.0.0:6379->6379/tcp
</details>

Step 3๏ธโƒฃ: Verify Server Deployment

bash
# ๐Ÿ“ View service logs
docker compose logs -f

๐Ÿ”ง Server Management Commands

bash
# ๐Ÿ›‘ Stop services
docker compose down

# ๐Ÿ”„ Restart services
docker compose restart

# ๐Ÿ“‹ View specific service logs
docker compose logs -f robot-service

# โฌ†๏ธ Update images
docker compose pull
docker compose up -d

๐Ÿ“– Detailed Configuration: Server Deployment Guide

๐Ÿ’ป Client Deployment (Local)

Local Deployment ยท Deploy engine and desktop application on machines running RPA tasks

The client includes RPA execution engine and desktop management application, needs to be deployed on machines executing RPA tasks.


๐ŸŽฏ One-Click Packaging Deployment

Suitable for production environments and end users.

๐ŸชŸ Windows Environment

<details> <summary><b>Step 1๏ธโƒฃ: Prepare Python Environment</b></summary>

Ensure Python 3.13.x is installed to a local directory (e.g., C:\Python313).

Environment Directory Structure:

Python313/
โ”œโ”€ DLLs/
โ”œโ”€ Doc/
โ”œโ”€ include/
โ”œโ”€ Lib/
โ”œโ”€ libs/
โ”œโ”€ Scripts/
โ”œโ”€ tcl/
โ”‚
โ”œโ”€ LICENSE.txt
โ”œโ”€ NEWS.txt
โ”œโ”€ python.exe
โ”œโ”€ python3.dll
โ”œโ”€ python313.dll
โ”œโ”€ pythonw.exe
โ”œโ”€ vcruntime140.dll
โ””โ”€ vcruntime140_1.dll

โš ๏ธ Important Note: Use a clean Python installation without additional third-party packages to reduce package size.

</details> <details> <summary><b>Step 2๏ธโƒฃ: Run Packaging Script</b></summary>

Basic Usage

Execute the build script from the project root directory:

bash
# ๐Ÿš€ Full build (engine + frontend)
./build.bat --python-exe "C:\Program Files\Python313\python.exe"

# Or use default configuration (if Python is in default path)
./build.bat

# โณ Wait for operation to complete
# โœ… Build successful when console displays "Full Build Complete!"

Execution Flow:

  1. โœ… Detect/copy Python environment to build/python_core
  2. โœ… Install RPA engine dependencies
  3. โœ… Compress Python core to resources/python_core.7z
  4. โœ… Install frontend dependencies
  5. โœ… Build desktop application

Advanced Options

View all available parameters:

bash
./build.bat --help

Common Parameter Combinations:

bash
# ๐Ÿ”ง Specify Python path
./build.bat --python-exe "D:\Python313\python.exe"

# ๐Ÿ”ง Specify 7-Zip path
./build.bat --sevenz-exe "D:\7-Zip\7z.exe"

# โญ๏ธ Build engine only, skip frontend
./build.bat --skip-frontend

# โญ๏ธ Build frontend only, skip engine
./build.bat --skip-engine

# ๐Ÿ”€ Combine with short options
./build.bat -p "D:\Python313\python.exe" -s "D:\7-Zip\7z.exe"

Parameter Description:

ParameterShortDescription
--python-exe <path>-pSpecify Python executable path
--sevenz-exe <path>-sSpecify 7-Zip executable path
--skip-engine-Skip engine (Python) build
--skip-frontend-Skip frontend build
--help-hDisplay help message

Manual Frontend Build

If you need to manually build the frontend separately, you can execute the following steps:

<details> <summary>Click to expand manual build steps</summary>
bash
cd frontend

# ๐Ÿ“ฆ Install dependencies
pnpm install

# โš™๏ธ Configure environment variables
pnpm set-env

# ๐Ÿ–ฅ๏ธ Build desktop application
pnpm build:desktop

Tip: Use build.bat --skip-engine to automatically complete the frontend build steps above.

</details> </details> <details> <summary><b>Step 3๏ธโƒฃ: Install Exe Package</b></summary>

Package completion path:

/frontend/packages/electron-app/dist/

Double-click the Exe file to install.

</details> <details> <summary><b>Step 4๏ธโƒฃ: Configure Server Address</b></summary>

Modify the server address in resources/conf.yaml under the installation directory:

yaml
# 32742 is the default port, modify if changed
remote_addr: http://YOUR_SERVER_ADDRESS:32742/
skip_engine_start: false

๐Ÿ’ก Tip: Replace YOUR_SERVER_ADDRESS with your actual server address

</details>

๐ŸŒ Development Server Addresses

ServiceAddressDescription
๐Ÿ–ฅ๏ธ Desktop AppAuto-launch windowDesktop client
๐Ÿ”Œ Backend Service APIhttp://localhost:32742Backend Gateway Service Nginx
๐Ÿ”‘ Casdoor Service APIhttp://localhost:8000Authentication Service Casdoor

๐Ÿ” Complete Deployment Verification

โœ… Step 1: Server Check

bash
# ๐Ÿ“Š Check Docker service status
docker compose ps

# ๐Ÿ” Verify API response
# Open in browser: http://{YOUR_SERVER_IP}:32742/api/rpa-auth/user/login-check (32742 is default port, modify if changed)
# If returns {"code":"900001","data":null,"message":"unauthorized"} then deployment is correct and connected

โœ… Step 2: Casdoor Service Check

bash
# ๐Ÿ” Verify Casdoor service
# Open http://localhost:8000 in browser
# Casdoor authentication page should appear

Follow-up Verification:

  • โœ“ Check client node status in web interface
  • โœ“ Create simple test task to verify execution

โ“ FAQ

<details> <summary><b>Q: Docker service fails to start?</b></summary>
bash
# ๐Ÿ” Check port usage
netstat -tulpn | grep :8080

# โœ… Check Docker status
docker --version
docker compose --version

# ๐Ÿ“‹ View detailed error logs
docker compose logs

Common Causes:

  • โŒ Ports occupied (8080, 3306, 6379)
  • โŒ Docker service not started
  • โŒ Insufficient resources (memory/disk space)
</details> <details> <summary><b>Q: Database connection failed?</b></summary>
bash
# ๐Ÿ“Š Check MySQL container status
docker compose ps mysql

# ๐Ÿ“ View MySQL logs
docker compose logs mysql

# ๐Ÿ”„ Restart database service
docker compose restart mysql
</details>
<details> <summary><b>Q: Python environment copy failed?</b></summary>
bash
# ๐Ÿ” Check Python installation path
where python  # Windows
which python  # Linux/macOS

# ๐Ÿ” Make sure to pass the Python executable file

โœ–๏ธ ./build.bat -p "C:\\Python313"
โœ”๏ธ ./build.bat -p "C:\\Python313\\python.exe"

Solutions:

  • โœ“ Ensure Python directory exists and is readable
  • โœ“ Run script with administrator privileges
  • โœ“ Check sufficient disk space
</details> <details> <summary><b>Q: Packaging script execution failed?</b></summary>
bash
# โœ… Check all dependencies in preparation phase are fully installed

# ๐Ÿ’พ Check disk space
dir  # Windows check available space
</details>
<details> <summary><b>Q: Client cannot connect to server?</b></summary>
bash
# ๐ŸŒ Check network connectivity
# Open the following URL in your browser to see if there's a response
# http://localhost:32742 can be replaced with your deployed server address+port
http://localhost:32742/api/rpa-auth/user/login-check

# ๐Ÿ›ก๏ธ Check firewall settings
# Windows: Control Panel > System and Security > Windows Defender Firewall
# Linux: ufw status

# โœ… Check server health status
curl http://localhost:32742/health

Common Causes:

  • โŒ Server not started
  • โŒ Firewall blocking
  • โŒ Network unreachable
  • โŒ Incorrect address in config file
</details> <details> <summary><b>Q: WebSocket connection failed?</b></summary>
bash
# ๐Ÿ”Œ Check WebSocket endpoint
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
     http://localhost:8080/ws

# ๐Ÿ” Check proxy settings
echo $http_proxy
echo $https_proxy

Solutions:

  • โœ“ Confirm server WebSocket service is running
  • โœ“ Check if proxy affects connection
  • โœ“ Verify firewall rules
</details>
<details> <summary><b>Q: Frontend build failed?</b></summary>
bash
# ๐Ÿงน Clear cache
pnpm store prune
rm -rf node_modules pnpm-lock.yaml

# ๐Ÿ“ฆ Reinstall
pnpm install

# โœ… Check Node.js version
node --version  # Requires 22+

Common Causes:

  • โŒ Node.js version not meeting requirements
  • โŒ Dependency version conflicts
  • โŒ Cache corruption
</details> <details> <summary><b>Q: pywinhook installation fails with swig.exe not found error?</b></summary>

Error Message:

error: Microsoft Visual C++ 14.0 is required
or
swig.exe not found

Solution Steps:

1๏ธโƒฃ Download SWIG

2๏ธโƒฃ Add to System Environment Variables

  • Add the directory containing swig.exe to PATH environment variable
  • For example: C:\swig\swigwin-4.1.1

3๏ธโƒฃ Verify Installation

bash
swig -version

4๏ธโƒฃ Reinstall pywinhook

bash
pip install pywinhook
</details>

๐Ÿ“ž Get Help

<div align="center">

Having issues? We're here to help!

</div>
ChannelLinkDescription
๐Ÿ“ง Technical Support[email protected]Contact technical team directly
๐Ÿ’ฌ Community DiscussionGitHub DiscussionsExchange ideas with community
๐Ÿ› Issue ReportGitHub IssuesSubmit bugs and feature requests
๐Ÿ“– Full DocumentationProject DocumentationView detailed usage documentation

๐ŸŽฏ Next Steps

<div align="center">

โœจ Congratulations on completing deployment! Now start your RPA automation journey โœจ

</div>
StepContentLink
1๏ธโƒฃ๐Ÿ“š Learn to UseRead User Guide to learn how to create RPA processes
2๏ธโƒฃ๐Ÿ”ง Component DevelopmentRefer to Component Development Guide to develop custom components
3๏ธโƒฃ๐Ÿค ContributeCheck Contributing Guide to participate in project development
4๏ธโƒฃ๐Ÿ“ฑ Production DeploymentRefer to Production Deployment Guide for production deployment

<div align="center">

๐ŸŽ‰ Deployment Complete!

You have successfully deployed AstronRPA server and client

Now you can start creating powerful RPA automation workflows!

Happy Automating! ๐Ÿค–โœจ

</div>