This guide walks you through getting a local Gestor Deportivo server running from scratch and making your first authenticated API call. The entire flow — from cloning the repo to listing teams — takes less than five minutes once your MongoDB instance is ready.Documentation 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.
Every endpoint in Gestor Deportivo uses the POST HTTP method, regardless of whether it reads or writes data. Keep this in mind when crafting requests or setting up API clients.
Prerequisites
Before you begin, make sure the following are available on your machine:- Node.js 18+ — nodejs.org
- npm 9+ — bundled with Node.js
- MongoDB — a local instance (
mongod) or a cloud URI (MongoDB Atlas) - Git — to clone the repository
Setup Steps
Clone the repository and install dependencies
Clone the project from GitLab and install all Node.js dependencies.This installs Express, Mongoose, JWT, Nodemailer, the Google Cloud Storage client, Socket.io, and all other production and development dependencies declared in
package.json.Create your .env file
Create a See the Configuration guide for a full description of every variable and how to generate credentials for Gmail and Google Cloud Storage.
.env file in the root of the project (one level above src/). This file is read by dotenv at startup.Start the development server
Launch the API in development mode using nodemon and babel-node for live reloading and ES6+ support.You should see output similar to:The server is now listening at
http://localhost:3000.Register a new user
Create an account by sending a POST request to A successful response confirms the user was created and triggers a verification email to the address provided.
/api/user/register. The sex field accepts "M" (male) or "F" (female).Verify your email address
Gestor Deportivo sends a numeric verification code to your email. Submit it to activate the account.
If you did not receive the email, check your spam folder and confirm that
USER_EMAIL and PASS_EMAIL are set correctly in .env. See Gmail App Password setup for help generating credentials.Log in and retrieve your token
Authenticate with your verified credentials. The response body contains the JWT you will use on every subsequent request.Store the
token value — you will pass it as the access-token header on every protected request.Make your first authenticated request
Use your token to list all teams. Replace An empty array is expected on a fresh install. You’re now fully authenticated and ready to create teams, events, and more.
<YOUR_TOKEN> with the value returned at login.Gestor Deportivo uses a custom
access-token header — not the standard Authorization: Bearer scheme. Make sure your HTTP client or SDK is configured to send access-token and not Authorization.Build for Production
When you’re ready to deploy, compile the ES6+ source with Babel:build/ directory and can be run with a standard node process — no babel-node required in production.
Available API Routes
All routes accept POST requests and are prefixed with/api/.
| Route | Description |
|---|---|
/api/user | User registration, login, verification, profile |
/api/team | Team creation, roster management, listings |
/api/player | Player profiles, stats, transfers |
/api/club | ClubHub multi-team groupings |
/api/event | Tournament/event creation and management |
/api/game | Match scheduling, live data, results |
/api/notice | News and notices scoped to an event |
/api/reserve | Participation slot requests |
/api/reserve-accepts-team | Approve or reject team reservations |