The Ecommerce Delivery API reads every runtime value — server port, signing secrets, database credentials, cloud storage keys, and email credentials — from environment variables. These are loaded at startup via dotenv, so no configuration is hard-coded in the application. Before starting the server for the first time you must create aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery/llms.txt
Use this file to discover all available pages before exploring further.
.env file in the project root and populate it with the values described below.
Creating your .env file
Copy the provided template and then fill in your own values:
Environment variable reference
Server
The port the Express HTTP server listens on. Choose any available port;
3000
and 4000 are common development values.Authentication
The secret string used by jsonwebtoken to sign and verify JWT access
tokens. This value is also the fallback used by
config.js when the variable
is absent, so it must be overridden in every real environment.Database
The full MongoDB connection string passed directly to Mongoose’s
connect() call. See Database for the expected
format and Atlas setup instructions.Google Cloud Storage
The name of the Google Cloud Storage bucket where product images, user
avatars, and payment proof images are stored. The bucket must already exist
and be accessible with the service-account credentials bundled in the project.
Google OAuth
The OAuth 2.0 Client ID for your Google Cloud project. Used together with
CLIENT_SECRET to authenticate OAuth-based flows.The OAuth 2.0 Client Secret for your Google Cloud project. Keep this value
out of version control.
The base URL of the front-end client application. The API uses this value
when constructing links that are sent to users, for example in account
verification and password-recovery email templates.
Email (Nodemailer)
The Gmail address used as the SMTP sender by Nodemailer. This address appears
in the
from field of account-verification and password-recovery emails.The SMTP password (or Google App Password) for
USER_EMAIL. Because the API
uses Gmail’s service transport, a standard Google account password may not
work if 2-Step Verification is enabled — create a dedicated App Password
instead.Complete example.env
How configuration is loaded
src/config.js imports dotenv and re-exports every variable as a typed object with safe empty-string defaults, making it straightforward to import a single config object anywhere in the codebase instead of calling process.env directly: