Skip to content

Local Development Setup

Ashish Shevale edited this page Oct 28, 2023 · 2 revisions

Instructions

MongoDB Setup

You need to install MongoDB on your local to and create a project in atlas to be able to use the application.

Local

Install MongoDB using the official docs for your system and make sure you can connect to it and created documents.

Atlas

Creating a Project

  1. Log in to MongoDB Atlas cloud.mongodb.com and go to the Projects page.
  2. Click on the New Project button image
  3. 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

  1. On the overview page, click on the Create deployment button as highlighted in the image below image
  2. 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
  3. Now you are redirected to the Security Quickstart page.
  4. Choose the Authentication method as Username and Password, and note down the username and password you chose.
  5. 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. image
  6. 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. image

  1. Click on the Connect button.
  2. In the popup that opens, click on Drivers as we will be connecting to the DB using Nodejs image
  3. Choose the driver (Nodejs) and version (5.5 or later)
  4. 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.

  1. Open the code repository that you cloned, go to the server folder and create a new file config.env at server/src/config.env
  2. Copy the contents of .env.example into this file.
  3. 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=
  1. Install all dependencies using yarn install and start the server yarn dev
  2. If all steps were done properly, you should see something like the following in the terminal output

image

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.

Clone this wiki locally