Giter Club home page Giter Club logo

quizapp's Introduction

QuizApp

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.

Setup

To setup the given project follow the instructions separately for each -

Frontend : React

 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`

Backend: Go

 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>

Database -

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.

API Endpoints

The following are the Api endpoinst along with what they do

User table

  • GET :/people/ This sends the set of users
  • POST : /people This creates a new user
  • POST: /signin/ This is for login
  • GET : people/users/:username This sends a particular user info
  • DELETE : /people/:id This deletes a particular user

Quiz/Genre table

  • POST : /quiz/ This creates a new question
  • GET : /quiz/ This sends the set of questions
  • GET : /quiz/:qname This sends a particular quiz
  • GET : /quiz/:qname/:question This sends ta particular question
  • PUT : /quiz/:qname/:question This sends an update on a question
  • DELETE : /quiz/:genre/:qname/:question This deletes a qiven question
  • GET : /genres/ This sends the set of quiz
  • GET : /all-genres/ This sends all genres
  • GET : /genres/:genre This sends quiz of a particular genre
  • DELETE : /genres/:qname This deletes a particular quiz

Score table

  • POST : /score/ This adds a new score
  • PUT : /score/ Updates a pre-existing score
  • GET : /score/:username/:genre/:qname Gets a particular quiz score
  • GET : /score/ Gets all scores
  • GET : /score-genre/:genre Gets a particular genre score
  • GET : /score-users/:username Gets Quiz Scores based on username

Functionalities

Guest

  • Can Register
  • Can Login

User

  • Can Play Quiz
  • Can View Quiz Played By It
  • Can View Leaderboard of All Genres

Admin

  • Can Create Quiz
  • Can Delete Quiz
  • Can Update/Delete Questions is a Quiz
  • Can View all users and Delete Users
  • Questions can also have images

quizapp's People

Contributors

adhavalboy avatar avni-sharma avatar darthgera123 avatar jayashree-panda avatar nidhikjha avatar parammittal16 avatar sahilit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.