.env variables in Nuxt/Strapi app

Context: a monorepo app with nuxt and strapi.

I’ve got a doubt regarding env variables. How do you manage env variables in your setup? I mean, the nuxt app manages a set of env variables, and the strapi app manages its own set of env variables as well. When deploying a webapp from Cleavr you can define env variables, but as far as I know they are saved in an .env file in the root of the repo. How do the strapi app access them then?

I believe Strapi created it’s own env file when I did the example from earlier - I didn’t manage that env file directly. However, that is a consideration we’ll need to keep in mind.

I envision a mono repo setup to essentially be two web-apps in one where we point to two separate folders which is a root directory for each app .

Or, possibly we create two separate web apps that each point to their respective root folder on the repo. I think I like this approach a bit more to keep it clean and retain context.

I like this aproach more as well. Each webapp with its own set of hooks would open a way to cancel a build if not affected by a push (Netlify way).

I’m afraid there’s no straight way to deploy a formal monorepo at the moment. The current management of the env variables is a hurdle in the way, and every single push would deploy every app no matter whether is affected or not by the triggering commit.

Looking forward for a clean way to handle it.

Keep the good job!

1 Like

Nope, no “clean” way to handle it. Yet. :slight_smile:

You can handle it all with custom deployment hooks. If you know bash scripts then the skies the limit with the flexibility of deployment hooks.

But, we’re excited to tackle implementing a clean, intuitive means.

1 Like