Simple Voting App

Introduction

This project implements a simple real-time voting application using Flask and SocketIO. The application allows users to vote on a question by clicking on one of three buttons: "Yes", "No", or "Maybe". The votes are then displayed in real time as colored rectangles, with the width of each rectangle reflecting the proportion of votes it received.

votes photo

Prerequisites

To run this project, you will need the following:

  • Python 3.6 or higher
  • Flask
  • SocketIO
  • JavaScript
  • HTML
  • CSS

Installation

  1. Install Python 3.6 or higher.

  2. Install Flask and SocketIO using pip:

    pip install flask flask-socketio
    
  3. Create a new directory for the project and clone the repository into it.

  4. Open a terminal window and navigate to the project directory.

  5. Run the following command to start the application:

    python app.py
    

Usage

  1. Open a web browser and go to the following URL: http://localhost:5000

  2. Click on one of the buttons to cast your vote. The votes will be updated in real time.

Development

To develop the project, you can make changes to the code in the app.py, index.html, and index.js files. Then, save the changes and reload the page in your web browser to see the updated results.