A simple e-commerce app
The server requires nodejs, npm, and MongoDB to run properly.
Before running the server, copy or rename the .env-template file to .env, and edit it accordingly.
To run the server, go to the server directory and enter:
$ npm install
$ npm start
To run the client, go to the client/ecommerce directory and enter:
$ npm install
$ npm run serve
POST /api/users/login
email: registered email address
password: password associated with the specified email
POST /api/users/register
name: user's full name
email: user's email address
password: user's password
token: <token>
GET /api/products
GET /api/products/:productId
(requires an admin role)
POST /api/products
name : product name
description : product description
price : product price
(requires an admin role)
PUT /api/products/:productId
name : product name
description : product description
price : product price
(requires an admin role)
DELETE /api/products/:productId
GET /api/carts
GET /api/carts/:cartId
POST /api/carts
productId : id of the product which can be obtained from GET /api/products
amount : total amount of items to be purchased
DELETE /api/carts/:cartId
POST /api/transactions/checkout
GET /api/transactions
(requires an admin role)
GET /api/transactions/all
POST /api/trasactions/pay/:transactionId
(requires an admin role)
POST /api/trasactions/send/:transactionId
POST /api/trasactions/finish/:transactionId