A mini project I did following a guide to better understand back end development.
I used Node, Express and MongoDB Atlas.
Step 1: Clone repository
git clone https://github.com/timothyckl/Task-Manager.git
Step 2: Change directory to wherever repository was cloned
Example:
Desktop/
┗ task-manager/
┗ homework-folder ( ͡° ͜ʖ ͡°)
Type in the command prompt:
cd Desktop/task-manager
Step 3: Install dependencies
npm i
Step 4: Set up MogoDB Atlas Sign up for a free account at https://www.mongodb.com/
Select the "Shared" cloud database option & click "Create":
Choose a cloud provider & region (in this case I chose AWS & Singapore)
Wait for your cluster to be created, then select the "Database Access" on the left navigation tab.
Click "Add New Database User", with the following selected:
Leave the other settings as default and select "Add User".
Note: Please choose a more secure password then in the example.
Next, select the "Network Access" on the left navigation tab.
Choose whether you want to allow access your current IP or from anywhere.
Head back the "Databases" page on the left navigation tab and click "Connect".
Select the second option, "Connect your application":
Copy the connection string and paste it in a new .env
file within your repository:
# .env file
MONGO_URI=mongodb+srv://root:<password>@cluster0.fr0ew.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
Note: Remember to replace with the password previously set for your database user.
Step 5: Run app.js
npm start
# or
node ./app.js