Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apurva313/nodejs-voting-app
https://github.com/apurva313/nodejs-voting-app
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/apurva313/nodejs-voting-app
- Owner: apurva313
- Created: 2024-02-27T14:17:03.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-04T06:03:35.000Z (9 months ago)
- Last Synced: 2024-03-04T07:24:38.854Z (9 months ago)
- Language: JavaScript
- Size: 1.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS-Voting-App
This is a backend application for a voting system where users can vote for candidates. It provides functionalities for user authentication, candidate management, and voting.
## API Design
![Voting App API Design](<ππ£π ππ²ππΆπ΄π» π³πΌπΏ π©πΌππΆπ»π΄ ππ½π½ π£πΏπΌπ·π²π°π.jpg>)## Features
- User sign up and login with Aadhar Card Number and password
- User can view the list of candidates
- User can vote for a candidate (only once)
- Admin can manage candidates (add, update, delete)
- Admin cannot vote## Technologies Used
- Node.js
- Express.js
- MongoDB
- JSON Web Tokens (JWT) for authentication## Installation
1. Clone the repository:
```bash
git clone https://github.com/apurva313/NodeJS-Voting-App.git# API Endpoints
## Authentication
### Sign Up
- `POST /signup`: Sign up a user### Login
- `POST /login`: Login a user## Candidates
### Get Candidates
- `GET /candidates`: Get the list of candidates### Add Candidate
- `POST /candidates`: Add a new candidate (Admin only)### Update Candidate
- `PUT /candidates/:id`: Update a candidate by ID (Admin only)### Delete Candidate
- `DELETE /candidates/:id`: Delete a candidate by ID (Admin only)## Voting
### Get Vote Count
- `GET /candidates/vote/count`: Get the count of votes for each candidate### Vote for Candidate
- `POST /candidates/vote/:id`: Vote for a candidate (User only)## User Profile
### Get Profile
- `GET /users/profile`: Get user profile information### Change Password
- `PUT /users/profile/password`: Change user password