Skip to content

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 child_process to pipe IO between web client and command line environment. The webpage is served using Express.js.

Notifications You must be signed in to change notification settings

theodoremoreland/NodeJsQuiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Visit the live deployment here

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

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

About

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 child_process to pipe IO between web client and command line environment. The webpage is served using Express.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published