Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Blackterz2/Proyecto_5to_Semestre/llms.txt

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

This guide walks you through getting a fully functional Blackterz instance running on your local machine. By the end you will have the Express server running on port 3000, the fitness_app MySQL database seeded with 64 exercises and 15 muscle groups, and the Vanilla JS frontend accessible in your browser.
1
Clone the repository and install dependencies
2
Clone the project from GitHub and install all Node.js dependencies in one go:
3
git clone https://github.com/Blackterz2/Proyecto_5to_Semestre.git && cd Proyecto_5to_Semestre && npm install
4
This installs all packages defined in package.json, including Express, mysql2, bcrypt, jsonwebtoken, multer, nodemailer, helmet, express-rate-limit, and dotenv.
5
Create the MySQL database
6
Connect to your MySQL server and create the fitness_app database:
7
CREATE DATABASE fitness_app;
8
The database must be named fitness_app. The application will not create it automatically — if the name does not match what you set in DB_NAME, the connection will fail.
9
Seed the exercise catalog
10
Load the base schema and the 64-exercise catalog (15 muscle groups, 188 exercise-muscle relationships) into fitness_app:
11
mysql -u root -p fitness_app < seed.sql
12
When prompted, enter your MySQL root password. This populates the grupos_musculares, ejercicios, and ejercicios_grupos_musculares tables.
13
Run database migrations in order
14
The schema has evolved across development milestones. Run each migration file from the docs/ folder in the exact order listed below — skipping or reordering will cause column conflicts:
15
mysql -u root -p fitness_app < docs/migracion-activo.sql
mysql -u root -p fitness_app < docs/migracion-avatar.sql
mysql -u root -p fitness_app < docs/migracion-hito13.sql
mysql -u root -p fitness_app < docs/migracion-gif-url.sql
mysql -u root -p fitness_app < docs/migracion-hito17.sql
mysql -u root -p fitness_app < docs/migracion-hito17-parte2.sql
mysql -u root -p fitness_app < docs/migracion-dropear-notas.sql
mysql -u root -p fitness_app < docs/migracion-dropear-columnas.sql
mysql -u root -p fitness_app < docs/migracion-drop-estado.sql
mysql -u root -p fitness_app < docs/migracion-password-resets.sql
mysql -u root -p fitness_app < docs/migracion-rutinas-recomendadas.sql
16

What each migration does

FileWhat it adds
migracion-activo.sqlactivo column on usuarios (soft delete)
migracion-avatar.sqlavatar_url column on usuarios (profile photo)
migracion-hito13.sqlactiva column on rutinas (soft delete for routines)
migracion-gif-url.sqlgif_url column on ejercicios (video integration)
migracion-hito17.sqlOnboarding columns on usuarios: nivel_experiencia, peso_actual, estatura_cm, onboarding_completado
migracion-hito17-parte2.sqlsexo column on usuarios
migracion-dropear-notas.sqlDrops unused notas columns from ejercicios_rutinas, rutinas, sesion_series
migracion-dropear-columnas.sqlDrops 6 redundant columns from sesion_ejercicios and sesion_series
migracion-drop-estado.sqlDrops estado from sesiones_entrenamiento (only completed sessions are persisted)
migracion-password-resets.sqlCreates password_resets table for email-based recovery tokens
migracion-rutinas-recomendadas.sqlAdds es_recomendada column to rutinas (flags onboarding-assigned routines)
17
Configure environment variables
18
Copy the example file and fill in your credentials:
19
cp .env.example .env
20
Open .env in your editor and replace the placeholder values. Here is the full content of .env.example as a reference:
21
# ============================================================
# CONFIGURACIÓN DEL SERVIDOR
# ============================================================
# Puerto donde va a escuchar el servidor Express.
# Por defecto: 3000
PORT=3000

# ============================================================
# CONEXIÓN A BASE DE DATOS MySQL
# ============================================================
# Dirección del servidor MySQL (localhost si está en tu máquina)
DB_HOST=localhost

# Puerto donde corre MySQL (el default de MySQL es 3306)
DB_PORT=3306

# Usuario con acceso a la base de datos
DB_USER=root

# Contraseña del usuario (dejalo vacío si no tenés contraseña)
DB_PASSWORD=

# Nombre de la base de datos que vas a usar
DB_NAME=blackterz


# Entorno de ejecución: 'production' activa límites estrictos
# de seguridad (rate limiting). Dejar vacío o 'development'
# para trabajar localmente sin restricciones agresivas.
NODE_ENV=development


# JWT
JWT_SECRET=mi_clave_secreta_cambiame_en_produccion
22
The .env.example above covers the minimal setup. For email password recovery and exercise video support, also set EMAIL_HOST, EMAIL_PORT, EMAIL_USER, EMAIL_PASS, APP_URL, and ASCENDAPI_KEY. See the Configuration page for a full variable reference.
23
Start the server
24
npm start
25
When the server boots successfully you will see:
26
========================================
  🚀 Servidor corriendo en el puerto 3000
  📡 Healthcheck: http://localhost:3000/api/health
  🖥️  Frontend:     http://localhost:3000/
========================================
27
Verify the installation
28
Confirm the server and database connection are healthy:
29
curl http://localhost:3000/api/health
30
A successful response looks like:
31
{"status":"ok","db":"conectada"}
32
Then open your browser and navigate to http://localhost:3000 to reach the Blackterz frontend. Register a new account, complete the onboarding form, and you will be automatically assigned a starter routine.
Development mode: Run npm run dev instead of npm start to enable Node.js native file watching (node --watch src/server.js). The server will automatically restart whenever you save a change to any source file — no need to manually stop and restart.
Auth rate limit: The /api/auth/register and /api/auth/login endpoints are protected by express-rate-limit with a 15-minute sliding window. In development (NODE_ENV is anything other than production) the limit is 100 attempts per 15 minutes per IP, so it will not interfere with local testing. In production (NODE_ENV=production) this drops to 10 attempts per 15 minutes to defend against brute-force attacks.

Build docs developers (and LLMs) love