GithubHelp home page GithubHelp logo

parmodkumar28 / polling-system-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 31 KB

Polling system consists questions and its options and we can vote on options and is a REST API based.

JavaScript 100.00%
backend backend-api expressjs jwt mongodb mongoose nodejs restapi-backend

polling-system-api's Introduction

Polling System API

Description

  • The Polling System API is a powerful platform designed to facilitate voting processes for questions and options. This API allows users to create, manage, and vote on questions, providing a flexible and scalable solution for polling needs.

Features

  • Creation of questions with multiple options
  • Adding, editing, and deleting options
  • Voting on options within a question
  • Comprehensive error handling for various scenarios
  • Easy-to-use RESTful endpoints

Installation Guide

Prerequisites

  • Node.js (v14.0.0 or higher)
  • MongoDB

Setup Steps

  1. Clone the repository:
  • git clone
  • cd polling-system-api
  1. Install dependencies:
  • npm install
  1. Set up environment variables:
  • Create a .env file in the root directory.
  • Add the following environment variables:
  • PORT=8000
  • MONGO_DB=
  1. Start the server:
  • npm start

API Routes

  • Create a Question:
  • Endpoint: POST /api/questions/create
  • Body: { "title": "Your Question Title" }

Add Option to Question:

  • Endpoint: POST /api/questions/:id/options/create
  • Params: id (Question ID)
  • Body: { "text": "Your Option Text" }

Get Question by ID:

  • Endpoint: GET /api/questions/:id
  • Params: id (Question ID)

Delete Question by ID:

  • Endpoint: DELETE /api/questions/:id/delete
  • Params: id (Question ID)
  • Options

Delete Option by ID:

  • Endpoint: DELETE /api/options/:id/delete
  • Params: id (Option ID)

Add Vote to Option:

  • Endpoint: GET /api/options/:id/add_vote
  • Params: id (Option ID)

You can get the github repository of this project also.

Github Repository:- https://github.com/ParmodKumar28/Polling-System-API Youtube Video:- https://youtu.be/7m4eu4MtjRQ?si=9UuMu9IAeeUwcRUo Hosted Url:- https://polling-system-api-50ap.onrender.com/

polling-system-api's People

Contributors

parmodkumar28 avatar

Watchers

 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.