Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 1.88 KB

API_AND_SETUP.md

File metadata and controls

62 lines (49 loc) · 1.88 KB

API and System Setup

Manual Startup

If you are developing or troubleshooting, you may want to run the components manually instead of using the compiled executable. Nearcade requires two separate processes to run simultaneously. These are the Python Input Driver and the Node.js Web Server.

Manual Setup on Linux

Linux requires root privileges to inject virtual controllers directly into the kernel via uinput.

Terminal 1 for the Input Driver:

cd Nearcade
pip3 install -r bin/requirements-linux.txt
sudo python3 src/sidecar/input_driver.py

Terminal 2 for the Web Server:

cd Nearcade
npm install
npm run electron

Manual Setup on Windows

Windows requires the ViGEmBus driver to emulate controllers.

  1. Download and install the ViGEmBus Driver.
  2. Ensure you have Python 3 and Node 18 or newer installed.

Terminal 1 for the Input Driver:

cd Nearcade
pip install -r bin/requirements-windows.txt
python src/sidecar/input_driver.py

Terminal 2 for the Web Server:

cd Nearcade
npm install
npm run electron

Environment Configuration

To prevent hardcoding sensitive tokens, Nearcade relies on an environment file located in your root directory.

Create a file named .env and populate it with your specific keys.

CF_TOKEN=your_cloudflare_tunnel_token
CUSTOM_URL=[https://play.yourdomain.com](https://play.yourdomain.com)
PORT=3000

Internal Express API Endpoints

The Nearcade Node server exposes local HTTP POST endpoints to control the backend dynamically.

Audio Routing via /api/force-route

  • Payload: { "nodeProperty": "target_node_id" }
  • Action: Forces PipeWire to dynamically link the specific target node into the NearsecVirtualCapture sink.

Process Management via /api/restart-game

  • Action: Restarts the capture sequence.

This project uses artificial intelligence large language models for code generation and structure planning.