Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 1.82 KB

README.md

File metadata and controls

85 lines (65 loc) · 1.82 KB

E-Commerce Product Page - Product Features Microservice

An e-commerce application built on SOA principles allowing users to find and purchase products

Related Projects

Table of Contents

  1. Usage
  2. Requirements
  3. Development

Usage

Start the server (port 4000) -

npm start

Bundle with webpack (watch mode) -

npm run build

Seed SQL DB (PostgreSQL) -

npm run seed-sql

Seed NoSQL DB (CouchDB) -

npm run seed-nosql

Run stress tests (artillery.io) -

npm run stress-test-get
npm run stress-test-post

Clean the DB out after testing (deletes every record with ID over 10,000,000) -

npm run clean-db

Crud API

  • POST

Endpoint: "/product-features" Required body: record to insert Response: Will return 200 if successul, 500 unsuccessful

  • GET

Endpoint: "/product-features/:id" Required body: NA Response: Will return 200 and response data if successul, 500 if unsuccessful Response data format: { productId: INTEGER, banner: OBJECT, features: ARRAY, featureSetup: OBJECT, additionalFeatures: OBJECT }

  • PUT

Endpoint: "/product-features/:id" Required body: productId to update, JSON of updates to make in this format - { productId: product_id, updates: { updates_to_make }} Response: Will return 200 if successul, 500 if unsuccessful

  • DELETE

Endpoint: "/product-features/:id" Required body: productId to delete Response: Will return 200 if successul, 500 if unsuccessful

Requirements

An nvmrc file is included if using nvm.

  • Node 6.13.0
  • Postgres 13.2
  • CouchDB 3.1.1

Development

Installing Dependencies

From within the root directory:

npm install -g webpack
npm install -g nodemon
npm install