Description
The project should have at least one .env file to store multiple environment variables used in the codebase.
The solution
Fortunately, as this projects uses vite, we can take advantage to the fact that vite uses dotenv by default. It just requires a simple configuration to start using environment variables. Check the documentation
Alternatives
There's really no better way to handle the issue. Other options are to use secret management platforms like Infiscal. However, as vite is already using dotenv by default, we should go ahead with dot env.
Additional context
Having an environment variable configuration is a core functionality for any project. I may be a little troublesome at first due to the fact that every developer must create a new non-tracked file for their cloned repository. However, like I said before, this is a core functionality.
An example
This is a basic example of the implementation of a dotenv configuration.
In file BotOptionsService.tsx
The idea is to replace the static variable for the CDN link and have the option to get it from the .env file.
Then, in the .env file, we will be able to switch between a production environment link and a local development link.
Description The project should have at least one
.env
file to store multiple environment variables used in the codebase.The solution Fortunately, as this projects uses vite, we can take advantage to the fact that vite uses dotenv by default. It just requires a simple configuration to start using environment variables. Check the documentation
Alternatives There's really no better way to handle the issue. Other options are to use secret management platforms like Infiscal. However, as vite is already using dotenv by default, we should go ahead with dot env.
Additional context Having an environment variable configuration is a core functionality for any project. I may be a little troublesome at first due to the fact that every developer must create a new non-tracked file for their cloned repository. However, like I said before, this is a core functionality.
An example This is a basic example of the implementation of a dotenv configuration.
In file![Screenshot 2024-05-02 at 2 52 11 PM](https://github.com/tjtanjin/react-chatbotify/assets/37199673/9f7ed514-a578-45d7-84a2-b6ee41cf4a66)
BotOptionsService.tsx
The idea is to replace the static variable for the CDN link and have the option to get it from the
.env
file.Then, in the
.env
file, we will be able to switch between a production environment link and a local development link.