Skip to content

Back-end application made in Node.js and MongoDB as database. It has an user authentication using jsonwebtoken. After the authentication, the user can register new products and then make his own order(s).

Notifications You must be signed in to change notification settings

gabrielduessmann/node-rest-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

Objective

Create a back-end applcation in Node.js

Technologies I have used

  • Node.js
  • MongoDB
  • Cluster

Learning process

All the project was based and followed in this playlist, by Academind YouTube chanell Creating a REST API with Node.js

How to run

TO DO

  1. Clone the repository
  2. Create a MongoDB Cluster (topic below)
  3. Open the file nodemon.json
  • Change database_password to your MongoDB database password.
  • Change token_password to any word you want. This is just a salt to encrypt the password
  1. Run this command to start the application
$ npm start

TODO Verify if it works

Create a cluster on MongoDB

TO DO

Using Postman

TO DO Print with the requests (GET, POST, DELETE, ...)

Commands I have used

$ npm init
$ npm install --save express  
$ node server.js  # run server
$ npm install --save-dev nodemon  # automatic restart server when change the code
$ npm start  # nodemon server.js
$ npm install --save morgan  # show the REST in terminal (ex: GET /orders/123 200)
$ npm install --save body-parser
$ npm install --save mongoose  # mongodb manager
$ npm install --save multer  
$ npm install bcrypt --save  # library to encrypt password 
$ npm install jsonwebtoken --save  # library for user token in login 

Versions

$ npm -v  # 3.5.2 
$ node -v  # v8.10.0

License

MIT

About

Back-end application made in Node.js and MongoDB as database. It has an user authentication using jsonwebtoken. After the authentication, the user can register new products and then make his own order(s).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published