Devographics / Monorepo

Monorepo containing the State of JS apps
surveyform-sigma.vercel.app
Other
124 stars 50 forks source link

Have explicit local, staging and production values in surveyadmin #285

Open eric-burel opened 11 months ago

eric-burel commented 11 months ago

Exploring the API reload, and cache reload, I've noticed that the way env variables are handled is a tad inconsistent

Since surveyadmin differentiates local, staging, and production, we might want to set explicit values for each in our .env variable.

We can make "local" the default value when the target is not specified, in order to avoid accidental breakage of production. So the result would be:

API_URL_PRODUCTION=XX
API_URL_STAGING=XX
API_URL=localhost:4030/graphql
# and same for Redis related variables

We can put the public values (API URL for instance) directly in .env.example so we don't have to setup too many values.

Then in each interface we may switch from one or another as we need too.

We could even have a global select in the app header?

Changes are easy but I haven't modified the current behaviour so it doesn't break local installs of surveyadmin.