GabrielMajeri / rezultate-vot

Romanian partial election results app. The role of the project is to offer real time aggregated results based on partial information published by BEC (Biroul Electoral Central)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rezultate Vot

GitHub contributors GitHub last commit License: MPL 2.0

The project aims to be an aggregator for election information in Romania. The project will contain historic information for elections in Romania, will contain real time results for each election, as it will parse results published by BEC (Biroul Electoral Central) and it will also contain information about the budgets spent during the electoral campaign.

See the project live

The partial results published by BEC (Biroul Electoral Central) are often raw results that are not easily interpreted and give no meaningful information to regular users. The aim of the project is to aggregate the raw data and provide timely updates on the progression of voting results in Romanian elections.

Contributing | Built with | Repos and projects | Deployment | Feedback | License | About Code4Ro

Contributing

This project is built by amazing volunteers and you can be one of them! Here's a list of ways in which you can contribute to this project.

You can also list any pending features and planned improvements for the project here.

Built With

Programming languages

C# 7

Platforms

.NET Core 2.2

Package managers

NuGet

Database technology & provider

  • Amazon S3 Storage
  • Amazon DynamoDB

Repos and projects

TBD

Deployment

Requirements

Prerequisites
  • .NET Core 2.2 (backend)
  • AWS CLI
  • NodeJS (frontend)
  • Docker (for running localstack or the API on local machine)
Run the project
  • cd localstack
  • Run the localstack image with docker-compose
  • docker-compose up -d
  • Add the required configuration settings. Use setup.cmd for Windows or setup.sh for Mac/Linux(remember to install the AWS CLI before this)
  • .\setup.cmd
    • this will add two settings called electionsConfig which is the list of elections and intervalInSeconds which is the background task run interval
  • use Visual Studio/Code to start the project, or use the following alternatives
  • using the dotnet CLI
  • cd src\ElectionResults.WebApi
  • dotnet run
  • Or, you can run the Docker image using docker-compose
  • cd src
  • docker-compose up -d

Configuration

In appsettings.{environment}.json you'll find the following settings:

Settings section
  • bucketName: "code4-presidential-2019"
    • the name of the bucket where CSV files are downloaded
  • tableName: "electionresults"
    • the name of the DynamoDB Table where the JSON statistics are stored
AWS.Logging section
  • specifies how much information should appear in the AWS logs
config.json

If you run the project on your local machine, you can also modify the file localstack\config.json before running localstack\setup.cmd

CSV URLs and mappings

  • PUT request on /api/settings/election-config with a JSON representation of a list of Election objects. This will overwrite the json from AWS Parameter Store.
  • Each Election object has:
    • a list of candidates where information about them can be provided(candidate picture, name, CSV column id, etc.)
    • a list of BEC URLs, each file has the type of results(provisional, partial or final), location(Romania or Diaspora), URL
  • An initial configuration is provided in the file localstack\config.json

Run unit tests

  • cd tests\ElectionResults.Tests
  • dotnet test

Feedback

  • Request a new feature on GitHub.
  • Vote for popular feature requests.
  • File a bug in GitHub Issues.
  • Email us with other feedback contact@code4.ro

License

This project is licensed under the MPL 2.0 License - see the LICENSE file for details

About Code4Ro

Started in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of over 500 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects visit our site or if you want to talk to one of our staff members, please e-mail us at contact@code4.ro.

Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, you can do it here.

About

Romanian partial election results app. The role of the project is to offer real time aggregated results based on partial information published by BEC (Biroul Electoral Central)

License:Mozilla Public License 2.0


Languages

Language:C# 75.9%Language:JavaScript 18.1%Language:CSS 4.4%Language:HTML 1.0%Language:Dockerfile 0.3%Language:Batchfile 0.2%Language:Shell 0.2%