Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt

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

This guide walks you through cloning HealtyHelp, wiring up all required services, and reaching a fully working local instance with an admin account ready to use.
The Express server enforces two rate-limit tiers in production: 500 requests per 15 minutes for all /api/* routes, and a stricter 20 requests per 15 minutes specifically on /api/auth/login. In development mode the login limit is relaxed to 200 requests per 15 minutes. Keep this in mind when running automated tests or scripts against the local server.

1

Prerequisites

Make sure the following are available on your machine before you begin:
RequirementNotes
Node.js 18+Required by both client and server. Check with node -v.
MongoDBMongoDB Atlas free tier works out of the box, or run a local mongod instance.
Groq API keyRegister at console.groq.com and create a key. Used to power NutriBot with LLaMA 3.3 70B.
Google OAuth credentials (optional)Required only if you want Google Sign-In. Create an OAuth 2.0 client in the Google Cloud Console.
Cloudinary account (optional)Required only if you want image upload and moderation for recipe reviews. Register at cloudinary.com.
Resend account (optional)Required for password-reset emails and admin invitation emails. Register at resend.com and create an API key.
2

Clone the Repository

git clone https://github.com/JuanSebasSV/healtyhelp.git
cd healtyhelp
The repository uses a monorepo layout:
healtyhelp/
├── client/   ← React 19 + Vite frontend
└── server/   ← Express 5 + MongoDB backend
3

Install Server Dependencies

cd server
npm install
This installs Express 5, Mongoose, Groq SDK, Passport, Cloudinary, Helmet, and all other backend packages defined in server/package.json.
4

Install Client Dependencies

cd ../client
npm install
This installs React 19, React Router v7, Axios, jsPDF, react-toastify, and the Vite build toolchain.
5

Configure Server Environment Variables

Create a .env file in the server/ directory. The table below covers every variable the server reads:
# server/.env

# ── MongoDB ────────────────────────────────────────────────────────────────
MONGO_URI=mongodb+srv://<user>:<password>@cluster0.mongodb.net/healtyhelp?retryWrites=true&w=majority

# ── JWT ───────────────────────────────────────────────────────────────────
JWT_SECRET=your-very-long-random-secret-string
JWT_EXPIRE=7d

# ── Groq AI (NutriBot) ────────────────────────────────────────────────────
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# ── CORS / URLs ───────────────────────────────────────────────────────────
FRONTEND_URL=http://localhost:5173
BACKEND_URL=http://localhost:5000
PORT=5000

# ── Google OAuth (optional) ───────────────────────────────────────────────
GOOGLE_CLIENT_ID=xxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxx

# ── Cloudinary (optional, image uploads) ─────────────────────────────────
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=000000000000000
CLOUDINARY_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxx

# ── Resend (optional, transactional email) ────────────────────────────────
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EMAIL_FROM=noreply@yourdomain.com
CONTACT_EMAIL=support@yourdomain.com

# ── Super-admin bootstrap (used by scripts/initSuperAdmin.js) ────────────
SUPER_ADMIN_NAME=Admin
SUPER_ADMIN_EMAIL=admin@example.com
SUPER_ADMIN_PASSWORD=ChangeMe123!

# ── Runtime mode ──────────────────────────────────────────────────────────
NODE_ENV=development
Variable reference:
VariableRequiredDescription
MONGO_URIMongoDB connection string. Atlas or local (mongodb://localhost:27017/healtyhelp).
JWT_SECRETSecret key used to sign and verify JWTs. Use a random string of at least 32 characters.
JWT_EXPIREToken lifetime passed to jsonwebtoken (e.g. 7d, 24h).
GROQ_API_KEYAPI key from console.groq.com. Enables NutriBot.
FRONTEND_URLOrigin allowed by the CORS policy. Must match exactly where the Vite dev server runs.
BACKEND_URLFull URL of the Express server. Used by Passport as the Google OAuth callback base.
PORTPort the Express server listens on. Defaults to 5000 if unset.
GOOGLE_CLIENT_IDOptionalGoogle OAuth 2.0 client ID. Required for Google Sign-In.
GOOGLE_CLIENT_SECRETOptionalGoogle OAuth 2.0 client secret. Required for Google Sign-In.
CLOUDINARY_CLOUD_NAMEOptionalCloudinary cloud name for image uploads.
CLOUDINARY_API_KEYOptionalCloudinary API key.
CLOUDINARY_API_SECRETOptionalCloudinary API secret.
RESEND_API_KEYOptionalAPI key from resend.com. Required for password-reset and admin invitation emails.
EMAIL_FROMOptionalSender address used in all outgoing emails (e.g. noreply@yourdomain.com).
CONTACT_EMAILOptionalDestination address for contact-form submissions. Falls back to healtyhelp@gmail.com if unset.
SUPER_ADMIN_EMAILOptionalEmail for the initial super-admin account (used by initSuperAdmin.js).
SUPER_ADMIN_PASSWORDOptionalPassword for the initial super-admin account. Change immediately after first login.
SUPER_ADMIN_NAMEOptionalDisplay name for the initial super-admin account.
NODE_ENVOptionalSet to production to enable strict rate limiting (20 login attempts/15 min).
6

Configure Client Environment Variables

Create a .env file in the client/ directory:
# client/.env
VITE_API_URL=http://localhost:5000/api
VITE_API_URL is the base URL that Axios uses for every API request. It must point to the running Express server. The variable is prefixed with VITE_ so that Vite exposes it to the browser bundle at build time via import.meta.env.VITE_API_URL.
7

Start the Server

From the server/ directory:
npm run dev
This runs nodemon server.js, which watches for file changes and auto-restarts. On startup you should see:
✅ MongoDB conectado
🚀 Servidor corriendo en puerto 5000
📍 Frontend URL: http://localhost:5173
📡 API URL: http://localhost:5000/api
🔐 Google OAuth: http://localhost:5000/api/auth/google
The server also seeds the Terms & Conditions collection on first run if it is empty.
8

Start the Client

In a separate terminal, from the client/ directory:
npm run dev
Vite starts the development server and prints a local URL:
VITE v7.x.x  ready in NNN ms

➜  Local:   http://localhost:5173/
➜  Network: use --host to expose
9

Initialize the Super-Admin Account

Before you can access the admin panel, run the bootstrap script from the server/ directory. The script loads server/.env via dotenv and must be executed with server/ as the working directory so that dotenv can locate the .env file. It reads SUPER_ADMIN_EMAIL, SUPER_ADMIN_NAME, and SUPER_ADMIN_PASSWORD from your .env and creates a user with role: 'admin' and isSuperAdmin: true:
cd server
node scripts/initSuperAdmin.js
Expected output:
✅ Conectado a MongoDB
✅ Superadmin creado exitosamente
📧 Email: admin@example.com
⚠️  IMPORTANTE: Cambia la contraseña inmediatamente después del primer login
If you run the script a second time it exits safely without creating a duplicate:
⚠️  Superadmin ya existe. No se creará duplicado.
Change the super-admin password immediately after your first login. Never commit SUPER_ADMIN_PASSWORD to version control.
10

Open the App and Log In

Navigate to http://localhost:5173 in your browser.
  • Regular users can register via /registro or sign in with Google.
  • Admin login: go to /login and use the super-admin credentials you set in server/.env.
  • After login, the admin panel is available at /admin.
You’re now running HealtyHelp locally with the full recipe catalog, NutriBot chatbot, nutrition tracking, and admin dashboard all functional.

What’s Next?

Architecture

Understand how the React frontend, Express API, MongoDB models, and third-party integrations are structured.

API Reference

Explore the complete set of REST endpoints for auth, recipes, consumos, chat, and admin operations.

Build docs developers (and LLMs) love