-
Notifications
You must be signed in to change notification settings - Fork 17
Local Development Setup
Ashish Shevale edited this page Oct 28, 2023
·
2 revisions
You need to install MongoDB on your local to and create a project in atlas to be able to use the application.
Install MongoDB using the official docs for your system and make sure you can connect to it and created documents.
Creating a Project
- Log in to MongoDB Atlas cloud.mongodb.com and go to the Projects page.
- Click on the New Project button
- Enter a Project Name (clickup-clone) and click Next. In the next screen, you can add other people if you want and then click Create Project.
Creating Database
- On the overview page, click on the Create deployment button as highlighted in the image below
- The next screen will ask you to select select some configuration for your cluster. Choose the M0 Free option, any provider and give your cluster a suitable name. Then click Create
- Now you are redirected to the Security Quickstart page.
- Choose the Authentication method as Username and Password, and note down the username and password you chose.
- For the question **Where would you like to connect from, choose My Local Environment and add your current IP address You can always update these settings from the Security/Network Access page.
- Finally click on Finish and Close
Adding DB URI to local config Once you are done with the above steps, you will be taken back to the Project Overview page, and it will contain the new DB cluster you just created.
- Click on the Connect button.
- In the popup that opens, click on Drivers as we will be connecting to the DB using Nodejs
- Choose the driver (Nodejs) and version (5.5 or later)
- The popup will contain a connection string that looks something like
mongodb+srv://{your_username}:<password>@{your_cluster_name}.tvufl1k.mongodb.net/?retryWrites=true&w=majority
Copy this string and replace the part with the password you created.
- Open the code repository that you cloned, go to the server folder and create a new file config.env at server/src/config.env
- Copy the contents of .env.example into this file.
- For the variable MONGO_URI, assign the connection string with your password that you copied. Finally, your .env file should look something like
PORT=5000
MONGO_URI=<YOUR URL HERE>
MONGO_URI_TEST=mongodb://127.0.0.1:27017/test_clickup_db
JWT_SECRET=AytvcUZfnJhaigKKJkjgkjGKJGkj
JWT_EXPIRE=60min
EMAIL_SERVICE=
EMAIL_USERNAME=
EMAIL_PASSWORD=
EMAIL_FROM=
- Install all dependencies using yarn install and start the server yarn dev
- If all steps were done properly, you should see something like the following in the terminal output
If you get some error regarding IP address not whitelisted, go to the Security/Network Access page, click on edit on one of existing IP address and select allow all
Now, install the dependencies in client folder and start up that server too.