The given quizapp has been made in Go and React. This Readme is a walkthrough off all API endpoints as well as functionalities if any added.
To setup the given project follow the instructions separately for each -
Download the project
In cmd navigate to the folder using command `cd react-app`
Run `yarn install` to install all dependencies
If no error is encountered then run `yarn start`
OR
If npm is already installed on your system then
`cd react-app`
`npm install`
`npm start`
Download the project
In cmd navigate to Go Folder using command `cd go`
Install the following libraries for it to run -
- "github.com/gin-contrib/cors"
- "github.com/gin-gonic/gin"
- "github.com/jinzhu/gorm"
- "github.com/jinzhu/gorm/dialects/sqlite"
- "golang.org/x/crypto/bcrypt"
To set your GOPATH add these lines into ~/.bashrc
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
Install packages by run go get -u <name of package>
The project uses sqlite3 for RDBMS and has teh following tables
SNo | Table | Brief Description |
---|---|---|
1 | Users | List of Registered Users, alpha is admin |
2 | Quiz | List of question pertaining to a quiz and the answers |
3 | Genres | List of Genres |
4 | QGenres | List of Quiz within each Genre |
5 | Score | List of Scores of each user played |
Alpha
is the admin username
Password is sad
. This wasnt hashed while the rest were.
The following are the Api endpoinst along with what they do
/people/
This sends the set of users/people
This creates a new user/signin/
This is for loginpeople/users/:username
This sends a particular user info/people/:id
This deletes a particular user/quiz/
This creates a new question/quiz/
This sends the set of questions /quiz/:qname
This sends a particular quiz/quiz/:qname/:question
This sends ta particular question/quiz/:qname/:question
This sends an update on a question/quiz/:genre/:qname/:question
This deletes a qiven question/genres/
This sends the set of quiz/all-genres/
This sends all genres/genres/:genre
This sends quiz of a particular genre/genres/:qname
This deletes a particular quiz/score/
This adds a new score/score/
Updates a pre-existing score/score/:username/:genre/:qname
Gets a particular quiz score/score/
Gets all scores/score-genre/:genre
Gets a particular genre score/score-users/:username
Gets Quiz Scores based on username