Skip to content

ImVictorM/Trivia-Game

Repository files navigation

Trivia Game 🧩

Project Context 💡

Quiz game with varying topics and a local ranking. The game consists of a round of 5 questions where the user can choose the theme, difficulty, and type of questions, which can be multiple choice or true/false. At the end of a round, the player can view their performance, and if it is good, they will be registered in a local ranking. This application supports two languages: English (en) and Portuguese (pt-BR). The translations were done mixing dynamic and static translation files. I used i18next for the static translations and Google Translate API for the dynamic translations (reference to APIs below).

Main Technologies used in this project 🧰

Static Badge Static Badge
Static Badge Static Badge Static Badge
Static Badge Static Badge

APIs used in this project 🌐

  • Open Trivia Database: The core API used in this project. that's where the questions for the game is coming from!
  • Gravatar: Used for getting players' image in an easy way.
  • Google translate: Used to translate some dynamic texts.

Running the application ⚙️

  1. Cloning and entering the repository

    git clone [email protected]:ImVictorM/Trivia-Game.git && cd Trivia-Game
  2. Install dependencies

    npm install
  3. Start the application

  • To start in development mode:

    npm run dev
  • To start in production mode:

    npm run build && npm run preview

Testing 🛠️

  • Running all tests:
    npm test
  • Running a specific test:
    npm test -t {test_file_name}
  • Running test coverage:
    npm run test:coverage
  • Running tests in the browser:
    npm run test:ui