The FutsalManager backend is a Node.js/Express REST API that connects to PostgreSQL for persistent storage, Redis for caching, and Cloudinary for image uploads. This guide covers what you need to get the API running in production.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danielsl4/TFG_DAM_2526/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before deploying, make sure you have the following available:- Node.js 18+ — the runtime for the API server
- PostgreSQL — the primary database (any hosted provider works: Supabase, Railway, Neon, etc.)
- Redis — used for caching match data and standings (Upstash, Redis Cloud, or self-hosted)
- A Cloudinary account for handling team and player image uploads
Environment variables
Create a.env file in the backend root (or configure these as environment variables in your hosting platform).
Database
The backend connects to PostgreSQL via a single connection string:| Variable | Description |
|---|---|
DATABASE_URL | Full PostgreSQL connection string, e.g. postgresql://user:pass@host:5432/dbname |
The connection pool is configured with SSL enabled (
rejectUnauthorized: false), which is compatible with most managed PostgreSQL providers. If you’re using a self-hosted instance without SSL, you’ll need to adjust db.js accordingly.Authentication
| Variable | Description |
|---|---|
JWT_SECRET | Secret key used to sign and verify JSON Web Tokens. Use a long, random string. |
Redis
| Variable | Description |
|---|---|
REDIS_URL | Full Redis connection URL, e.g. redis://default:password@host:6379 |
Cloudinary
| Variable | Description |
|---|---|
CLOUDINARY_CLOUD_NAME | Your Cloudinary cloud name |
CLOUDINARY_API_KEY | Cloudinary API key |
CLOUDINARY_API_SECRET | Cloudinary API secret |
Server
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Port the Express server listens on |
.env looks like this:
.env
Deployment
Configure environment variables
Copy the example above into a
.env file in the backend root, or set the variables directly in your hosting platform’s dashboard.Production tips
SetNODE_ENV=production in your environment to ensure libraries like Express apply production-safe defaults:
.env
Access-Control-Allow-Origin: *) by default. For production, consider restricting this to your frontend’s domain by editing the CORS middleware in index.js.