Skip to content

subsubl/Spixi-Test-Enviroment

Repository files navigation

Mini Apps Test Environment

Local testing environment for Spixi Mini Apps. Run the packed apps directly in your browser without needing the full Spixi client.

Spixi Mini Apps — Test Environment

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.

Quick Start (Windows)

  • 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 start

If 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 start

You 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)

Technical Guide & API

  • See TECHNICAL_GUIDE.md for a compact technical guide and pointers to server APIs, the packer, and CI smoke tests.

Common Commands

  • 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.ps1

CMD (Windows) or cross-shell:

.\scripts\pack-all.cmd
# or using npm script:
npm run pack-all

This 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

Developer Tools

  • 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

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.pong
  • com.ixilabs.spixi.tictactoe

Open an app directly in the hub or use the dev server URL shown above.

Notes

  • 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.js to add features or change routes.

Contributing

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors