Skip to content

Commit

Permalink
Resolves #183
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Nov 5, 2024
1 parent aa1d1ca commit 63ee41d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions apps/_docs/content/docs/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
</Callout>

### 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:
Expand Down
1 change: 1 addition & 0 deletions packages/database/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL="postgresql://test:test@localhost:5432/test"
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down

0 comments on commit 63ee41d

Please sign in to comment.