Skip to content

Configuration

StarterStack uses the standard dotenv approach to configuration. You will find a dotenv file located at /backend/.env

Available Configurations

ENV VARDescriptionDefault
HASH_SALTused for salting crytographic functionsomitted for security reasons
SALT_ROUNDSused for crytographic functionsomitted for security reasons
DB_HOSTthe host for your database{ your-project-name }-db
DB_NAMEthe name of your database
DB_USERthe username for your database
DB_PWDthe password for your databasepass22pass
DB_PORTthe database port3306
DB_DIALECTthe database enginemysql
STRIPE_KEYyour stripe key
STRIPE_WEBHOOK_SECRETyour stripe webhook secret
SITE_NAMEthe name of your site (i.e. StarterStack)
SITE_HOST_NAMEthe host name of your site (i.e. https://www.starterstack.com)
SITE_HOST_NAMEthe host name of your site (i.e. https://www.starterstack.com)
SITE_EMAILthe email from address for outgoing e-mails
SMTP_MAIL_HOSTthe smtp host of your outgoing e-mail providersmtp.mailtrap.io
SMTP_MAIL_PORTthe smtp port of your outgoing e-mail provider2525
SMTP_MAIL_USERthe username for your smtp provider account
SMTP_MAIL_PASSthe password for your smtp provider account
USE_PASSPORTuse passport.js for authenticationtrue
PASSPORT_STRATEGYthe passport.js authentication strategylocal

Using Env Vars During Development

You have access to all of these configurations via the standard node processs.env.

js
const site_name = process.env.SITE_NAME

Production Deployment

It's generally a good idea to exclude your .env from your source code repo. As such, StarterStack includes the .env file in the .gitignore file. When deploying your application to production it's a common practice to set these as environment variables on your server. Of course, you can still choose to use .env files in production.