Setup env vars
Env vars control how the server will function. For hosted deployments, read through the env var documentation - you might need to change a few things around before going into prod.
Backend setup
# mysql database connection string, eg: mysql://mysql-user:mysql-password@host:port/db-name
DATABASE_URL="mysql://root:gjkesbgkjak@19.43.119.82:2000/operational"
# Optional. Set vapid details for push notifications. Generate your vapid details from https://tools.reactpwa.com/vapid
VAPID_EMAIL=""
VAPID_PUBLIC_KEY=""
VAPID_PRIVATE_KEY=""
# Nodejs env, defaults to development. Set it to production when hosting online.
NODE_ENV="development"
# Port. Defaults to 2000
PORT="2000"
# Secret hash. DON'T LEAVE THIS EMPTY. Use a random id generator to generate a hash, eg: https://www.uuidgenerator.net/
SECRET=""
# ["http://localhost:8080"] Url of the frontend
APP_URL=""
# ["http://localhost:8080"] Allows cors from this url. If APP_URL is set, that will be used instead.
# Set a cors url to override the current url
# /api/v1/ingest is allowed from all urls so it can receive events without any cors issue.
# Set this value to "*" to allow all urls
CORS=""
# [120] Removes events older than 120 days
REMOVE_EVENTS_AT=""
# [7] Removes old test events older than 7 days
REMOVE_TEST_EVENTS_AT=""
# [""] Use resend.com for email sending. They have a free plan available.
RESENT=""
# [""] Set this to the url you've configured in resend. If not set, emails will saved as txt files inside /backend/private
ADMIN_EMAIL=""
CopyApp setup
# Set this the to url your api server is accessible to. Defaults to http://localhost:2000
VITE_API_URL="http://localhost:2000"
# Only set this if you have vapid details. Set this to the value of VAPID_PUBLIC_KEY from your backend .env
VITE_PUSH_SERVER_KEY=""
Copy