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 servermock-server
: A sample Node REST API that expose two endpoints/items
andreviews
, both return data from statics json files insidedb
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
andname
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
- Go to http://localhost:4000 to interact with the Apollo server using GraphiQL
Demo
Users #1
Reviews #2
Deployed on Heroku.
- The app is deployed on Heroku. https://graphql-reviews-apollo-server.herokuapp.com/