arpittyagi102 / LinkUp

Link Up is a real time chatting application project, it utilizes, MERN, socket.io
https://getlinkup.vercel.app
MIT License
23 stars 30 forks source link

Add example.env file to MERN repository for easier configuration setup #13

Closed fiskryeziu closed 1 year ago

fiskryeziu commented 1 year ago

Issue Description:

Currently, the MERN repository lacks an example.env file, which makes it difficult for developers to set up and configure the application's environment variables. This issue aims to address this problem by adding an example.env file to the repository.

frankhit2021 commented 1 year ago

I am new to the open source project, and do not know how to set up the environment variables in step 4. Could anyone offer some help? Thank you!

arpittyagi102 commented 1 year ago

What you can do is add an Dummy value, wherever it is using environent variables, in the whole code. You can find them by searching process.env For example the code is

const value = process.env.SECRET

change it to

const value = process.env.SECRET || "DUMMYVALUE"
frankhit2021 commented 1 year ago

Thank you! Let me try.

Vyom-V commented 1 year ago

-> for .env file in backend you need create it just inside the backend folder you can find the relevent path from the gitignore file -> create 2 variables MONGO_URI and DB_NAME -> open up mongo compass you'll find a connection link there assign it to MONGO_URI = "your key" -> after you connect compass youll find databases either create one or use the existing ones DB_NAME = 'you db name'

for Front-end -> i couldnt tell where its supposed to go but you use this const value = process.env.SECRET || "DUMMYVALUE" -> you can generate your client_id by following this link: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid