Skip to content

rpt27-sdc-ldap/price-service

Repository files navigation

Price Service

Membership / Book Price Service on Audible

Table of Contents

1.1 Related Projects

1.2 Usage

The Price Service a component of a larger project to create a look-alike Audible Item Page built with a Service-Oriented Architecture. Price Service is a fullstack service that provides the price and membership information for an Audible item page.

Technologies Used:

  • React
  • Node.js
  • Express
  • MySQL
  • AWS EC2

Price Service Demo

  • Within the Item Page

Audible Item Page

Audible Item Page Mobile

1.2.1 API Endpoints

  • GET /api/price/:bookId
    • Given a bookId, retrieve its price.
  • GET /api/price/:bookTitle
    • Given a bookTitle, retrieve its price.
  • POST /api/price
    • Given a book_id, book_title and price, creates a new record in database.
  • PATCH /api/price/update
    • Given a book_id and price, updates the price of the matching id.
  • DELETE /api/price/:id
    • Given a book_id, deletes the record of matching id.

1.2.2 Deployed Web Address

Note: Only available when EC2 instance is running. See deployed service here

1.3 Requirements / Set Up

Requirements:

  • Node v14.15.0

1.3.1 Install MySQL

  1. Follow instructions for your platform in this link
  2. Start MySQL: mysql -u root -p and enter password specified in step 1

1.3.2 Setup Environment Variables

  1. Within root directory, create a .env file: touch .env
  2. Open the file and add the DB_USER and DB_PASS fields to access MySQL

1.3.3 Install Dependencies

  1. Within root directory, run npm install

1.3.4 Start Service

  1. Within root directory, create bundle file: npm run react-prod
  2. Within root directory, launch server: npm start

1.4 Backlog / Noted Opportunies

  • Enable RESTful client with path parameters instead of query parameters
  • Improve client accessibility

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •