A Quiz Game written in golang.
Mini-Project made for the Summer Training program of my Uni
- Working example using ncurses library and C++
- Complete project using drogon framework
- Now. Rewrite in golang
As a novice in Go programming and Gin framework (and web development in general) I frequently referred to the go-banking-api project by Devansh. Thanks for being awesome!
We're going to need a postgres database to start. I've already included an SQL script to create the tables and add sample data into them.
- cd into project directory
- run the below script for user
postgres
who owns a databasequizgame
Feel free to change these values to your liking
psql -U postgres -d quizgame -a -f backend/scripts/database.sql
Quiz game uses the following environment variables to connect to a database.
Environment Variables |
---|
QZ_HOSTNAME |
QZ_USERNAME |
QZ_PASSWORD |
QZ_DBNAME |
export QZ_HOSTNAME="localhost"
export QZ_USERNAME="postgres"
export QZ_PASSWORD="PASSWORD"
export QZ_DBNAME="quizgame"
Run the build script after installing the dependencies (below)
sh build.sh
- cd into frontend
- install dependencies
yarn install
or
npm install
- cd into backend
- download dependencies
go get
You can also simply invoke individual build systems for both react and go.