Skip to content

sgortz/questions-answers-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express.js NodeJS Postgres AWS

Project Overview

This application was made to support the frontend of an online retail store. The goal of this project is to replace the existing API with a backend system that can support the full data set for the project and can scale to meet the demands of production traffic.

Each member of the team was responsible for implementing different services of the application for a faster turnaround following the microservices architecture pipeline.

  • Sabrina Gortz: Customer Q&A API
  • Trevor Edwards: Customer Review API
  • Will Atwood: Products Catalog and Storage API

Questions and Answers API

This RESTful API handles questions and answers submitted by the customers about a specific product being displayed on the page. It also handles uploads of photos by users when answering questions, as well as keeping track of helpfulness votes and being able to report a question or an answer, which in this case deletes the entry from the database.

The database schema are contained in /database

The node server is contained entirely in /server

It enters on index.js and follows the MVC pattern until interaction with the database.

Run the App

npm start

API Endpoints

GET /questions

Returns a list questions available for a specific product

Parameters

Parameter Type Description
page Integer Selects the page of results to return. Default 1.
page_size Integer Specifies how many results per page to return. Default 5.

GET /questions/:question_id/answers

Returns all answers written by users to a specific question relating to the current product displayed.

Parameters

Parameter Type Description
question_id Integer Required ID of current product's question for which data should be returned.

POST /questions

Inserts a new question to the database for the given product.

Parameters

Parameter Type Description
product_id Integer Required ID of the product for the question to be submitted

Response

201 Created

POST /answers/:question_id/answers

Inserts a new answer to the database for the given question of the display product.

Parameters

Parameter Type Description
question_id Integer Required ID of the product's question for the answer to be submitted

Response

201 Created

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.2%
  • PLpgSQL 20.8%