This application is a management system for a quiz website. You are able to log in as either an admin, viewer or basic user and create, edit and delete quizzes.
This is the final assessment for my BCS Level 4 Software Engineering Apprenticeshop.
The following README is written in the recommended order for setting up your project.
This application uses a [Handlebars] [Express] templating package.
In a location of your choice, in a bash
, zsh
or powershell
Terminal:
git clone https://github.com/Looease/bcs-quiz-manager.git
Assuming you have Node.js and NPM installed, in that location, in Terminal:
npm install
This will add predefined package dependencies.
- The app is set to run on localhost 3000
- The database is set to run on localhost 5432
Create a .env
file in the root of the project directory
Database:
- USER =[postgres user]
- PASSWORD=[postgres password - optional]
Security:
- AUTH_SECRET=[AUTH secret for login security]
Assuming you have Postgres installed, in Terminal:
psql postgres
Once Postgres is running, in Terminal:
CREATE DATABASE [quizmanagerdb or db name of your choice];
To connect to the database:
\c quizmanagerdb;
You can now INSERT
the SQL found in the models
folder by copying and pasting the content of the scripts into the Postgress terminal. The database is structured with foreign keys, therefore the scripts need to be inserted in the following order:
quizzes
questions
answers
It's time to add some users.
Run the Create table
script in users.sql
users
Exit the database with \q
Use migration script below to add users.
In a bash
or zsh
terminal, cd
(change directory) to ../migrations
Run
node addUser.js
This creates admin, view and restricted users with encrypted passwords.
To run the application enter the following into the terminal
npm start
The appication uses nodemon
which lets you run, watch, and edit the application without needing to re-start.