Its 2019 and Winter Is Coming. Well, apart from the excitements of GOT, Avengers: End game and others, there is a mandatory thing called resolutions. So, I thought to myself why not start a new one, a learning resolution.
PS: I'm still struggling to succeed in my weight loss resolution .
So, I kickstart my Learnt in 2019 Series with this simple ToDo app. I will continue to develop apps atleast fortnightly 😜 .
A simple ToDo app built in MERN stack. Created stateful components to keep things simple. Redux is not used.
These instructions will get you a copy of the project up and running on your local machine for development.
Follow this MLab document to setup database. Create a DB user under Users tab.
Note: Avoid using special characters such as “@”, “/”, or “:” in your database username or password as they can cause issues if they are not properly escaped.
Once completed, create a .env
file in the root directory and put the below code:
DB = 'mongodb://<dbuser>:<dbpassword>@<dburi>'
- dbuser - The user created.
- dbpassword - The user's corresponding password.
- dburi - You can find this in the MLab page once you create a database.
- Clone this repo to your local.
- Do
npm run server-install
inside the repo folder. - Do
npm run client-install
. - Once all necessary files are installed, run
npm run dev
.
In the project directory, you can run:
Runs the node server
Open http://localhost:5000 in postman or similar and to validate the APIs.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs the node server in watch mode.
Runs the node server and client application concurrently.
Open http://localhost:3000 to view it in the browser.