Trivia NextJS

image image image image

A basic trivia application built with Next.js, Tailwind CSS, and TypeScript. This app fetches trivia questions from a local db.json file using the json-server npm library. It is intended for learning development purposes, providing an engaging way to test your knowledge across various topics.

Table of Contents

Introduction

This Trivia app provides multiple-choice questions on topics such as geography, literature, history, science, sports, etc. It features randomized answer options for each question and immediate feedback on the correctness of answers.

Features

  • Multiple categories.
  • Randomized answer options for each question.
  • Immediate feedback on the correctness of answers.
  • Simple and responsive user interface using Tailwind CSS.
  • State management with React hooks.

Installation

Prerequisites

  • Node
  • npm
  • json-server

Steps

  1. Clone the repository:

    git clone git@github.com:paulocsb/trivia-nextjs.git
  2. Navigate to the project directory:

    cd trivia-nextjs
  3. Install the dependencies:

    npm install
  4. Install json-server globally:

    npm install -g json-server
  5. Start the json-server:

    json-server --watch db/db.json --port 3004

Usage

Running the Project

To start the development server, run:

npm run dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.