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.
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).
- JavaScript
- HTML
- CSS
- Node
- Express
- Inquirer
- Figlet
- ws (WebSocket)
- Docker
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.
Note: Confirm that Docker is running prior to proceeding and that port 8080
is not being used by another program.
- Clone this repository.
- cd into
docker
directory
cd /docker
- Build docker image and start container
docker compose up --build
- Visit http://localhost:8080
- Clone this repository.
cd
into/server
directory
cd /server
- Install necessary dependencies via
npm
npm install
- Start server
npm run start
- Visit http://localhost:8080
- Clone this repository.
cd
into/server
directory
cd /server
- Start command line program
npm run cli