Skip to content

E-commerce NodeJS is a REST API server used to manage information of products and orders, signup and login functionalities included. It was implemented with NodeJS and MongoDB Atlas, the login functionality was implemented with JWT.

Notifications You must be signed in to change notification settings

EdisonCat/ecommerce-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce-NodeJS

E-Commerce NodeJS is a REST API server used to manage information of products and orders. It has common functionalities, including user singup, login, upload product(image) and information, create orders, etc. It was implemented with NodeJS and MongoDB Atlas, Users can only use the APIs after logging in.

Framework and Tools

NodeJS, ExpressJS: Environment/platform and framework.

Mongoose: Database tool used to connect to the database and model objects.

Morgan: Logger tool used to log.

Multer: Storage tool used to upload and store an image to the database.

BCrypt, Json Web Token(JWT): Verification and security tools used to store user password and create token for users.

Nodemon: Scripting tool used to develop.

API

User

POST: http://localhost:3000/user/signup - Posts a new user via request body(json) to the database

POST: http://localhost:3000/user/login - Returns a token to the user if the user information in the request matches one in the databse

After logging in, the user can start to use the APIs.

Product

GET: http://localhost:3000/products - Returns the list of all products from the database

POST: http://localhost:3000/products - Posts a new products via request body(form-data, properties: "name", "price", "productImage"(file)) to the database

GET: http://localhost:3000/products/:productId - Returns an existed product with specified productId from the database

DELETE: http://localhost:3000/products/:productId - Deletes an existed product with specified productId from the database

Order

GET: http://localhost:3000/orders - Returns the list of all orders from the database

POST: http://localhost:3000/orders - Posts a new order via request body(json, properties "quantity" and "productId" required) to the database

GET: http://localhost:3000/orders/:orderId - Returns an existed order with specified orderId from the database

DELETE: http://localhost:3000/orders/:orderId - Deletes an existed order with specified orderId from the database

DELETE: http://localhost:3000/orders/all - Deletes all existed orders from the database

project screenshot login get after logging in

About

E-commerce NodeJS is a REST API server used to manage information of products and orders, signup and login functionalities included. It was implemented with NodeJS and MongoDB Atlas, the login functionality was implemented with JWT.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published