Local testing environment for Spixi Mini Apps. Run the packed apps directly in your browser without needing the full Spixi client.
Local test harness for Spixi Mini Apps. This repository provides a lightweight browser-hosted environment to open and debug mini apps without the full Spixi client. It includes a small Node.js server for serving the hub and a browser-side Dev Server simulator for WebSocket/MQTT behaviour.
- Install Node.js (LTS) if you don't have it. On Windows you can use
winget:
winget install --id OpenJS.NodeJS.LTS -e --accept-package-agreements --accept-source-agreements- From the repo root:
cd C:\Users\User\Spixi-Test-Enviroment
npm install
npm startIf PowerShell blocks npm because scripts are disabled, use the included helper:
# Run a .cmd wrapper that uses npm.cmd (avoids PowerShell script policy issues)
.\scripts\npm-install.cmd
npm startYou can also use the wrapper to start the server safely from PowerShell:
.\scripts\npm-start.cmd- Open the main UI:
http://localhost:8000 - Dev server (to load a specific app):
http://localhost:8081/?app=<appId>(example:?app=com.baracuda.spixi.pong)
- See
TECHNICAL_GUIDE.mdfor a compact technical guide and pointers to server APIs, the packer, and CI smoke tests.
- Pack an app (creates packed output):
node pack-app.js ./apps/com.baracuda.spixi.pong ./packed
Or pack from the hub UI: Open `http://localhost:8000`, find an app card, then click the `📦 Pack` button — this calls the `POST /api/pack` endpoint and triggers a download of the resulting ZIP from the browser.- Run the server in foreground (shows logs):
npm start
## Repack all apps
If you update app content and want to repack all apps at once, there are helpers:
PowerShell:
```powershell
# uses Node to run pack-app.js for each folder under apps/
.\scripts\pack-all.ps1CMD (Windows) or cross-shell:
.\scripts\pack-all.cmd
# or using npm script:
npm run pack-allThis saves each app's .zip, .spixi, and *.png (if present) into packed/.
### Save and reuse git commit/push workflow
To make commit + push repeatable you can run a local helper script that stages, commits,
rebases with `origin/main`, and pushes the changes.
- Windows PowerShell (recommended):
```powershell
# Prompt: Provide commit message
npm run commit-and-push:ps1 -- "feat: update UI"
- POSIX (Linux/macOS/WSL) or Git Bash on Windows:
npm run commit-and-push -- "feat: update UI"Tip: If you need to force push (careful, this rewrites history), pass -- --force to the bash script or -Force to the PowerShell script.
Example:
npm run commit-and-push -- "chore: tweak README" --force- View server logs (if started by helper script):
Get-Content 'C:\Users\User\Spixi-Test-Enviroment\server_temp.log' -Wait -Tail 200- The hub (
index.html) contains a Developer Tools section with controls to start the in-browser Dev Server (simulated WebSocket/MQTT) and to configure ports used by the simulator. - Use the Start button in the Developer Tools section to enable the browser-side simulator.
Apps are located under apps/ — each app follows the structure apps/<appId>/app/ with its index.html.
Example app IDs in this repo:
com.baracuda.spixi.pongcom.ixilabs.spixi.tictactoe
Open an app directly in the hub or use the dev server URL shown above.
- This environment simulates some SDK features; full functionality (multiplayer networking, native device access) requires the real Spixi client and live infrastructure.
- The Node.js server is intentionally small — feel free to modify
server.jsto add features or change routes.
If you'd like changes or improvements, open a PR or issue.
Created for local testing of Spixi Mini Apps SDK
- Mobile Browsers: Full support (touch controls work)