Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/MultiSas/llms.txt

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

MultiSas reads its runtime configuration from a .env file via the dotenv package, which is loaded at startup inside src/config.js. Only three variables are required to get the server running. The compiled config object is imported by src/app.js and applied to the Express instance before any route handlers are registered.

Required Variables

PORT
string
The TCP port on which the Express HTTP server listens. If omitted, config.PORT resolves to an empty string and Express falls back to its internal default of 3000. In production, set this explicitly to match your reverse proxy or container port mapping.
MONGODB_URL
string
required
The full MongoDB connection string used by Mongoose to connect to your database. If omitted, config.MONGODB_URL resolves to an empty string and the server will fail to establish a database connection at startup. For local development use mongodb://localhost:27017/multisas; for production use a managed service such as MongoDB Atlas.
SECRET
string
required
The secret key used by the JWT signing and verification logic. If omitted, the application falls back to the hardcoded default "contra, token". This default must never be used in production. Use a long, randomly generated string of at least 32 characters.

Example .env File

.env
PORT=3000
MONGODB_URL=mongodb://localhost:27017/multisas
SECRET=a_long_random_secret_string_here
The default SECRET value is "contra, token" — it is publicly known from the source code and provides no security. You must replace it with a strong random value before deploying to any environment accessible from the internet.

Development Setup

Start the development server with hot-reload using nodemon:
npm run dev
This executes node src/index.js under nodemon, which watches for file changes and automatically restarts the process. Ensure your .env file exists in the project root before running this command.
# Verify your .env is in place
ls -la .env

# Then start
npm run dev

Production Recommendations

Follow these guidelines before deploying MultiSas to a production environment:
  • Use a strong, random SECRET.
    Generate a value with at least 32 characters using a tool like openssl:
    openssl rand -hex 32
    
  • Use a managed MongoDB instance for MONGODB_URL.
    Services such as MongoDB Atlas provide automatic backups, replication, and TLS-encrypted connections. Use a connection string that includes authentication credentials and the ?retryWrites=true&w=majority options.
    MONGODB_URL=mongodb+srv://<user>:<password>@cluster0.example.mongodb.net/multisas?retryWrites=true&w=majority
    
  • Set PORT to match your reverse proxy.
    If running behind Nginx or a cloud load balancer, set PORT to the internal port your proxy forwards to (commonly 3000 or 8080).
  • Never commit .env to version control.
    The repository’s .gitignore already excludes .env. Use environment injection from your hosting platform (e.g., Railway, Render, Heroku config vars, or Kubernetes secrets) instead of committing secrets.
In containerised deployments, pass the three variables as container environment variables rather than mounting a .env file. The dotenv call in config.js is a no-op when the variables are already present in the process environment.

Build docs developers (and LLMs) love