Developer Onboarding for XrayUI (Asuswrt‐Merlin) - DanielLavrushin/asuswrt-merlin-xrayui GitHub Wiki
Welcome! This guide will help you set up a development environment for the XrayUI project and run it locally (with your router as the target). It’s intended for developers looking to contribute to the XrayUI repository or test changes on their own Asuswrt-Merlin router. The instructions assume you have some experience with JavaScript/Vue and are comfortable with basic router or embedded Linux tasks.
Prerequisites
- Development OS: You can use
Windows
,Linux
, ormacOS
for development – the build tools (Node.js, npm, etc.) work on all of these. The target router runs a Linux-based OS (Asuswrt-Merlin), so keep that in mind when handling files. - Line Endings (Important!): Ensure all project files, especially shell scripts (*.sh), use
LF
(Unix) line endings instead ofCRLF
(Windows). Windows editors often useCRLF
by default, which can break shell scripts on the router. If you’re on Windows, configure your editor (e.g., VS Code) to save withLF
. - Node.js and
npm
: Install Node.js (latest LTS version recommended, e.g. Node 18+). Node.js must be installed before running any project commands. This project uses modern JavaScript tools, so having an up-to-date Node.js is important. - Code Editor: While optional, it’s recommended to use an editor like Visual Studio Code (
vscode
). It provides good integration with Node/Vue projects. If using VS Code, double-check the EOL (End-of-Line) settings as noted above to avoid Windows line ending issues. - Git: You’ll need Git to clone the repository and manage changes. Any recent Git version will do.
- You will need some sync file between your dev environment and the router. Ensure you install
opkg install openssh-sftp-server
.
Clone the Repository
git clone https://github.com/DanielLavrushin/asuswrt-merlin-xrayui.git
cd asuswrt-merlin-xrayui
Environment Setup
- Create a
.env
file in the project root:
SFTP_ROUTER=<router_ip_or_hostname>
SFTP_USERNAME=<router_username>
SFTP_PASSWORD=<router_password>
- On the router, install the SFTP server:
opkg install openssh-sftp-server
Install & Run
- Install dependencies:
npm install
- Start development build & watch for changes:
npm run watch
This command builds the project in development mode and automatically syncs the files to the router via SFTP.
That’s it! With these steps, you’re all set to work with XrayUI. Any code change will trigger a rebuild and sync to your router, so just refresh the router’s interface to see your updates.