Skip to content

Dhruvdevel/votetosurvive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 

Repository files navigation

Vote To Survive

A real-time multiplayer elimination voting game built using Node.js, Express, and Socket.IO. Participants vote between two options, and the majority gets eliminated — only those who think differently survive.

The app supports live polling, admin controls, real-time result display, and participant management.

How the Game Works

Participants join the game using:

Name

Valid Student ID

Room password

The Admin sends a question with two choices: Option A or Option B

Players vote.

When the admin reveals results:

Majority voters are eliminated

Players who did not vote are also eliminated

If the vote is tied → nobody is eliminated

The game continues until only one player remains.

Features Player Features

Join using name + validated student ID

ID validation (case-insensitive):

25ucsxxx 25uccxxx 25uecxxx 25umexxx 25dcsxxx 25decxxx

Auto-login after refresh

Logout option

Vote buttons disabled until poll starts

Vote buttons disabled after voting

Real-time question updates

Eliminated players are notified instantly

Admin Features

Secure admin login

Send questions to all participants

Start / Stop poll

Lock / Unlock entries

View live results

View survivors

Manually eliminate players

Control voting rounds

Live Poll Dashboard

A separate live results page displays:

Real-time voting percentages

Animated progress bars

Password protected view

Perfect for projecting results during events.

Technologies Used Technology Purpose Node.js Backend server Express API server Socket.IO Real-time communication HTML / CSS / JS Frontend Render Deployment Project Structure VoteToSurvive │ ├── server │ └── index.js │ ├── public │ ├── index.html │ ├── script.js │ ├── admin.html │ ├── admin.js │ ├── live.html │ └── style.css │ ├── package.json └── README.md Installation Clone the repository git clone https://github.com/yourusername/votetosurvive.git cd votetosurvive 2Install dependencies npm install 3️Start the server node index.js

Server runs on:

http://localhost:3000 Deployment

The app can be deployed easily using Render, Railway, or Heroku.

Example deployment used:

https://votetosurvive.onrender.com Passwords Room Password nss123 Admin Password

Configured inside admin.js.

Live Poll Page Password

Configured inside live.html.

Game Logic Elimination Rules Situation Result Majority votes A A voters eliminated Majority votes B B voters eliminated Tie No elimination Did not vote Eliminated Real-Time Events

Socket.IO events used:

join joinStatus joinRejected newQuestion vote voteUpdate startPoll stopPoll pollStatus getResults result eliminated getSurvivors lockEntries unlockEntries Validation

Student IDs must follow this pattern:

^25(ucs|ucc|uec|ume|dcs|dec)\d{3}$

Example valid IDs:

25ucs001 25UCC123 25dcs345 Future Improvements

Possible enhancements:

Timer-based voting rounds

Automatic round progression

Leaderboard

Player avatars

Animated elimination screen

Multiple rooms support

Contributing

Pull requests are welcome! If you have ideas for improvements or bug fixes, feel free to open an issue.

Author

Developed by Dhruv

GitHub:

https://github.com/Dhruvdevel If you like this project

Please star the repository to support the project!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors