nc-games-finale API

What's this then?

dentednerd's House of Games is a content rating and discussion website, featuring game reviews categorised by genre. Each review can be up- or down-voted, and users can comment and vote upon each review.

This is a proof of concept. Users can "login" as one of a set of preset profiles, in order to leave comments and to vote on other users' reviews and comments. It isn't possible to create a new review or user profile.

How did you build the back end?

The API, which is where you are now, is an Express server on top of a PostgreSQL database, hosted on fly.io.

Take a look at the back end repo on Github.

How did you build the front end?

The website is built in React, as always, with an Atomic Design approach to component creation. I took the opportunity to try out Stitches for the styling (capsule review: it's awesome, but sadly no longer maintained). The "login" implementation uses a combination of React Context and localStorage.

View the live site, hosted on Netlify.

Take a look at the front end repo on Github.

Routes

Method Description Queries
GET /api serves a JSON representation of all the available endpoints of this API
GET /api/categories serves an array of all categories
POST /api/categories adds a category
GET /api/reviews serves an array of all reviews category,sort_by,order,limit,p
GET /api/reviews/by/:username serves an array of all reviews by a given user category,sort_by,order,limit,p
POST /api/reviews adds a review
GET /api/reviews/:review_id serves a single review object
PATCH /api/reviews/:review_id updates the vote count on a review
DELETE /api/reviews/:review_id deletes a review
GET /api/reviews/:review_id/comments serves an array of comments on a given review sort_by,order,limit,p
POST /api/reviews/:review_id/comments adds a comment to a given review
PATCH /api/comments/:comment_id updates the vote count on a given comment
DELETE /api/comments/:comment_id deletes a given comment
GET /api/users serves an array of all users
GET /api/users/:username serves a single user object
GET /api/comments/by/:username serves an array of all comments by a given user