Skip to content

bearz314/pollar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pollar

Pollar is an open-source, real-time polling app designed for classrooms, events, or any group setting. It supports multiple rooms, live voting, and instant result visualization. Built with Flask, Flask-SocketIO, Redis, and Docker.


Features

  • Multiple Rooms: Any number of rooms can be created for different sessions or classes.
  • Live Polling: Real-time voting and result updates using WebSockets.
  • Admin Controls: Start, stop, reset, and reveal poll answers.
  • Anonymized Results: Votes are shuffled and anonymized for privacy.
  • Session Management: Uses Redis for server-side session storage.
  • Responsive UI: Built with Bootstrap and D3.js for interactive charts.
  • Easy Deployment: Docker Compose for quick local setup.

Quick Start

1. Clone the Repository

git clone https://github.com/bearz314/pollar.git
cd pollar

2. Run Locally with Docker

sudo docker compose up

This will start the Flask backend, Redis, and all required services.


Usage

1. Create a Room and Load Questions

Visit:

http://127.0.0.1:12345/roomname/admin/new

Replace roomname with any room identifier.

2. Student Access

Students join the poll at:

http://127.0.0.1:12345/roomname

3. Admin Poll Controls

  • Open Poll for Responses:

    http://127.0.0.1:12345/roomname/admin/open/example_poll
    
  • Stop Accepting Responses (do not reveal answer):

    http://127.0.0.1:12345/roomname/admin/close/example_poll
    
  • Stop Accepting Responses (reveal answer):

    http://127.0.0.1:12345/roomname/admin/reveal/example_poll
    

Replace example_poll with the actual poll ID. For testing, use example_poll and another_poll.


API & Admin Endpoints

  • /<room>/admin/new — Create/reset a room and load questions.
  • /<room>/admin/close — Close a room (retain data).
  • /<room>/admin/delete — Delete a room and all data.
  • /<room>/admin/open/<poll_id> — Start accepting responses for a poll.
  • /<room>/admin/reset/<poll_id> — Reset poll responses.
  • /<room>/admin/close/<poll_id> — Stop accepting responses (no answer revealed).
  • /<room>/admin/reveal/<poll_id> — Stop accepting responses and reveal the answer.

Development Notes

  • CORS: For local development, CORS is set to allow all origins. Remove or restrict this in production for security.
  • WebSocket URL: Update the WebSocket URL in index.html for production deployments.
  • Sessions: Server-side sessions are stored in Redis for scalability and reliability.
  • Question Bank: Questions are loaded per room. Customize load_question_bank as needed.
  • Vote Anonymization: Votes are shuffled using a seed based on the poll ID for privacy.

Security

  • Secret Key: The app generates a secure secret key if not provided For production, set a strong POLLAR_SECRET_KEY environment variable.
  • Admin Verification: Admin endpoints are not currently protected. Add authentication before deploying publicly.

Customization

  • Frontend: Modify /app/templates/index.html for UI changes.
  • Backend: Main logic is in /app/backend.py.
  • Redis: Used for session and poll data storage.

License

Pollar is dual-licensed:

  • GNU General Public License v3.0 (GPLv3): You may use, modify, and redistribute this software under the terms of the GPLv3.
  • Commercial License: For organizations or individuals who wish to use Pollar under different terms (for example, to distribute closed-source versions or to obtain a commercial license), please contact the copyright holder.

By contributing to this project, you agree that your contributions may be incorporated into both the GPLv3 and commercial versions of the software.


Contributing

Pull requests and issues are welcome!


Acknowledgements


Pollar — Making classroom polling simple, fast, and open!

About

Pollar is a live audience polling software running off the web.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors