tjtanjin / react-chatbotify

A modern React library for creating a flexible and extensible chatbot.
https://react-chatbotify.tjtanjin.com/
MIT License
103 stars 49 forks source link

Chore/setup env #49

Closed Andres2D closed 2 months ago

Andres2D commented 2 months ago

Description

This pull request contains the basic configuration to start using environment variables (dotenv) in the project. Environment variables will store all the static data we may use in the codebase. More info is in the official documentation

Closes #48

What change does this PR introduce?

Introducing environment variables means that every developer must have their own .env.(untracked) file. In which, you can play with the values of the different variables. Moreover, this PR introduces a .env.example file, which we must update (with a dummy value) anytime a new environment variable is introduced. The idea of this example file is to show the existing variables; we shouldn't show real values in this file.

Please select the relevant option(s).

What is the proposed approach?

Using environment values.

Checklist:

Note

When this code go to production. The server must have the environment variables defined in order to work properly. The .env file is just for dev environment.

tjtanjin commented 2 months ago

LGTM, did a small change to include the actual env value. Thanks!

Andres2D commented 2 months ago

Well, actually the .env file shouldn't be tracked by git. Maybe in the future you will store secrets or confidential data on those variables. However, when the time comes you can untrack this file anyway.

tjtanjin commented 2 months ago

Well, actually the .env file shouldn't be tracked by git. Maybe in the future you will store secrets or confidential data on those variables. However, when the time comes you can untrack this file anyway.

Was a little torn between ignoring it or including it since if this wasn't provided, then interested contributors will have to manually create and add the .env entries. That said, if down the road there is sensitive information required, then we should definitely untrack this file.