Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nonuabi/polling-system-api
It's an API where anyone can create questions with options and also add votes to it.
https://github.com/nonuabi/polling-system-api
api javase mongodb-atlas nodejs
Last synced: 2 days ago
JSON representation
It's an API where anyone can create questions with options and also add votes to it.
- Host: GitHub
- URL: https://github.com/nonuabi/polling-system-api
- Owner: nonuabi
- Created: 2021-09-10T16:41:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-11T17:57:41.000Z (about 3 years ago)
- Last Synced: 2024-09-25T01:43:38.897Z (2 days ago)
- Topics: api, javase, mongodb-atlas, nodejs
- Language: JavaScript
- Homepage:
- Size: 406 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Polling-System-API
### API : https://polling-system-api.herokuapp.com/
### Introduction
> It's an API where anyone can create questions with options and also add votes to it.
> Authentication is not needed.### How to setup the project on local system
1. Clone this project
2. Start by installing npm if you don't have it already.
3. Navigate to Project Directory by :
~~~
cd Polling-System-API
~~~
4. run following commands:
~~~
npm install
nodemon index.js
~~~### Features
* Create a Question (You can add as many questions as you want)
* Required Routes `/questions/create`
![](assets/img/addNewQuestion.jpg)
* Add options to a question
* Required Routes `/questions/:id/options/create`
![](assets/img/addNewOption.jpg)
* Add a vote to an option of question
* Required Routes `/options/:id/add_vote`
![](assets/img/add_vote.jpg)
* Delete a question → A question can’t be deleted if one of it’s options has votes
* Required Routes `/questions/:id/delete `
![](assets/img/deleteQuestion.jpg)
* DadaBase before delete a question
![](assets/img/beforeDeletion.jpg)
* DadaBase after delete a question
![](assets/img/afterDeletion.jpg)
* Delete an option → An option can’t be deleted if it has even one vote given to it
* Required Routes `/options/:id/delete`
![](assets/img/deleteOption.jpg)
* View a question with it’s options and all the votes given to it
* Required Routes `/questions/:id `
![](assets/img/fetchQuestion1.jpg)
![](assets/img/fetchQuestion2.jpg)### Directory Structure
`/config` - MongooDB Atlas Configuration
`/controllers` - questions & option controllers code
`/model` - question & option schemas
`/routes` - question & option routes
`index.js` - entry file