Skip to content

This Distributed Voting System is a real-time application built using Svelte for the frontend and Node.js, Express.js, Socket.IO, and NeDB on the backend. It allows users to vote on various polls, with the results updated in real-time via web sockets.

License

Notifications You must be signed in to change notification settings

MrJesseh/distributed-voting-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed Voting System

This Distributed Voting System is a real-time application built using Svelte for the frontend and Node.js, Express.js, Socket.IO, and NeDB on the backend. It allows users to vote on various polls, with the results updated in real-time via web sockets.

Features

  • Real-time vote updates using Socket.IO.
  • Simple and responsive user interface developed with Svelte.
  • Lightweight data storage with NeDB.
  • Efficient vote processing through an internal queuing system.

Prerequisites

Ensure you have Node.js installed on your machine to run the server. Node.js can be downloaded from Node.js official website.

Installation & Running the Project

  1. Clone the repository:
git clone https://github.com/MrJesseh/distributed-voting-system.git
  1. Make sure you are in the root folder /distributed-voting-system/

  2. Run the start script.

./start.sh

Then navigate to http://localhost:3000.

API Endpoints

GET /api/polls: Retrieves all available polls.

POST /api/polls: Submits a vote to a specific poll.

For the post request, the body should be as follows:

{
    "id": 1,
    "option": 1
}

Where id (number) is the id of the poll you are posting a vote to, and option (number) is the index of the option the person chose.

About

This Distributed Voting System is a real-time application built using Svelte for the frontend and Node.js, Express.js, Socket.IO, and NeDB on the backend. It allows users to vote on various polls, with the results updated in real-time via web sockets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published