Skip to content

Latest commit

 

History

History
196 lines (117 loc) · 3.99 KB

project-3.md

File metadata and controls

196 lines (117 loc) · 3.99 KB

Documentation of project3

Step 1

  1. I updated ubuntu

    sudo apt update ubuntu

  2. I upgraded ubuntu

    sudo apt upgrade

    ubuntu

  3. I got the location of node-js software curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

    ubuntu

  4. I installed node.js sudo apt-get install -y nodejs

    ubuntu

  5. I verified the node installation node -v

ubuntu

npm -v ubuntu

  1. I created a Todo directory mkdir Todo

    ubuntu

  2. I verified if it was created ls

    ubuntu

  3. I changed my current directory to Todo directory

    cd Todo

    ubuntu

  4. I initialised my project

    npm init ubuntu

  5. I confirmed if package.json file was created during the process

    ls ubuntu

Step 2

  1. I installed express using npm npm install express

    ubuntu

  2. I created a file named 'index.js'

    touch index.js ubuntu ubuntu

  3. I installed dotenv module npm install dotenv

    ubuntu

  4. I opened the file and inputed the required codes sudo vim index.js

    ubuntu

  5. I started my server to see if it works node index.js

    ubuntu

  6. I accessed my public ip address on my browser

http://<PublicIP-or-PublicDNS>:5000

ubuntu

  1. I created a routes directory

    mkdir routes ubuntu

  2. I changed the current directory to the one I just created cd routes ubuntu

  3. I created a new file

    touch api.js ubuntu

  4. I opened the file and inserted the required codes, then I saved it

    sudo vim api.js

    ubuntu

Step 3

  1. I changed the directory back to 'Todo' and installed mongoose

    npm install mongoose ubuntu

  2. I created 'models' directory mkdir models ubuntu

  3. I changed directory into the newly created folder cd models ubuntu

  4. I created a file and named it todo.js touch todo.js ubuntu

  5. I opened the file created and pasted the required codes sudo vim todo.js ubuntu

  6. Then, I updated the file in the routes directory sudo vim api.js

    ubuntu

  7. I opened a Mongodb database and got my connection string. Then I copied the connection string in a new file that I created. ubuntu

  8. I updated the 'index.js' file to reflect the use of '.env'

    ubuntu

  9. I started my server again

    node index.js ubuntu

  10. I installed Postman and created a POST and GET request for my API

ubuntu ubuntu

Step 3

  1. I created a new folder in my Todo directory npx create-react-app client

    ubuntu

  2. I installed concurrently npm install concurrently --save-dev

    ubuntu

  3. I installed nodemon

    npm install nodemon --save-dev

    ubuntu

  4. I updated the package.json file sudo vim package.json

    ubuntu

  5. I veriified my local host server npm run dev

    ubuntu

  6. I installed Axios after doing the necessary steps

    ubuntu

  7. I went to my componentas directory, opened Listtodo.js and pasted the required codes ubuntu

  8. I opened the necessary files and pasted the required codes

    ubuntu