Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 1.96 KB

File metadata and controls

46 lines (27 loc) · 1.96 KB

Frontend - Trivia API

Getting Setup

tip: this frontend is designed to work with Flask-based Backend so it will not load successfully if the backend is not working or not connected. We recommend that you stand up the backend first, test using Postman or curl, update the endpoints in the frontend, and then the frontend should integrate smoothly.

Installing Dependencies

  1. Installing Node and NPM This project depends on Nodejs and Node Package Manager (NPM). Before continuing, you must download and install Node (the download includes NPM) from https://nodejs.com/en/download.

  2. Installing project dependencies This project uses NPM to manage software dependencies. NPM Relies on the package.json file located in the frontend directory of this repository. After cloning, open your terminal and run:

npm install

tip: npm iis shorthand for `npm install``

Required Tasks

Running Your Frontend in Dev Mode

The frontend app was built using create-react-app. In order to run the app in development mode use npm start. You can change the script in the package.json file.

Open http://localhost:3000 to view it in the browser. The page will reload if you make edits.

npm start

Request Formatting

The frontend can request a json object request body to the API.

Endpoints and API behavior

All endpoints will return a json object response body.

Game Play Mechanics

There are five quizzes will appear for option all categories. Quizzes that appear in specific category depends on how much data with specific category stored in database. If it's more than five, then it will appear five quizzes. But if it's less than or equal to five, then all of them will appear.

Contribute

If you want to make contributions to the frontend, you can work in '/src/components'. For example, you want to edit the style, and adding more interactive buttons.