From 63ee41d8e0ff3110bf03eb6d97655ba67916cebf Mon Sep 17 00:00:00 2001 From: Hayden Bleasel Date: Wed, 6 Nov 2024 07:13:57 +0900 Subject: [PATCH] Resolves #183 --- apps/_docs/content/docs/env.mdx | 6 ++++++ packages/database/.env.example | 1 + setup.sh | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 packages/database/.env.example diff --git a/apps/_docs/content/docs/env.mdx b/apps/_docs/content/docs/env.mdx index a1f666ad..4678f82c 100644 --- a/apps/_docs/content/docs/env.mdx +++ b/apps/_docs/content/docs/env.mdx @@ -18,6 +18,8 @@ The environment configuration is split into two main parts: ## Initial setup +### App Environment Variables + As part of the initial setup, you will need to fill in the environment variables in each `.env.local` file in each Next.js application, specifically `app`, `web` and `api`. The initial setup script will copy these `.env.example` files to `.env.local` files, so all you need to do is fill in the variables. @@ -28,6 +30,10 @@ Check out the `packages/env/index.ts` file to see the validation rules for each For `FLAGS_SECRET`, you can run `node -e "console.log(crypto.randomBytes(32).toString('base64url'))"` or `openssl rand -base64 32` in your terminal to generate a random value. +### Database Environment Variable + +You also need to configure a `.env` file in the `apps/database` directory. This file should be created by the setup script, so just add your `DATABASE_URL` and you should be good to go. + ## Adding a variable To add a new environment variable, you need to do two things: diff --git a/packages/database/.env.example b/packages/database/.env.example new file mode 100644 index 00000000..84563703 --- /dev/null +++ b/packages/database/.env.example @@ -0,0 +1 @@ +DATABASE_URL="postgresql://test:test@localhost:5432/test" \ No newline at end of file diff --git a/setup.sh b/setup.sh index 02b3b195..55989ffa 100755 --- a/setup.sh +++ b/setup.sh @@ -11,7 +11,7 @@ echo "Copying .env.example files to .env.local..." cp apps/api/.env.example apps/api/.env.local cp apps/app/.env.example apps/app/.env.local cp apps/web/.env.example apps/web/.env.local -cp apps/studio/.env.example apps/studio/.env +cp apps/database/.env.example apps/database/.env # Delete demo folder echo "Deleting demo folder..."