Gestor Deportivo reads all runtime configuration from a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/gestor-backend/llms.txt
Use this file to discover all available pages before exploring further.
.env file. This page documents every supported variable, explains where the file must be placed, and provides step-by-step guides for generating the credentials required by Gmail and Google Cloud Storage.
.env File Location
Place your.env file in the root of the project — the same directory that contains package.json — not inside the src/ folder. The dotenv package is initialised by src/config.js at startup and resolves paths relative to the working directory from which the Node process was launched.
Environment Variables
Server
The port on which the Express server listens. Defaults to
3000 when the variable is absent or empty, as defined in src/index.js.Authentication
The secret used to sign and verify JSON Web Tokens. Choose a long, random string (at least 32 characters). All tokens signed with this value are invalidated if it changes, which forces all logged-in users to re-authenticate.
Database
The full MongoDB connection string used by Mongoose to connect to your database. Supports both local instances and hosted services such as MongoDB Atlas.
Email (Nodemailer)
Gestor Deportivo sends transactional emails for account verification and password recovery using Nodemailer with a Gmail transport. Both variables must be set for email delivery to work.The Gmail address from which verification and recovery emails are sent.
A Gmail App Password — a 16-character application-specific password generated from your Google Account settings. This is not your personal Gmail login password.See Gmail App Password Setup below for step-by-step instructions.
Google Cloud Storage
Team logos and player photos are uploaded to a Google Cloud Storage bucket. All four variables below must be populated for image uploads to succeed.The name of the Google Cloud Storage bucket where uploaded images are stored.
The OAuth 2.0 Client ID issued by Google Cloud Console for your project.
The OAuth 2.0 Client Secret paired with
CLIENT_ID.The URL of your frontend application. Used as the redirect URI in the Google OAuth 2.0 flow so that tokens are returned to the correct origin after authentication.
Gmail App Password Setup
Google requires 2-Step Verification to be enabled before you can create an App Password. Follow these steps:Enable 2-Step Verification
Go to myaccount.google.com/security and enable 2-Step Verification on the Gmail account you intend to use for sending emails.
Open App Passwords
In the same Security page, search for App Passwords (you may need to scroll down or use the search bar). Click on it.
Create a new App Password
Select Mail as the app and Other (Custom name) as the device. Enter a name like
Gestor Deportivo, then click Generate.Copy the generated password
Google will display a 16-character password in four groups of four letters (e.g.,
abcd efgh ijkl mnop). Copy it immediately — it will not be shown again.If you see an
Invalid login or Username and Password not accepted error at startup, double-check that 2-Step Verification is active and that you are using the App Password — not your regular Gmail password.Google Cloud Storage Setup
Create a Google Cloud project
Visit console.cloud.google.com, create a new project (or select an existing one), and note the Project ID.
Enable the Cloud Storage API
In the Google Cloud Console, navigate to APIs & Services → Library, search for Cloud Storage, and click Enable.
Create a storage bucket
Go to Cloud Storage → Buckets and click Create. Give your bucket a globally unique name — this value becomes
NAMEGOOGLECLOUD. Choose a region close to your server for lowest latency.Create a service account and download credentials
Navigate to IAM & Admin → Service Accounts, create a new service account with the Storage Object Admin role, then generate a JSON key. Download and secure this file — it grants write access to your bucket.
For local development you can use the Google Cloud Storage emulator to avoid incurring costs during testing.
Complete .env Template
Copy this template to the root of your project, fill in every value, and save as.env.