https://github.com/laughingclouds/quizgame
A web based quiz game
https://github.com/laughingclouds/quizgame
game gin golang postgres reactjs reactrouter6
Last synced: 3 days ago
JSON representation
A web based quiz game
- Host: GitHub
- URL: https://github.com/laughingclouds/quizgame
- Owner: laughingclouds
- License: mit
- Created: 2022-03-01T06:03:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-14T12:21:38.000Z (about 2 months ago)
- Last Synced: 2025-12-16T17:14:44.964Z (about 2 months ago)
- Topics: game, gin, golang, postgres, reactjs, reactrouter6
- Language: JavaScript
- Homepage:
- Size: 2.71 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# quizgame
A Quiz Game written in golang.
> Mini-Project made for the Summer Training program of my Uni
## History
1. [Working example using ncurses library and C++](https://github.com/laughingclouds/quizgame/tree/917462b)
2. [Complete project using drogon framework](https://github.com/laughingclouds/quizgame/tree/def7792)
3. Now. Rewrite in golang
## Acknowledgement
As a novice in Go programming and Gin framework (and web development in general) I frequently referred to the [go-banking-api](https://github.com/Devansh3712/go-banking-api) project by [Devansh](https://github.com/Devansh3712). Thanks for being awesome!
## Database
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 database `quizgame`
> Feel free to change these values to your liking
```bash
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 |
```bash
export QZ_HOSTNAME="localhost"
export QZ_USERNAME="postgres"
export QZ_PASSWORD="PASSWORD"
export QZ_DBNAME="quizgame"
```
## Build
Run the build script after installing the dependencies ([below](###Install-Dependencies))
```bash
sh build.sh
```
### Install Dependencies
#### Frontend
- cd into frontend
- install dependencies
```bash
yarn install
```
or
```bash
npm install
```
#### Backend
- cd into backend
- download dependencies
```bash
go get
```
### Alternative
You can also simply invoke individual build systems for both react and go.