Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/azahel79/Spartans-gym/llms.txt

Use this file to discover all available pages before exploring further.

Spartans Gym is a full-stack gym management system built for real-world fitness businesses that need a single, cohesive tool to handle daily operations. The platform covers everything from checking in clients at the front desk and selling products at the point of sale, to tracking membership renewals, managing inventory, and viewing financial dashboards — all from a modern, responsive web interface with dark-mode support and CSV export capabilities.

User Roles

Spartans Gym ships with two distinct access roles so you can safely onboard front-desk staff without exposing sensitive financial data.

Admin

Full access to every module: dashboard analytics, financial transactions, plan configuration, user management, inventory, point of sale, and all reports.

Recepcionista

Scoped access to client registration, daily attendance tracking, and membership lookups — the tools a receptionist needs without administrative privileges.

Key Features

Dashboard

Visual analytics with revenue charts, active membership counts, and recent activity — powered by Recharts.

Reception

Fast client check-in flow for recording daily attendance linked to active memberships.

Clients

Full client profiles with membership history, photo uploads via Cloudinary, and status tracking.

Memberships

Create, renew, and expire memberships tied to configurable plans with flexible billing periods.

Point of Sale

Sell gym products with support for cash and card payments, receipt generation, and printable tickets.

Inventory

Track product stock levels, add items with optional Cloudinary images, and monitor low-stock alerts.

Transactions

Browse and filter the full financial history with date-range queries and CSV export.

Configuration

Manage membership plans, create receptionist accounts, and customise gym-wide settings from one place.

Tech Stack

Spartans Gym is a monorepo with two top-level directories: backend/ for the REST API and frontend-spartans-gym/ for the single-page application.
spartans-gym/
├── backend/                 # Express API + Prisma ORM + MySQL
├── frontend-spartans-gym/   # React SPA + Vite + Tailwind CSS
└── PRODUCTION_DEPLOY.md     # Full production deployment guide

Backend

Runtime

Node.js 20+ with TypeScript 5 compiled to dist/ via tsc. Entry point: dist/index.js.

Framework & ORM

Express 4 handles routing and middleware. Prisma 5 manages the schema and migrations against MySQL 8+.

Auth & Security

JSON Web Tokens (jsonwebtoken) for stateless authentication, bcryptjs for password hashing, and CORS restricted to ALLOWED_ORIGINS.

File Uploads

Cloudinary v2 with Multer for logo and product image uploads. Cloudinary credentials are optional for local development.

Frontend

UI Framework

React 19 with Vite 8 for near-instant HMR and optimised production builds. TypeScript throughout.

Styling

Tailwind CSS v4 via the official Vite plugin — utility-first styling with full dark-mode support.

State Management

Zustand 5 for lightweight global state. Axios for all API calls against the Express backend.

Data Visualisation

Recharts 3 for interactive dashboard charts. React Toastify for user-facing notifications.

Architecture Overview

The backend exposes a JSON REST API under the /api prefix. The frontend is a client-side rendered SPA that communicates exclusively through that API — there is no server-side rendering. In production the two services are deployed independently: the backend runs as a Node.js process (or Docker container) on any Node-compatible host, and the frontend is published as a static dist/ folder to any CDN or static host.
Both services require their own environment variables. Never share a single .env file between the backend and frontend — the backend uses server-side secrets (database credentials, JWT secret) that must never be exposed to the browser.

Build docs developers (and LLMs) love