Enviornment Variable Setup
This setup guide will walk you through the enviornment variables you will need to launch your local enviornment.
.env File Setup - snapcaster-backend
Directorysnapcaster-backend
Directoryservices
Directoryanalytics
- .env
Directoryautocomplete
- .env
Directorycatalog
- .env
Directorypayment
- .env
Directorysearch
- .env
Directoryuser
- .env
- .env
- …
Enviornmental variable setup steps:
-
snapcaster-backend
snapcaster-backend/.env NODE_ENV = developmentMONGO_URI = mongodb://root:password@127.0.0.1:27017/REDIS_URI = http://localhost:6379/POSTGRES_URI = postgresql://user:password@localhost:5432/users_dbDISCORD_WEBHOOK_URL = [Message an admin or make your own]CONDUCT_COMMERCE_EXPORT_URL = https://api.conductcommerce.com/v1/inventoryExportLocations?host=JWT_SECRET = secretDISCORD_REDIRECT_URI = http://localhost/user/auth/discord/callback -
analytics
snapcaster-backend/services/analytics/.env PORT = 3006MONGO_URI = mongodb://root:password@mongo:27017REDIS_URI = redis://redis:6379NODE_ENV = developmentJWT_SECRET = secret# If using google analytics...ENCODED_GOOGLE_CREDENTIALS = [Message an admin but not needed]GA4_PROPERTY_ID = [Message an admin but not needed] -
autocomplete
snapcaster-backend/services/autocomplete/.env PORT = 3001MONGO_URI = mongodb://root:password@mongo:27017REDIS_URI = redis://redis:6379NODE_ENV = development -
catalog
snapcaster-backend/services/catalog/.env PORT = 3005POSTGRES_URI = postgresql://user:password@postgres:5432/users_dbMONGO_URI = mongodb://root:password@mongo:27017REDIS_URI = redis://redis:6379NODE_ENV =developmentJWT_SECRET = secret -
payment
snapcaster-backend/services/payment/.env PORT = 3003JWT_SECRET = secretPOSTGRES_URI = postgresql://user:password@postgres:5432/users_dbNODE_ENV = development# Used for StripeCLIENT_URL = http://localhost:3004 # used for redirecting to client after paymentSTRIPE_WEBHOOK_SECRET = whsec_100STRIPE_SECRET_KEY = sk_test_100STRIPE_PUBLIC_KEY = pk_test_100STRIPE_PRICE_ID = price_100# Used for assigning Discord roles to usersDISCORD_SERVER_ID = [Message an admin but not needed]DISCORD_BOT_TOKEN = [Message an admin but not needed]DISCORD_PRO_ROLE_ID = [Message an admin but not needed] -
search
snapcaster-backend/services/search/.env NODE_ENV=developmentJWT_SECRET= secretPOSTGRES_URI=postgresql://user:password@postgres:5432/users_dbMONGO_URI=mongodb://root:password@127.0.0.1:27017/ -
user
snapcaster-backend/services/user/.env PORT = 3002CLIENT_URL = http://localhost:3004 # used for redirecting to client after email verificationUSER_SERVICE_URL = http://localhost/user # used to create api url for email verificationJWT_SECRET = secretPOSTGRES_URI = postgresql://user:password@postgres:5432/users_dbNODE_ENV = development# required for discord oauthDISCORD_CLIENT_ID = [Message an admin but not needed]DISCORD_REDIRECT_URI = http://localhost/user/auth/discord/callbackDISCORD_CLIENT_SECRET = [Message an admin but not needed]# required for discord role assignmentDISCORD_SERVER_ID = [Message an admin but not needed]DISCORD_BOT_TOKEN = [Message an admin but not needed]DISCORD_PRO_ROLE_ID = [Message an admin but not needed]# Used for SES email service# e.g. forgot password email, welcome email# Not required in dev unless you want to test email serviceAWS_ACCESS_KEY_ID = [Message an admin but not needed]AWS_SECRET_ACCESS_KEY = [Message an admin but not needed]AWS_REGION = [Message an admin but not needed]
.env.local File Setup - snapcaster-client
Directorysnapcaster-client
- .env.local
- …
Enviornmental variable setup steps:
- snapcaster-client
snapcaster-client/.env.local DATABASE_URL = [Message an admin]NEXT_PUBLIC_SEARCH_URL = http://localhost:3000NEXT_PUBLIC_AUTOCOMPLETE_URL = http://localhost/autocompleteNEXT_PUBLIC_USER_URL = http://localhost/userNEXT_PUBLIC_PAYMENT_URL = http://localhost/paymentNEXT_PUBLIC_WISHLIST_URL = http://localhost/wishlistNEXT_PUBLIC_ANALYTICS_URL = http://localhost/analyticsNEXT_PUBLIC_CATALOG_URL = http://localhost/catalogNEXT_PUBLIC_BASE_URL = http://localhost:[port the analytics client is on]NODE_ENV = development
.env File Setup - snapcaster-analytics
Directorysnapcaster-analytics
- .env
- …
Enviornmental variable setup steps:
- snapcaster-analytics
snapcaster-analytics/.env GOOGLE_APPLICATION_CREDENTIALS = google-credentials.jsonJWT_SECRET = secretJWT_REFRESH_SECRET = secretROOT_URL = http://localhost:[port the analytics client is on]/MONGO_URI = mongodb://root:password@127.0.0.1:27017/NEXT_PUBLIC_SEARCH_URL = http://localhost:3000NEXTAUTH_SECRET = secretNEXTAUTH_URL = http://localhost:3007/DATABASE_URL = [Message an admin]PG_PORT = [Message an admin]GA4_PROPERTY_ID = [Message an admin]ENCODED_GOOGLE_CREDENTIALS = [Message an admin]