-
I updated ubuntu
-
I upgraded ubuntu
sudo apt upgrade
-
I got the location of node-js software
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
-
I installed node.js
sudo apt-get install -y nodejs
-
I verified the node installation
node -v
-
I created a Todo directory
mkdir Todo
-
I verified if it was created
ls
-
I changed my current directory to Todo directory
cd Todo
-
I initialised my project
-
I confirmed if package.json file was created during the process
-
I installed express using npm
npm install express
-
I created a file named 'index.js'
-
I installed dotenv module
npm install dotenv
-
I opened the file and inputed the required codes
sudo vim index.js
-
I started my server to see if it works
node index.js
-
I accessed my public ip address on my browser
http://<PublicIP-or-PublicDNS>:5000
-
I created a routes directory
-
I changed the current directory to the one I just created
cd routes
-
I created a new file
-
I opened the file and inserted the required codes, then I saved it
sudo vim api.js
-
I changed the directory back to 'Todo' and installed mongoose
-
I opened the file created and pasted the required codes
sudo vim todo.js
-
Then, I updated the file in the routes directory
sudo vim api.js
-
I opened a Mongodb database and got my connection string. Then I copied the connection string in a new file that I created.
-
I updated the 'index.js' file to reflect the use of '.env'
-
I started my server again
-
I installed Postman and created a POST and GET request for my API
-
I created a new folder in my Todo directory
npx create-react-app client
-
I installed concurrently
npm install concurrently --save-dev
-
I installed nodemon
npm install nodemon --save-dev
-
I updated the package.json file
sudo vim package.json
-
I veriified my local host server
npm run dev
-
I installed Axios after doing the necessary steps
-
I went to my componentas directory, opened Listtodo.js and pasted the required codes
-
I opened the necessary files and pasted the required codes