The fastest path to a working local environment is to run the backend directly with Node.js and start the frontend dev server with Vite. You will have the full application — including a seeded admin account and four default membership plans — running atDocumentation 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.
http://localhost:5173 in under ten minutes. If you prefer to containerise the backend, a Docker alternative is covered at the end of this page.
Prerequisites
Before you begin, make sure the following are available on your machine:| Requirement | Version | Notes |
|---|---|---|
| Node.js | 20 or higher | Used by both backend and frontend |
| MySQL | 8 or higher | Must be running before you start the backend |
| Docker Desktop | Optional | Only needed for the Docker backend alternative |
| Cloudinary account | Optional | Only needed if you want to test image uploads locally |
Local Setup
Configure the backend environment
Copy the example file and fill in your local MySQL password:Open
backend/.env and set the variables. A working local configuration looks like this:Replace
TU_PASSWORD with your actual MySQL root (or user) password. Cloudinary variables can be left blank while developing locally — image uploads will simply be unavailable.Install backend dependencies and set up the database
From the
spartans-gym/ root, run all backend setup commands in sequence:prisma:generate— builds the Prisma Client from your schema.prisma:migrate— creates thegym_databaseschema and applies all migrations.seed— creates the default admin user and four starter membership plans (Mensual, Trimestral, Semestral, Anual).
Start the backend development server
Still inside The server will be available at You should receive a JSON response with
backend/, start the API with hot-reload via nodemon:http://localhost:3000. Verify it is healthy:"success": true.Configure the frontend environment
Open a new terminal, navigate back to the monorepo root, then set up the frontend:Create
frontend-spartans-gym/.env with the following content:If you are running the backend Docker container on port
3001, change this to VITE_API_URL=http://localhost:3001/api instead.Install frontend dependencies and start Vite
http://localhost:5173.Verify Everything Is Working
Once logged in, confirm the following baseline functionality:- The Dashboard loads and shows charts.
- The Clients module is accessible.
- The Configuration → Plans module lists the four seeded plans: Mensual, Trimestral, Semestral, and Anual.
GET http://localhost:3000/api/healthreturns{ "success": true }.
Docker Backend Alternative
If you prefer to run the backend inside a container while keeping MySQL on your host machine, use the following commands from thespartans-gym/ root:
Build the Docker image
Dockerfile produces a lean node:20-alpine image. It runs npx prisma migrate deploy automatically on container start before launching npm start.Update DATABASE_URL for Docker networking
When MySQL is running on your host and the backend is inside Docker,
localhost inside the container points to the container itself — not your machine. Update backend/.env:Run the container
Map container port Test the containerised backend:
3000 to host port 3001 (in case 3000 is already in use):Available URLs
| Service | URL |
|---|---|
| Frontend (Vite) | http://localhost:5173 |
| Backend API (Node) | http://localhost:3000/api/health |
| Backend API (Docker) | http://localhost:3001/api/health |
| Prisma Studio | Run npm run prisma:studio inside backend/ |