GithubHelp home page GithubHelp logo

narikenabilli / quiz-app-in-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nithintata/quiz-app-in-nodejs

0.0 1.0 0.0 154 KB

A quiz app with admin privileges using node js and mongodb. Here admin can be able to create a quiz with various instructions regarding the quiz, questions, answers, explanations and duration for the quiz. At any point of time admin can update, delete, enable or disable any quiz or question

JavaScript 98.41% CSS 0.46% Pug 1.13%

quiz-app-in-nodejs's Introduction

Quiz App

A quiz app with admin privileges working on node js and mongodb

Problem Statement


Create a quiz app for an educational institute where they can do following.

Admin should be able to create quiz with various instructions regarding the quiz, questions, answers, explanations and duration for the quiz.

At any point of time admin can enable or disable the quiz itself.

At any point of time admin can enable or disable any question.

At any point of time admin can add, remove or edit the question for an existing quiz.

Apart from the admin rest of the users can only see the quiz and questions.

Implementation


1. The database schema for the above problem statement is located at models/quizes.js file

2. There are four different REST api's for performing various operations

  • localhost:3000/quizes --> for getting list of all quizes, creating a quiz, Removing all quizes
  • localhost:3000/quizes/:quizId --> for getting details of a quiz, updating content of a quiz, deleting a quiz
  • localhost:3000/quizes/:quizId/questions --> for getting questions of a quiz, adding a question, deleting all questions from quiz
  • localhost:3000/quizes/:quizId/questions/:questionId --> getting a question, updating a question, deleting a question

3. The implementation of these end points can be found in routes/quizRouter.js file.

4. All the Post, Put, Delete operations needs to be authorized by providing username and password (username: admin, Password: password). This means only admin can create, update or delete a quiz/question

5. The implementation of authorization step can be found in authenticate.js file in the root folder

6. Cookies are implemented to avoid the need of repeated authorization for admin

7. The user can only see the questions/quizes that are enabled by the admin. This is implemented by filtering the retrieved content from database by respective queries.

Deployment steps


  • Clone the entire repository to a new folder on desktop
  • Open the command prompt from the same folder and type npm install. This will download all the required dependencies which are present in package.json file
  • Now open the mongodb terminal and create a new database named quiz. All the quizes and questions will be stored here.
  • All the logs will be stored in logs/app.log file
  • For doing unit tests type the command npm run test. This will do the unit tests on different end points for sanity checking.
  • To start the server enter the command npm start

quiz-app-in-nodejs's People

Contributors

nithintata avatar depfu[bot] avatar restyled-commits avatar dependabot[bot] avatar braineanear avatar

Watchers

James Cloos 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.