/quizify-v2

A quiz site that can be used to create and host live quiz sessions

Primary LanguageJavaScriptGNU General Public License v2.0GPL-2.0

Quizify

A quiz site that can be used to create and host live quiz sessions

Click on this link to go to the repo for the original v1 of this project. It got complicated with React and CORS issues.

Pre-requisites

  1. NodeJS
  2. NPM
  3. Web Browser
  4. MariaDB
  5. MongoDB

Resources

  1. ER Diagram
  2. ChatGPT describing the DataBase schema

How to run it locally

  1. Setup MariaDB and MongoDB

    1. create the mariadb database using the mariadb-init.sql file

         mariadb -u username -p
         # create the database
         CREATE DATABASE IF NOT EXISTS quizify;
         exit
      
         mariadb -u username -p quizify < ./database-init/mariadb-init.sql
    2. create the MongoDB database using the mongo-init.sql file

         mongosh < ./database-init/mongo-init.js
  2. Install node dependencies

    npm i
  3. Create the local .env file

       NODE_ENV=development
       MONGO_URI=mongodb://mongodb:27017/quizify
       DB_PASSWORD=your_mongo_pass
       PORT=4000
       DB_HOST=::
       DB_PASSWORD=your_mariadb_pass
       DB_NAME=quizify
       DB_USER=your_mariadb_username
       JWT_SECRET=your_jwt_secret
  4. Run the Server

       npm run dev
  5. Open the website that is running on http://localhost:4000

       firefox http://localhost:4000 # for firefox users
       google-chrome-stable http://localhost:4000 # chrome users
       echo "any other browser (except maybe Brave) should be banned"

Collaborators

Due to the nature of this project (individual project to present as the final project to receive this BCA degree), I have to work on it alone. Do provide insights and suggestions, if any.

Developers Notes

  1. Access the mariadb

          mariadb -u root -p
  2. If you get an error that mariadb that stopped the server from accessing mariadb, even if the credentials and port number are correct, you should try to allow mariadb to be bound from ipv6

       sudo nvim /etc/mysql/mariadb.conf.d/50-server.cnf
       #replace `bind-address = 127.0.0.1` with `bind-address = ::`
       sudo systemctl restart mariadb.service

License

GNU General Public License v2.0