Skip to content

its-shivam1008/votingAppBackend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voting App

The backend of the voting application is developed using Node.js, Express, MongoDB, Mongoose, Bcrypt, JWT, and Body-Parser.

Features

  • Users can cast a vote for a candidate from a predefined list of candidates.
  • Users must sign in or sign up to participate.
  • Each user is allowed to vote for only one candidate.
  • Voting is limited to one instance per user.
  • A live vote count, sorted by the number of votes received, is available through a specific route.
  • User data must contain their one unique government id proof (Adhaar number in this project).
  • There is only Admin who will maintain the data of candidates.
  • Admin cannot able to vote at all.
  • Admin will register new candidates, can be able to update them (but not there vote count and votes) or remove a candidate.
  • only one Admin is allowed in the database.
  • User can update there information like password.
  • User can only login with his Adhaar number and Password.

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PORT

JWT_KEY

mongoUrl

Deployment

This app is deployed on render here its live link Deployment API Endpoint Diagram

End points

User

Post

  /user/signup

Post

  /user/login

GET

  /user/profile

Put

  /user/profile/:nameOfFieldToUpdate

GET

  /user/candidates

Admin

Post

  /admin/candidate

Get

  /admin/candidates

Put

  /admin/candidate/:nameOfFieldToUpdate/:candidateId

Delete

  /admin/candidate/:candidateId

Voting

Put

  /vote/:candidateId

Get

  /vote/count

About

This is the backend of the voting app, made with Nodejs, Express, MongoDB, Mongoose, JWT, bcrypt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors