Skip to content

Latest commit

 

History

History
130 lines (100 loc) · 5.89 KB

README.md

File metadata and controls

130 lines (100 loc) · 5.89 KB

COVIDA (PI Project)

Overview

Chelas Open VIDeogame Application (COVIDA) is a web application that allows users to search and browse videogames with the possibility of inserting and managing them into groups.

The groups are made by the user and are restricted to its owner. These can be customized with a name, description and a selection of games. The Web Application provides an authentication functionality for users to create and log into their accounts.

The application was developed in Node.js and uses the express module to handle HTTP requests. All the data is stored through the use of Elasticsearch. The information about videogames is gathered through the IGDB API.

Table of Contents

Functionalities

COVIDA exposes the following functionalities:

  • Functional and responsive Web Application to manage user created videogame groups
  • Accessible HTTP API in paths preceded with /api/covida
  • Authentication feature
    • Possibility to create accounts
    • Sign into your account
    • Delete your account
  • List the top videogames
    • Number of results shown can be customizable
    • Possibility to add videogames to groups
  • Search for videogames by name
  • Manage your groups
    • Create, Edit and Delete
    • Manage videogames (Add/Delete/List)

Preview

Authentication-Preview.mp4
Games-Preview.mp4
Groups-Preview.mp4

Requirements

Before running the application, the following steps are necessary:

Elasticsearch

The application requires to store information about the users and its respective videogame groups. In order to store this data, the NoSQL database Elasticsearch was chosen.

Before running the application, do the following steps:

  1. Download and unzip Elasticsearch from here
  2. Run bin/elasticsearch (or bin\elasticsearch.bat on Windows)

Make sure the Elasticsearch window is always open while running the Web Application

A more detailed guide is available here.

IGDB API

Twitch provides a free API which shares data about videogames. This data includes information such as videogames, their rating, number of followers, and much more.

In order to use the IGDB API there needs to be a registration of a Twitch Developer Application. With an application, a Client ID and Client Secret is provided. These two are necessary in order to obtain an access token that will be used to perform requests to the API.

COVIDA utilizes environment variables to store the IGDB application Client's ID and its respective access token. In order to obtain these, the following steps are required:

Create a Twitch Developer Application

  1. Sign Up to Twitch Developer Console here
  2. Ensure your twitch account has Two Factor Authentication enabled
  3. Register your application
  4. Manage your newly created application
  5. Generate a Client Secret by pressing [New Secret]
  6. Take note of the Client ID and Client Secret

Request an Access Token

To obtain an Access Token make a POST request to https://id.twitch.tv/oauth2/token with the following query string parameters, substituting your Client ID and Client Secret accordingly.

client_id=Your_Client_ID
client_secret=Your_Client_Secret
grant_type=client_credentials

A more detailed guide is available here.

Setup the Environment Variables

After retrieving the application Client's ID and a valid access token, setup the following environment variables:

COVIDA_CLIENT_ID=YOUR_CLIENT_ID
COVIDA_AUTHORIZATION=YOUR_ACCESS_TOKEN

Run The Application

After setting up all the requirements, the application can be run. Make sure Node.js is installed on your machine!

Install the dependencies

Firstly, the application dependencies need to be installed.

To do this, execute the following command in the /app directory:

npm install

Run the tests

To assure the application functions correctly there were developed unit tests and integration tests.

Although not necessary, if you desire to run the tests, execute the following command:

npm run test

Run the Web Application

The Web Application provides two optional parameters to run the App:

  • The port where the HTTP Server communicates (8000 if omitted)
  • The Elasticsearch index used to store data ('covida-groups' if omitted)

There are two ways to change the default port. You can either define the environment variable COVIDA_PORT or put it as a first argument while running the application. The Elasticsearch index used can be changed through the second argument.

To run the web application, execute the following command:

npm start [PORT] [ELASTICSEARCH_INDEX]

Credits

This application was developed for the Internet Programming class (5th semester) at ISEL.

Developed by: