A quiz site that can be used to create and host live quiz sessions
-
Setup MariaDB and MongoDB
-
create the mariadb database using the
mariadb-init.sql
filemariadb -u username -p # create the database CREATE DATABASE IF NOT EXISTS quizify; exit mariadb -u username -p quizify < ./database-init/mariadb-init.sql
-
create the MongoDB database using the
mongo-init.sql
filemongosh < ./database-init/mongo-init.js
-
-
Install node dependencies
npm i
-
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
-
Run the Server
npm run dev
-
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"
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.
-
Access the mariadb
mariadb -u root -p
-
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