The Debuta backend is a Node.js/Express application that serves the REST API, Socket.IO real-time layer, and the static admin panel files from a single process. Deploying it requires a VPS or cloud instance, a MongoDB Atlas cluster, a Cloudinary account for photo storage, and a set of environment variables to wire everything together.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/desarrolladorandres2026-gif/Native-tailwind/llms.txt
Use this file to discover all available pages before exploring further.
Choose any Linux VPS or cloud compute instance. The backend has been developed and tested on Node.js 18+. Verify the installed version before proceeding:
Ensure ports
80/443 (or your chosen PORT) are open in the server’s firewall and that you have a domain name pointed at the server’s IP address.All runtime dependencies — including Express, Mongoose, Socket.IO, Cloudinary, bcryptjs, and jsonwebtoken — are declared in
package.json and will be installed by npm install.# Server
PORT=3000
NODE_ENV=production
# MongoDB Atlas
MONGO_URI=mongodb+srv://<user>:<password>@<cluster>.mongodb.net/<dbname>?retryWrites=true&w=majority
# Security
JWT_SECRET=a-long-random-string-min-64-chars
JWT_EXPIRES_IN=7d
# CORS — comma-separated, no spaces
ALLOWED_ORIGINS=https://your-app-web.com,https://your-admin-web.com
# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Email (password recovery)
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_gmail_app_password
# Admin panel seed credentials
ADMIN_EMAIL=admin@debuta.com
ADMIN_USERNAME=admin
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
# Facebook OAuth
FACEBOOK_APP_ID=your_facebook_app_id
FACEBOOK_APP_SECRET=your_facebook_app_secret
# Atlas Admin API (optional — needed for auto IP whitelisting)
ATLAS_PUBLIC_KEY=
ATLAS_PRIVATE_KEY=
ATLAS_PROJECT_ID=
ALLOWED_ORIGINS must include every origin from which the admin panel or the mobile app’s web build will make API requests. Requests from unlisted origins will be blocked by the CORS middleware.Use a strong, randomly generated value for
JWT_SECRET — at least 64 characters. Never commit the .env file to version control. The ADMIN_EMAIL and ADMIN_USERNAME values seed the initial admin account; rotate the admin password immediately after first login.MONGO_URI in your .env.The backend includes an
scripts/auto-whitelist.js script that calls the Atlas Admin API to add the current server’s public IP automatically at startup. Provide ATLAS_PUBLIC_KEY, ATLAS_PRIVATE_KEY, and ATLAS_PROJECT_ID in .env to enable this feature.The
package.json defines "prestart" and "predev" hooks that both run node scripts/auto-whitelist.js before the server starts. If the Atlas API credentials are not set, the script exits silently without blocking startup. You can also run the whitelist script manually at any time with npm run whitelist.npm install -g pm2
pm2 start server.js --name debuta-backend
pm2 save
pm2 startup # follow the on-screen command to enable auto-start on boot
pm2 logs debuta-backend # stream logs
pm2 restart debuta-backend # restart after a config change
pm2 stop debuta-backend # stop the process
pm2 status # show process table
Reverse Proxy with Nginx (Recommended)
Run the Node process on an internal port (e.g.,3000) and front it with Nginx to handle TLS termination and serve the admin static files efficiently:
Upgrade and Connection headers are required for Socket.IO WebSocket connections to pass through the proxy correctly.