{"id":27998450,"url":"https://github.com/ishanoshada/slelectionlive","last_synced_at":"2026-05-15T12:34:00.914Z","repository":{"id":291997299,"uuid":"979478635","full_name":"Ishanoshada/SLElectionLive","owner":"Ishanoshada","description":"A Flask web app for live Sri Lanka election results, featuring an interactive dashboard, news stream, and SMS campaign interface","archived":false,"fork":false,"pushed_at":"2025-05-07T17:35:13.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T22:53:19.800Z","etag":null,"topics":["election","election-results","flask","python","sl-election","sri-lanka","srilanka","srilanka-election","srilanka-results"],"latest_commit_sha":null,"homepage":"https://sl-election-live.vercel.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ishanoshada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T15:15:11.000Z","updated_at":"2025-05-07T17:35:17.000Z","dependencies_parsed_at":"2025-05-07T16:42:44.808Z","dependency_job_id":null,"html_url":"https://github.com/Ishanoshada/SLElectionLive","commit_stats":null,"previous_names":["ishanoshada/slelectionlive"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FSLElectionLive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FSLElectionLive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FSLElectionLive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FSLElectionLive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ishanoshada","download_url":"https://codeload.github.com/Ishanoshada/SLElectionLive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160821,"owners_count":21863624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["election","election-results","flask","python","sl-election","sri-lanka","srilanka","srilanka-election","srilanka-results"],"created_at":"2025-05-08T22:53:24.213Z","updated_at":"2026-05-15T12:33:58.599Z","avatar_url":"https://github.com/Ishanoshada.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SLElectionLive\n\n![SLElectionLive Dashboard](https://img.shields.io/badge/Flask-3.0.3-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![GitHub Issues](https://img.shields.io/github/issues/Ishanoshada/SLElectionLive)\n\n**SLElectionLive** is a Flask-based web application that provides real-time election results for Sri Lanka. It features an interactive dashboard with charts, a live news stream, and an SMS campaign interface. The application scrapes data from `results.elections.gov.lk` and uses Chart.js for visualizations, Bootstrap for styling, and a responsive design for accessibility across devices.\n\n![img1](https://github.com/Ishanoshada/Ishanoshada/blob/main/ss2/Screenshot%202025-05-07%20203443.png?raw=true)\n\n\n## Table of Contents\n- [Live Demo](#live-demo)\n- [Features](#features)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n- [License](#license)\n- [Attribution](#attribution)\n\n\n## Live Demo\nExplore the live application at [https://sl-election-live.vercel.app/](https://sl-election-live.vercel.app/). View real-time election results, news updates, and manage SMS campaigns. \n\n![img2](https://github.com/Ishanoshada/Ishanoshada/blob/main/ss2/Screenshot%202025-05-07%20201414.png?raw=true)\n\n## Features\n- **Live Election Results Dashboard**: Displays vote shares, seats, and party details with an interactive doughnut chart.\n- **Real-Time News Stream**: Fullscreen news mode with voter turnout, social sharing, and automatic updates every 30 seconds.\n- **SMS Campaign Interface**: Manage and send SMS campaigns for election updates.\n- **Dark Mode**: Toggle between light and dark themes for better usability.\n- **Responsive Design**: Optimized for desktop, tablet, and mobile devices.\n- **Data Scraping**: Fetches live election data from `results.elections.gov.lk` using BeautifulSoup.\n- **Fallback Data**: Uses sample data when API or scraping fails, ensuring uninterrupted service.\n\n## Project Structure\n```\nSLElectionLive/\n├── api/\n│   ├── app.py               # Flask application with routes and scraping logic\n│   ├── sample_data.py       # Generates sample election data for fallback\n│   ├── templates/\n│   │   ├── index.html       # Election results dashboard\n│   │   ├── news.html        # Live news stream page\n│   │   ├── sms_campaign.html # SMS campaign interface\n├── packages.json            # Node.js configuration (optional for Vercel)\n├── requirements.txt         # Python dependencies\n├── test.py                  # Test script for development\n├── vercel.json              # Vercel deployment configuration\n├── README.md                # This file\n```\n\n\n## Installation\nFollow these steps to set up the project locally:\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/Ishanoshada/SLElectionLive.git\n   cd SLElectionLive\n   ```\n\n2. **Create a Virtual Environment**:\n   ```bash\n   python -m venv venv\n   ```\n\n3. **Activate the Virtual Environment**:\n   - On Windows:\n     ```bash\n     venv\\Scripts\\activate\n     ```\n   - On Linux/Mac:\n     ```bash\n     source venv/bin/activate\n     ```\n\n4. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n5. **Set Up Environment Variables**:\n   - Create a `.env` file in the root directory:\n     ```bash\n     touch .env\n     ```\n   - Add necessary configurations (e.g., API keys, if used):\n     ```plaintext\n     FLASK_ENV=development\n     SECRET_KEY=your_secret_key\n     ```\n\n6. **Run the Application**:\n   ```bash\n   python api/app.py\n   ```\n   - The app will be available at `http://localhost:5000`.\n\n## Usage\n- **Dashboard (`/`)**: View the latest election results with a chart and table of party details.\n- **News Stream (`/news`)**: Access live updates with voter turnout, social sharing buttons, and navigation for recent results.\n- **SMS Campaign (`/sms_campaign`)**: Manage SMS campaigns for election notifications.\n- **Dark Mode**: Click the moon/sun icon in the navbar to toggle themes.\n- **Fullscreen Mode**: On the news page, click the fullscreen button for an immersive view.\n\nTo test with sample data:\n- Modify `app.py` to force `use_sample_data=True` or simulate a failed API call.\n\n## Deployment\n### Local Deployment\n- Use `gunicorn` for production-like local testing:\n  ```bash\n  gunicorn -w 4 -b 0.0.0.0:8000 api.app:app\n  ```\n\n### Vercel Deployment\nThe project includes `vercel.json` and `packages.json`, suggesting Vercel compatibility. To deploy:\n1. Install the Vercel CLI:\n   ```bash\n   npm install -g vercel\n   ```\n2. Deploy from the project root:\n   ```bash\n   vercel\n   ```\n3. Follow prompts to configure the project (ensure `api/app.py` is the entry point).\n4. Update `vercel.json` if needed to map routes correctly.\n\n### Other Platforms\n- **Heroku**: Push to a Heroku app with `Procfile`:\n  ```plaintext\n  web: gunicorn api.app:app\n  ```\n- **Render**: Configure as a Python web service with `requirements.txt`.\n\n## Contributing\nContributions are welcome! To contribute:\n1. Fork the repository.\n2. Create a feature branch:\n   ```bash\n   git checkout -b feature/your-feature\n   ```\n3. Commit changes:\n   ```bash\n   git commit -m \"Add your feature\"\n   ```\n4. Push to the branch:\n   ```bash\n   git push origin feature/your-feature\n   ```\n5. Open a pull request on `https://github.com/Ishanoshada/SLElectionLive`.\n\nPlease follow the [Code of Conduct](CODE_OF_CONDUCT.md) and include tests in `test.py` for new features.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Attribution\n- **Created by**: [Ishanoshada](https://github.com/Ishanoshada)\n- **Source Code**: [https://github.com/Ishanoshada/SLElectionLive](https://github.com/Ishanoshada/SLElectionLive)\n- **Data Source**: [results.elections.gov.lk](https://results.elections.gov.lk)\n\n\n\n![Views](https://dynamic-repo-badges.vercel.app/svg/count/6/Repository%20Views/slelectionlive)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishanoshada%2Fslelectionlive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fishanoshada%2Fslelectionlive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishanoshada%2Fslelectionlive/lists"}