Node Js Project
Node Js Project
step 1 ==> open vs code , type ctrl+tilde(~), It will open terminal in vs code.
type 'git clone https://github.com/Hashnode/mern-starter.git' in terminal and press
enter. it will clone the basic project of mern.
step2 ==> go to dir mern-starter and type npm install. it will install packages
listed in package.json file.
step3 ==> type npm start and press enter it will start local host with port 3000.
==> all models for services are created in model folder. and all static files like
index.html and css are created in static folder.
package.json => node package manager list all installed package with versions,
scripts npm commands that are need to run a project are mentioned in package.json
file.
api files are created in route folder perform opertaions with mongodb. api for
login and signup with authentication are created in auth.js file. api for get
menus, menu types, menu types with items, to order, get last orders by mobile
number are created in menuapoi.js file.
redux is used to keep state of data across different pages in react. so reducer are
created in reducer folder. navbarreducer file is used. there are two cases.
1) CHANGE_CARTCOUNT is for manage state of cart items with there count.
2) LOGIN_USER is for manage state of logged in user