To set up you developer environment for the app, the following .env files are needed.
Setup a .env.development
file with the following value:
.env.development
VITE_ENVIRONMENT=development VITE_STRIPE_PUBLIC_KEY=pk_test_xxxx VITE_STRIPE_BETA100_LINK=https://buy.stripe.com/test_xxxx VITE_POCKETBASE_URL=http://localhost:8090 VITE_OPENROUTER_API_KEY=sk-or-v1-xxxx VITE_OPENROUTER_ASSET_ID=xxxx VITE_POSTHOG_API_KEY=phc_xxxx # SERVER CONFIG SERVER_USER=ubuntu SERVER_HOST={REMOTEIP} APP_PATH=tansy APP_URL=tansy.app SERVER_SYSTEMCTL_PATH=/usr/lib/systemd/system/pocketbase.service # Pocketbase Install PB_VERSION=x.x.x PB_SYSTEM=darwin PB_ARCH=arm64 # LOGIN VITE_DEV_MEMBER_EMAIL=member@tansy.ai VITE_DEV_MEMBER_PASSWORD=password VITE_DEV_COUNSELOR_EMAIL=counselor@tansy.ai VITE_DEV_COUNSELOR_PASSWORD=password
Also create a .env.production
file, with the same information but the production values.
Pocketbase
There is an additional file in the pocketbase folder for the pocketbase API to use.
it is located at pocketbase/pb_hooks/env.json
. It mostly contains various API keys that the framework uses:
env.json
{ "app_baseurl": "https://tansy.app", "app_baseurl_test": "http://localhost:3000", "emailApiKey": "k_xxxx", "stripeSecretKey": "sk_live_xxxx", "stripeSecretKey_test": "sk_test_xxxx", "slackToken": "xoxb-xxxx", "slackURLs": { "#operations": "https://hooks.slack.com/xxxx", "#feedback": "https://hooks.slack.com/xxxx", "#bots": "https://hooks.slack.com/xxxx", "#dev": "https://hooks.slack.com/xxxx" }, "zapier_webhook": "https://hooks.zapier.com/hooks/xxxx", "n8n_webhook_test": "https://koalahealth.app.n8n.cloud/xxxx", "n8n_webhook": "https://koalahealth.app.n8n.cloud/xxxx" }
Development
To begin developing, you need to copy your .env.development
file to .env
which the app uses and make sure env.json
exists.
Production
There is a npm script that will copy the files .env.production
and env.json
to the remote production server.
just run:
npm run env
Danger
This is a dangerous operation, as you will overwrite the production environment
When using the build scripts detailed in Builds, they will automatically use .env.production
.