The Video Game API

Welcome to the Video Game API! A small portfolio project to showcase my skills in the following technologies:

  • NextJS
  • TypeScript
  • Node
  • MongoDB
  • Mongoose
  • TailwindCSS
  • DaisyUI

Looking for the GitHub repo? Check out the link below!

The GitHub repo also has a JSON Postman collection, which can be used to send requests to the API. There are some example requests below.

API Documentation

Endpoints

GET

Retrieves a list of all games in the database.

Example request

curl --location 'http://localhost:3000/api/videogame'

POST

Creates a new video game in the database.

Example request:

curl --location 'http://localhost:3000/api/videogame' \
            --header 'Content-Type: application/json' \
            --data '{
                "title": "Teleroboxer",
                "platform": "Virtual Boy",
                "developer": "Nintendo",
                "releaseDate": "1995-07-21"
            }'

PATCH

Updates an existing video game in the database.

Example request:

curl --location --request PATCH 'http://localhost:3000/api/videogame'                   --header 'Content-Type: application/json'                   --data '{
                      "id": "68f132db91b7c422b855f547",
                      "newTitle": "Super Smash Bros. Melee",
                      "newPlatform": "GameCube",
                      "newDeveloper": "Nintendo",
                      "newReleaseDate": "2001-11-21"
                  }'

DELETE

Deletes a video game from the database.

Example request

curl --location --request DELETE 'http://localhost:3000/api/videogame?gameId=68f3618fe2a8856bd22843ad'