Skip to content

Latest commit

 

History

History
159 lines (97 loc) · 3.7 KB

README.md

File metadata and controls

159 lines (97 loc) · 3.7 KB

Node.js Quiz

A Node.js quiz through a Node.js command line program. The program can be used directly in a command line environment or indirectly via webpage. The latter leverages WebSockets and Node child_process to pipe input and output between web client and command line environment. The webpage is served using Express.js.

Given this project involves both a command line program and a web app, there are two different interfaces and feature sets available. For example, the command line interface allows the choosing of topics, whereas the web app doesn't. See screenshots and local setups for each below.

View the web application

This program is based on a homework assignment for LaunchCode's Lc101 (2019). The assignment was named "Candidate Testing", which involved creating a trivia quiz on random topics (written in Node.js).

Table of Contents

View the web application

Technologies Used

  • JavaScript
  • HTML
  • CSS
  • Node
  • Express
  • Inquirer
  • Figlet
  • ws (WebSocket)
  • Docker

How to run locally

The steps below assume you have git, Node, and/or Docker installed on your machine. It is also assumed that you are executing commands from the root of this repository on your local machine.

Via web app

With Docker

Note: Confirm that Docker is running prior to proceeding and that port 8080 is not being used by another program.

  1. Clone this repository.
  2. cd into docker directory
cd /docker
  1. Build docker image and start container
docker compose up --build
  1. Visit http://localhost:8080

With Node

  1. Clone this repository.
  2. cd into /server directory
cd /server
  1. Install necessary dependencies via npm
npm install
  1. Start server
npm run start
  1. Visit http://localhost:8080

Via command line

With Node

  1. Clone this repository.
  2. cd into /server directory
cd /server
  1. Start command line program
npm run cli

Screenshots

Desktop

After help command

Quiz start

Quiz complete (fail)

Quiz complete (pass)

Mobile

After help command

Quiz start

Quiz complete (fail)

Quiz complete (pass)

Command Line

Choose command line topics to include in quiz

Quiz begun

Quiz in progress

Results