{"id":20552354,"url":"https://github.com/chetan3010/votingapp","last_synced_at":"2026-01-30T21:02:44.919Z","repository":{"id":259138944,"uuid":"784232044","full_name":"Chetan3010/votingApp","owner":"Chetan3010","description":"VotingApp API is a robust backend service for managing a voting system. It provides endpoints for user authentication, candidate management, and vote tracking.","archived":false,"fork":false,"pushed_at":"2024-09-30T13:50:33.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T06:02:16.695Z","etag":null,"topics":["bcrypt","express","jwt","nodejs"],"latest_commit_sha":null,"homepage":"https://voting-app-nine-eta.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chetan3010.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-09T12:56:10.000Z","updated_at":"2024-11-19T04:52:24.000Z","dependencies_parsed_at":"2024-11-07T08:15:36.219Z","dependency_job_id":"e6e2970f-550a-4c46-b9d5-b1d85ba640d8","html_url":"https://github.com/Chetan3010/votingApp","commit_stats":null,"previous_names":["chetan3010/votingapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Chetan3010/votingApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chetan3010%2FvotingApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chetan3010%2FvotingApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chetan3010%2FvotingApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chetan3010%2FvotingApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chetan3010","download_url":"https://codeload.github.com/Chetan3010/votingApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chetan3010%2FvotingApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28919362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcrypt","express","jwt","nodejs"],"created_at":"2024-11-16T02:35:55.685Z","updated_at":"2026-01-30T21:02:44.903Z","avatar_url":"https://github.com/Chetan3010.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VotingApp API\n\nVotingApp API is a robust backend service for managing a voting system. It provides endpoints for user authentication, candidate management, and vote tracking.\n\n## 🌟 Features\n\n- 👤 User authentication and profile management\n- 🗳️ Candidate creation, updating, and deletion (admin only)\n- 🗽 Voting functionality\n- 📊 Vote counting and results\n\n## 🛠️ Technologies Used\n\n- Node.js\n- Express.js\n- MongoDB with Mongoose\n- JWT (JSON Web Tokens) for authentication\n- bcrypt for password hashing\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (v14+ recommended)\n- MongoDB\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/Chetan3010/votingApp.git\n   cd votingapp\n   ```\n\n2. Install dependencies:\n   ```\n   npm install\n   ```\n\n3. Set up environment variables:\n   Create a `.env` file in the root directory and add the following:\n   ```\n   mongoDbURL=your_mongodb_connection_string\n   JWTSECRETKEY=your_jwt_secret_key\n   ```\n\n4. Start the server:\n   ```\n   npm start\n   ```\n\nThe API will be available at `http://localhost:3000`.\n\n## 📚 API Endpoints\n\n### User Management\n\n* **POST /signup**\n  - Create a new user account\n  - Body: `{ \"name\": \"string\", \"age\": \"number\", \"aadharNo\": \"number\", \"mobile\":\"string\", \"email\":\"string\", \"address\":\"string\", \"password\":\"string\", \"role\": \"enum\" }`\n\n* **POST /signin**\n  - Sign in and get a JWT token\n  - Body: `{ \"aadharNo\": \"number\", \"password\": \"string\" }`\n\n* **GET /profile**\n  - Get user profile details\n  - Requires JWT authentication\n\n* **PUT /profile/password**\n  - Update user password\n  - Requires JWT authentication\n  - Body: `{ \"password\": \"string\" }`\n\n### Candidate Management\n\n* **POST /**\n  - Create a new candidate\n  - Admin only, requires JWT authentication\n  - Body: `{ \"name\": \"string\", \"party\": \"string\", \"age\": \"number\" }`\n\n* **PUT /:candidateId**\n  - Update candidate details\n  - Admin only, requires JWT authentication\n  - Body: `{ \"name\": \"string\", \"party\": \"string\", \"age\": \"number\" }`\n\n* **DELETE /:candidateId**\n  - Delete a candidate\n  - Admin only, requires JWT authentication\n\n* **GET /**\n  - Get list of all candidates\n  - Public endpoint\n\n### Voting\n\n* **POST /vote/:candidateId**\n  - Vote for a candidate\n  - Requires JWT authentication\n\n* **GET /vote/counts**\n  - Get vote counts sorted by number of votes\n  - Public endpoint\n\n## 🔐 Authentication\n\nThis API uses JWT for authentication. To access protected endpoints, include the JWT token in the Authorization header:\n\n```\nAuthorization: Bearer YOUR_JWT_TOKEN\n```\n\nProject Link: [https://github.com/Chetan3010/votingapp](https://github.com/Chetan3010/votingapp)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetan3010%2Fvotingapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchetan3010%2Fvotingapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetan3010%2Fvotingapp/lists"}