Skip to content

ryan-jm/gamecritic

Repository files navigation

GameCritic

Website Status Total Lines Build Status LGTM Grade

A simple, RESTful API created to learn Express and Postgres

Explore

Table Of Contents

Overview

The purpose of this API is to enable me to learn about utilising Express.js and PostgreSQL and how to utilise them in conjunction to create a stable API with a plethora of endpoints, with versatile queries and parameters on each endpoint. The API is considered a RESTful API with stateless requests and a uniform interface.

Concepts I have learned from this project:

  • How to set up different environments and databases for production, development and testing.

  • How to structure complex SQL queries utilising sanitised, dynamic user-inputs.

  • The MVC pattern.

  • Testing asynchronous code with Jest.

  • Hosting with Heroku.

  • How to utilise JWTs for authentication.

Built With

JavaScript Express Postgres Jest JWT

Getting Started

If you would like to view this API, you can click here to view and interact with it through your browser (Firefox/Chrome recommended for the built-in JSON prettier). Alternatively, you can follow the steps below to have it operating locally on your machine.

Prerequisites:

  • Fork and clone the repository on your machine.

  • Make sure you have Node >v14.x and the latest version of PostgreSQL installed.

Installation:

  • cd into the cloned repo and run npm install to install the dependencies.

  • Once all dependencies are installed, create a .env.test and .env.development file within the root directory of the cloned repo and follow the structure set out in .env-example.

  • Once the .env files have been created, run the npm run setup-dbs command followed by npm run seed to create and populate the necessary tables.

  • Finally, run npm test to make sure that all of the tests are passing.

Note: you can use the npm run dev command to start the server and explore the API with an API client such as Insomnia or Postman.

Usage

Make a GET request to /api to view all of the available endpoints and their queries/parameters, as well as example responses.

Roadmap

  • Integrate JWT authorization to protect endpoints. Done.

  • Implement image storage and random generation of images for categories.

  • Add more endpoints.

License

This API is released under the terms of MIT License. For more details click here.

Acknowledgements

Thanks to the whole team at Northcoders for providing such an incredible learning environment, and a notable mention to Chipie for such a comprehensive code review.

About

A simple, RESTful API created to learn Express and Postgres

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 18