This repository is currently on the v2.0.0 black and red liquid-glass release.
Mobile-first fitness app that scans a gym machine photo and returns technique coaching with an animated video lesson, audio cues, haptic feedback, scan history, and payment method capture.
- React mobile UI served from
public/app.js - Node.js API in
server/index.js - SQLite database using Node's built-in
node:sqlite - Seeded machine technique library with coaching steps and safety cues
- Photo upload API with recognition service in
server/recognition.js - Audio coaching through the browser Speech Synthesis API
- Haptics through the mobile Vibration API
- Demo-safe payment method storage and membership plans
- Optional Stripe SetupIntent endpoint if
STRIPE_SECRET_KEYis configured - PWA manifest and service worker
- Free browser-side CLIP vision assist through Hugging Face Transformers.js
This project uses no installed npm packages because this environment has Node but no package manager on PATH. The browser loads React, Babel, and Lucide icons from CDN, so the first frontend load needs internet access.
node server/index.jsThen open:
http://localhost:4173
GET /api/health
GET /api/equipment
GET /api/equipment/:id
GET /api/equipment/:id/audio
POST /api/scan
GET /api/scans
GET /api/payments/methods
POST /api/payments/methods
POST /api/payments/setup-intent
POST /api/memberships
POST /api/scan expects JSON:
{
"image": "data:image/jpeg;base64,...",
"filename": "leg-press.jpg",
"hint": "leg press"
}The local payment form is intentionally demo-safe. It does not store full card numbers. It stores brand, last 4, expiry, provider, and a demo token in SQLite.
For production payments, use Stripe Elements on the frontend and configure STRIPE_SECRET_KEY on the server. The included /api/payments/setup-intent endpoint is ready for that backend flow.
The app now includes a free browser-side zero-shot image classifier adapter using Hugging Face Transformers.js and Xenova/clip-vit-base-patch32. It compares the uploaded photo against the seeded gym machine labels, then uses the backend scanner as a reliable fallback if the model download is slow or unavailable.
For production-grade recognition, train or fine-tune a gym-machine classifier and replace the adapter/fallback path:
- Upload the photo to the backend exactly as the app does now.
- Send the image buffer to a vision provider or custom model.
- Return the detected machine slug and confidence.
- Keep the existing equipment database response shape so the frontend does not need to change.