A simple live voting web app built with Streamlit. Users pick a party, cast a vote, and instantly see the results as a chart with percentages. An admin panel lets the owner view and reset the data.
Live app: https://pak-power.streamlit.app
This is a learning project and a fun poll. It is not an official or scientific survey.
- Vote for a party: PTI, PMLN, PPP, JUI-F, MQM, JI, TLP
- One vote per browser session
- Live results with a bar chart, vote counts and percentages
- Password-protected admin panel to view and reset all votes
- Votes stored in a local SQLite database
- Python
- Streamlit
- SQLite
- pandas
- Clone the repository:
git clone https://github.com/zyanhub/Pak-power.git cd Pak-power - Install the requirements:
pip install -r requirements.txt - Set the admin password:
- Windows (PowerShell):
$env:ADMIN_PASSWORD="your-password" - Mac / Linux:
export ADMIN_PASSWORD="your-password"
- Windows (PowerShell):
- Start the app:
streamlit run app.py
The password is never stored in the code. It is read from the ADMIN_PASSWORD setting.
- Streamlit Cloud: App settings → Secrets, then add
ADMIN_PASSWORD = "your-password" - Locally: set the
ADMIN_PASSWORDenvironment variable as shown above
If no password is set, the admin panel stays locked.
Pak-power/
├── app.py # Main app (user panel and admin panel)
├── admin.py # Standalone admin page
├── requirements.txt # Python dependencies
└── utils/
├── auth.py # Admin password check
└── db.py # SQLite database functions
Open app.py, find the st.selectbox("Select Party", [...]) line and add the new name to the list.
- The one-vote limit works per session, so refreshing the page lets a person vote again.
- On Streamlit Cloud the local database can reset when the app restarts, so votes are not permanent. Moving to an online database is planned.
Made by zyanhub