|
| 1 | +## --- Notes ----------------------------------------------------------------------------------- */ |
| 2 | + |
| 3 | +## -i- The `.env.example` file can be copied into `.env.local` using `npx turbo env:local` |
| 4 | +## -i- For development, staging & production environments, check the next.js docs: |
| 5 | +## -i- https://nextjs.org/docs/app/building-your-application/configuring/environment-variables |
| 6 | + |
| 7 | +## -i- Note that you should treat environment variables as if they could be inlined in your bundle during builds & deployments |
| 8 | +## -i- This means dynamically retrieving environment variables from e.g. `process.env[someKey]` might not work |
| 9 | +## -i- It also means that you should never prefix with `NEXT_PUBLIC_` for sensitive / private keys |
| 10 | + |
| 11 | +## -i- We suggest that for each environment variable you add here, you also add an entry in `appConfig.ts` |
| 12 | +## -i- There, you can add logic like ```envValue: process.env.NEXT_PUBLIC_ENV_KEY || process.env.EXPO_PUBLIC_ENV_KEY``` |
| 13 | +## -i- Where you would only define the NEXT_PUBLIC_ prefixed versions here in `.env.local` locally and using Next.js UI for deployed envs |
| 14 | +## -i- For environment variables you only be available server-side, you can omit `NEXT_PUBLIC_` |
| 15 | + |
| 16 | +## --- General --------------------------------------------------------------------------------- */ |
| 17 | +## -i- Env vars that should always be present & the same locally, independent of the simulated environment |
| 18 | +## --------------------------------------------------------------------------------------------- */ |
| 19 | + |
1 | 20 | NEXT_PUBLIC_BASE_URL=http://localhost:3000
|
2 | 21 | NEXT_PUBLIC_BACKEND_URL=http://localhost:3000
|
3 | 22 | NEXT_PUBLIC_API_URL=http://localhost:3000/api
|
4 | 23 | NEXT_PUBLIC_GRAPH_URL=http://localhost:3000/api/graphql
|
| 24 | + |
| 25 | +## --- LOCAL ----------------------------------------------------------------------------------- */ |
| 26 | +## -i- Defaults you might want to switch out for local development by commenting / uncommenting |
| 27 | +## --------------------------------------------------------------------------------------------- */ |
| 28 | + |
| 29 | +# DB_URL= # TODO: Add DB layer connection for full local dev... |
| 30 | + |
| 31 | +## --- DEV ------------------------------------------------------------------------------------- */ |
| 32 | +# -i- Uncomment while on development branch to simulate the dev environment |
| 33 | +## --------------------------------------------------------------------------------------------- */ |
| 34 | + |
| 35 | +# DB_URL= # TODO: Add DB layer connection for the dev environment... |
| 36 | + |
| 37 | +## --- STAGE ----------------------------------------------------------------------------------- */ |
| 38 | +# -i- Uncomment while on staging branch to simulate the stage environment |
| 39 | +## --------------------------------------------------------------------------------------------- */ |
| 40 | + |
| 41 | +# DB_URL= # TODO: Add DB layer connection for the stage environment... |
| 42 | + |
| 43 | +## --- PROD ------------------------------------------------------------------------------------ */ |
| 44 | +# -i- Uncomment while on main branch to simulate the production environment |
| 45 | +## --------------------------------------------------------------------------------------------- */ |
| 46 | + |
| 47 | +# DB_URL= # TODO: Add DB layer connection for the production environment... |
0 commit comments