|
| 1 | +# VPS Web Portal (Tandem Engine Examples) |
| 2 | + |
| 3 | +This project contains a highly-polished, multi-page showcase that connects directly to the `tandem-engine` running as a headless server on a Linux VPS. It provides a secure UI wrapper and a Node/Express backend that handles reverse-proxying and authentication, safeguarding the engine's open ports from the public internet. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- A Linux VPS (Ubuntu/Debian recommended) |
| 8 | +- Node.js (v18+) |
| 9 | +- PM2 (optional, for running the project in the background) |
| 10 | +- The [Tandem Engine CLI](https://github.com/your-org/tandem) |
| 11 | + |
| 12 | +## 1. Setup the Tandem Engine |
| 13 | + |
| 14 | +First, install the tandem engine directly on your VPS. Provide it access to local AI providers or proxies as well as MCP components. |
| 15 | + |
| 16 | +Generate a secure Server Token. Do NOT lose this. |
| 17 | + |
| 18 | +```bash |
| 19 | +tandem-engine token generate |
| 20 | +``` |
| 21 | + |
| 22 | +_(Copy the generated UUID. We'll need it later)._ |
| 23 | + |
| 24 | +Start the headless engine running in the background. It will bind to `localhost:39731` by default. |
| 25 | + |
| 26 | +```bash |
| 27 | +nohup tandem-engine serve --headless & |
| 28 | +``` |
| 29 | + |
| 30 | +_(Alternatively, run it using a robust service manager like SystemD)._ |
| 31 | + |
| 32 | +## 2. Setup the Web Portal |
| 33 | + |
| 34 | +Clone this repository or copy the `vps-web-portal` directory to your VPS. |
| 35 | + |
| 36 | +Navigate to the project directory and install the required dependencies: |
| 37 | + |
| 38 | +```bash |
| 39 | +cd vps-web-portal |
| 40 | +npm install |
| 41 | +``` |
| 42 | + |
| 43 | +### Environment Configuration |
| 44 | + |
| 45 | +Create a `.env` file in the root of the portal directory: |
| 46 | + |
| 47 | +```env |
| 48 | +# The port the Node/Express proxy will listen on (Publicly accessible) |
| 49 | +PORT=80 |
| 50 | +
|
| 51 | +# The Secret Key used to login to the secure Web Portal URL |
| 52 | +VITE_PORTAL_KEY=my_secret_password_123 |
| 53 | +
|
| 54 | +# The Token generated by 'tandem-engine token generate' in Step 1 |
| 55 | +VITE_ENGINE_TOKEN=your-generated-tandem-token-here |
| 56 | +
|
| 57 | +# (Optional) Engine local address |
| 58 | +VITE_TANDEM_ENGINE_URL=http://127.0.0.1:39731 |
| 59 | +``` |
| 60 | + |
| 61 | +## 3. Build & Run |
| 62 | + |
| 63 | +Build the Vite React frontend for production: |
| 64 | + |
| 65 | +```bash |
| 66 | +npm run build |
| 67 | +``` |
| 68 | + |
| 69 | +Start the Node.js Express server to host the application. We recommend using PM2 to keep the server alive forever: |
| 70 | + |
| 71 | +```bash |
| 72 | +npm install -g pm2 |
| 73 | +pm2 start npm --name "tandem-portal" -- run start:server |
| 74 | +``` |
| 75 | + |
| 76 | +_(Alternatively, you can just run `npm run start:server` directly for testing)._ |
| 77 | + |
| 78 | +## Usage |
| 79 | + |
| 80 | +Visit your server's public IP or Domain name in your browser (e.g., `http://your-server-ip:80`). |
| 81 | +You will be greeted by the Login portal. Enter the `VITE_PORTAL_KEY` you configured earlier to unlock the dashboards. |
| 82 | + |
| 83 | +### Included Dashboards |
| 84 | + |
| 85 | +1. **Deep Research:** Unleash an agent to scour the public web and answer heavy research questions. |
| 86 | +2. **Parallel Swarm:** Submit an idea and watch 3 distinct personas debate its merits simultaneously using the Parallel APIs. |
| 87 | +3. **Interactive RPG:** An AI Text Adventure game demonstrating the `Questions API` over Streaming SSE. |
| 88 | +4. **Second Brain:** Grant an agent local system context using Local MCP (Model Context Protocol). |
| 89 | +5. **Connectors:** Setup Slack, Discord, or Telegram bots so your team can @ the engine directly. |
| 90 | + |
| 91 | +## Security Note |
| 92 | + |
| 93 | +**Never** expose port `39731` to `0.0.0.0` or disable the firewall on a public VPS. Only the Reverse Proxy (this portal) should converse with the background Tandem engine locally, proxying authenticated REST and SSE requests. |
0 commit comments