/graphql-reviews

A Typescript GraphQL Backend that allows to collect user reviews ❤️

Primary LanguageTypeScript

GraphQL-Reviews

A Graphql backend that allows to manage users reviews. 🚀

File structure

The app is split out into two folders:

  • graphql-backend: The GraphQL backend that run an apollo server
  • mock-server: A sample Node REST API that expose two endpoints /items and reviews, both return data from statics json files inside db folder

Results

  • GraphQL schema
  • Typedefs of clients API
  • Resolvers written in typescript
  • Display users with their average rate (score)
  • For each member, display reviews in anti-chronological order
  • Allows user to filter review per rate (1,2,3,4,5)
  • Members with no review are not included in results
  • One year old reviews are ignored from results
  • User personals informations are hidden as required, only the user id and name are displayed
  • Non assigned reviews are not included in results
  • Cursor pagination is done as per required

Installation

  • Clone the repository
$ git clone https://github.com/Doha26/graphql-reviews.git
  • Start the mock server on the PORT 3000:
cd graphql-reviews/mock-server && yarn && yarn start
  • Start the GraphQL server :
cd graphql-reviews/graphql-backend && yarn
  • Create .env file at the root of graphql-backend folder and add the followings values
BASE_API_URL =  'http://localhost:3000/'
PORT=4000
APOLLO_INTROSPECTION=true
APOLLO_PLAYGROUND=true
  • Start the Apollo server. At the root of graphql-backend run the command
yarn start
  • You will see the output below
Server is running!
Litening on port 4000
Explore at http://localhost:4000

Demo

Users #1

App-demo

Reviews #2

App-demo

Deployed on Heroku.