GithubHelp home page GithubHelp logo

techreagan / quiz-restful-api Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 6.0 101 KB

A quiz restful api with multiple and single choice options comprising of many questions in many categories. It has a public and admin route where admin can create questions and options etc.

JavaScript 100.00%
quiz-api nodejs expressjs mongodb restful-api

quiz-restful-api's Introduction

Quiz RESTful API

A quiz restful api with multiple and single choice options comprising of many questions in many categories. It has a public and admin route where admin can create questions and options etc.

Features

CRUD (Create, Read, Update And Delete)

  • Authentication with JWT (Reset Password with email)
    • Login (User/Admin)
    • Register
    • Forgot Password
  • Admin Routes
    • CRUD Operations questions and options
    • CRUD operations for categories
    • CRUD operations for users
  • Pagination and search where necessary
  • API Security (NoSQL Injections, XSS Attacks, http param pollution etc)

API Documentation

Hosted on netlify: Coming Soon

Extensive and testing documentation with postman: Quiz API

Database Model

Though the diagram uses sql data type, this diagram is to show you the various collections in the mongo database.

Screenshot

Requirement

  • NodeJS
  • MongoDB

Configuration File

Rename the config/.env.example to .env, then modify to your environment variables, mongodb uri, set your JWT_SECRET and SMTP variables

NODE_ENV=development
PORT=3001

MONGO_URI=YOUR_URL

JWT_SECRET=YOUR_SECRET
JWT_EXPIRE=30d
JWT_COOKIE_EXPIRE=30

SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=2525
SMTP_EMAIL=
SMTP_PASSWORD=
FROM_EMAIL=[email protected]
FROM_NAME=QuizzApp

Email testing: use mailtrap for email testing, it's easy no stress.

Installation

Install all npm dependecies

npm install

Install nodemon globally

npm install -g nodemon

Run database seeder

  • Seeder folder is _data/
  • Edit the seeder file if you want to
node seeder -i

Delete all data

node seeder -d

Start web server

node run dev

License

This project is licensed under the MIT License

Developed by Reagan Ekhameye (Tech Reagan)

Reach me on twitter @techreagan

quiz-restful-api's People

Contributors

techreagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

quiz-restful-api's Issues

missing module?

I have followed your instructions. When I start with
node run dev
I get an error saying module doesn't exist

I checked to see if it was in the list:

npm list -g
/usr/local/share/nvm/versions/node/v20.5.0/lib
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
= no joy

then

I tried manually installing it:

$ npm install quiz-restful-api
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/quiz-restful-api - Not found
npm ERR! 404
npm ERR! 404 'quiz-restful-api@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: /home/codespace/.npm/_logs/2023-08-18T13_08_08_997Z-debug-0.log
=no joy

Please advise.

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.