Use this file to discover all available pages before exploring further.
SparkyFitness ships a Docker-based development environment that brings up the frontend, backend, and PostgreSQL database with a single command and live-reloading on every file change. If you prefer to run services directly on your machine, a local pnpm workflow is also supported. Either way, the steps below get you from a fresh clone to a running application in minutes.
If Docker is running on a remote machine, update SPARKY_FITNESS_FRONTEND_URL in .env to match that machine’s IP or hostname.
5
Start the development stack
./docker/docker-helper.sh dev up
The first run pulls or builds images; subsequent starts are much faster.
The docker-helper.sh script is the recommended way to manage every lifecycle operation — starting, stopping, viewing logs, rebuilding, and cleaning. Run ./docker/docker-helper.sh help at any time to see all available commands.
The ./docker/docker-helper.sh script wraps Docker Compose with validation and convenience commands:
# Start development environment (live reloading)./docker/docker-helper.sh dev up# Start production environment (optimised builds)./docker/docker-helper.sh prod up# Stop all services./docker/docker-helper.sh down# View logs for all services./docker/docker-helper.sh logs# View logs for a specific service./docker/docker-helper.sh logs backend# Rebuild all images./docker/docker-helper.sh build# Restart all services (or a specific one)./docker/docker-helper.sh restart./docker/docker-helper.sh restart frontend# Remove all containers, networks, and volumes./docker/docker-helper.sh clean# Show all available commands./docker/docker-helper.sh help
SPARKY_FITNESS_DB_HOST=localhostSPARKY_FITNESS_DB_PORT=5432SPARKY_FITNESS_DB_NAME=sparkyfitness_dbSPARKY_FITNESS_DB_USER=sparkySPARKY_FITNESS_DB_PASSWORD=your_password# App DB user (limited privileges, used at runtime)SPARKY_FITNESS_APP_DB_USER=sparky_appSPARKY_FITNESS_APP_DB_PASSWORD=your_app_password
Application settings
PORT=3010NODE_ENV=developmentBETTER_AUTH_SECRET=your_better_auth_secret_hereSPARKY_FITNESS_API_ENCRYPTION_KEY=<64-char hex string># Set this to your machine's address when running Docker remotelySPARKY_FITNESS_FRONTEND_URL=http://localhost:8080
SparkyFitness uses Jest / Vitest for JavaScript and TypeScript testing across the frontend, backend, and mobile packages, and pytest for the Garmin microservice.
# Frontend (Vite + React) — from SparkyFitnessFrontend/pnpm test # Watch modepnpm test:ci # Single run with coverage# Backend (Node.js + Express) — from SparkyFitnessServer/pnpm test # Watch modepnpm test:ci # Single run with coverage# Mobile (React Native + Expo) — from SparkyFitnessMobile/npm run test:run # Single runnpm run test:ci # Single run with coverage# Garmin microservice (Python) — from SparkyFitnessGarmin/pytest --cov=. --cov-report=html
CI runs on pull requests and pushes to main using path-based change detection — only the affected component’s tests execute. Coverage reports are uploaded as build artifacts and retained for seven days.
Stop the conflicting process or adjust the port in .env.
Docker permission errors
Ensure your user is in the docker group:
sudo usermod -aG docker $USER# Log out and back in for the change to take effect
Database connection failures
Verify that PostgreSQL is running and that the credentials in .env exactly match what was used when creating the database user. For the Docker stack, ensure the db service started successfully: