Project Analysis This Project contains socket programming for voting system . Here, the client establishes a connection with the server, this implies that the TCP protocol is being used. The Server should allocate a new thread for every new incoming Client, to accomplish this feature we took care of concurrent thread, that is , when the number of connections are made with the server, that time each thread doesn’t interfere with one another. Therefore, we synchronized the threads.
❖ Design and Implementation :
- A secure server that only allows clients with authentic names and passwords to cast votes.
- Server checks for authenticity of the client & also checks if client has already voted. It returns a message to the client according to the security check.
- Voters are registered by admin and the voter list is stored in a csv file.
- Server can take the client name and password and match it with the txt file.
- If details match, then the voter is redirected to the secured Voting page.
- The voters will then cast the vote by mentioning the poll symbol of the candidate from the candidate list provided by the server.
- The system (server) can handle multiple clients and creates a new thread for each of them.
- One client can cast a vote once and only once.
Requirements Python Libraries Required : ➔ Pandas ➔ Tkinter ➔ Socket ➔ Subprocess
Tools Used ➢ Programming : Python ➢ Connection : Socket Programming ➢ Protocol : TCP ➢ User Interface : python-tkinter ➢ Data Storage : Using CSV files ➢ Data Updates : python-pandas ➢ OS Calls : python-subprocess
How to Run
- Open terminal/command prompt on your PC.
- Navigate to ‘Voting’ folder
- Run command : python homePage.py
- A new home page window should open. If this doesn’t happen, check your installations.
- Login into Admin using given details in ‘How to Login’ part.
- Click on the ‘Run Server’ Button.
- Use the rest of the Buttons as per your need.
How to Login ❖ Admin Login : ➔ Admin ID : Admin ➔ Password : admin ❖ Voter Login: ❏ Server should be running for voters to be able to login. ➔ Already registered voter I.Ds : 10001 to 10005 ➔ Password (for already registered voters) : abcd
Workflow Description ❖ Inorder Description to run & test this project :
- Open terminal & run python homePage.py to open Home Page Window.
- Log into Admin and press ‘Run Server’. This will run the Server in a new console window.
- Now that the server is running, return to the admin home page window.
- Press ‘Register Voter’ and enter details to register a new voter. Remember or note down the ‘Voter ID’ that you will receive on successful registration.
- Press ‘Home’ to return to the Home. Now, press ‘Voter Login’ to open the voter login page.
- Enter the login details and you are redirected to the Voting Page. You will receive an error message if the Voter is invalid or has already cast a vote.
- Cast a Vote. Now on receiving a success message, press home to return to home.
- Login into Admin again. Press ‘Show Votes’ to check the votes that all parties have received so far.
- Return to Home. You can press ‘New Window’ to open multiple pages and cast a vote concurrently from multiple voters