Skip to content

Commit

Permalink
local elections 2020 - updates (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniri authored Oct 2, 2020
1 parent 36e18bd commit c340d5f
Show file tree
Hide file tree
Showing 359 changed files with 15,692 additions and 2,885 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# they will be requested for review when someone
# opens a pull request.
* @bvizureanu @aniri

# More details on creating a codeowners file:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
24 changes: 14 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,17 @@ ModelManifest.xml
*.pubxml
*.ps1
*.psm1
/private-api/app/src/VotingIrregularities.Api/appsettings.development.json
/private-api/app/src/VotingIrregularities.Api/appsettings.localdevelopment.json
/private-api/app/src/VotingIrregularities.Domain/appsettings.target.json
/private-api/app/src/VotingIrregularities.Domain/appsettings.development.json
/private-api/app/src/modules/WebAPIContrib.Core/
/private-api/app/src/VotingIrregularities.Domain/appsettings.localdevelopment.json
/private-api/app/test/VotingIrregularities.Tests/appsettings.localDevelopment.json
/private-api/app/test/VotingIrregularities.Tests/conturi.txt
/private-api/app/test/VotingIrregularities.Tests/conturi-cu-parole.txt
.vscode

# Specifics

**/appsettings.*.json
**/conturi*.txt
/src/api/modules/WebAPIContrib.Core/

.vscode
.idea
/src/api/VotingIrregularities.Api/etc
/src/api/VotingIrregularities.Api/api-docs
**/api-docs

.DS_Store
28 changes: 13 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
FROM microsoft/dotnet:2.1-sdk AS build-env
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app

COPY private-api/app/VotingIrregularities.sln ./
COPY private-api/app/src/VotingIrregularities.Api/VotingIrregularities.Api.csproj src/VotingIrregularities.Api/
COPY private-api/app/src/VotingIrregularities.Domain/VotingIrregularities.Domain.csproj src/VotingIrregularities.Domain/
COPY private-api/app/test/VotingIrregularities.Domain.Tests/VotingIrregularities.Domain.Tests.csproj test/VotingIrregularities.Domain.Tests/
COPY private-api/app/test/VotingIrregularities.Tests/VotingIrregularities.Tests.csproj test/VotingIrregularities.Tests/

# Copy all at once (big image probably?)
#COPY private-api/app/. ./
# Copy sources
COPY /src/. ./

# Restore packages
RUN dotnet restore

# Copy everything else and build
COPY private-api/app/. ./
# Build and publish as `Release`
RUN dotnet publish -c Release -o ./out

# test application -- see: dotnet-docker-unit-testing.md
FROM build-env AS testrunner
WORKDIR /app/tests
COPY private-api/app/test/. .
COPY /src/test/. .
ENTRYPOINT ["dotnet", "test", "--logger:trx"]

# Build runtime image
FROM microsoft/dotnet:2.1-aspnetcore-runtime
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
RUN apk add --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/testing/ \
libgdiplus-dev \
fontconfig \
ttf-dejavu
WORKDIR /
COPY --from=build-env /app/src/VotingIrregularities.Api/out/ .
ENTRYPOINT ["dotnet", "VotingIrregularities.Api.dll"]
COPY --from=build-env /app/api/VoteMonitor.Api/out/ .
ENTRYPOINT ["dotnet", "VoteMonitor.Api.dll"]
73 changes: 31 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,73 @@
# Monitorizare Vot - Rest API for mobile apps
# Monitorizare Vot - Rest API for mobile apps & web NGO platform

[![GitHub contributors](https://img.shields.io/github/contributors/code4romania/monitorizare-vot.svg?style=for-the-badge)](https://github.com/code4romania/monitorizare-vot/graphs/contributors) [![GitHub last commit](https://img.shields.io/github/last-commit/code4romania/monitorizare-vot.svg?style=for-the-badge)](https://github.com/code4romania/monitorizare-vot/commits/master) [![License: MPL 2.0](https://img.shields.io/badge/license-MPL%202.0-brightgreen.svg?style=for-the-badge)](https://opensource.org/licenses/MPL-2.0)

[See the project live](http://monitorizarevot.ro/)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=code4romania_monitorizare-vot&metric=alert_status)](https://sonarcloud.io/dashboard?id=code4romania_monitorizare-vot)
[![Build status](https://dev.azure.com/code4romania/monitorizare-vot-ci/_apis/build/status/monitorizare-vot/mv-api)](https://dev.azure.com/code4romania/monitorizare-vot-ci/_build/latest?definitionId=20)

Monitorizare Vot is a mobile app for monitoring elections by authorized observers. They can use the app in order to offer a real-time snapshot on what is going on at polling stations and they can report on any noticeable irregularities.
[See the project live](https://votemonitor.org/)

The NGO-s with authorized observers for monitoring elections have real time access to the data the observers are transmitting therefore they can report on how voting is evolving and they can quickly signal to the authorities where issues need to be solved.
Monitorizare Vot is a mobile app for monitoring elections by authorized observers. They can use the app in order to offer a real-time snapshot on what is going on at polling stations and they can report on any noticeable irregularities.

Moreover, where it is allowed, observers can also photograph and film specific situations and send the images to the NGO they belong to.
The NGO-s with authorized observers for monitoring elections have real time access to the data the observers are transmitting therefore they can report on how voting is evolving and they can quickly signal to the authorities where issues need to be solved.

The app also has a web version, available for every citizen who wants to report on election irregularities. Monitorizare Vot was launched in 2016 and it has been used for the Romanian parliamentary elections so far, but it is available for further use, regardless of the type of elections or voting process.
Moreover, where it is allowed, observers can also photograph and film specific situations and send the images to the NGO they belong to.

[Built with](#built-with) | [Repos and projects](#repos-and-projects) | [Deployment](#deployment) | [Contributing](#contributing) | [Feedback](#feedback) | [License](#license) | [About Code4Ro](#about-code4ro)
The app also has a web version, available for every citizen who wants to report on election irregularities. Monitorizare Vot was launched in 2016 and it has been used for the Romanian parliamentary elections so far, but it is available for further use, regardless of the type of elections or voting process.

[Contributing](#contributing) | [Built with](#built-with) | [Repos and projects](#repos-and-projects) | [Deployment](#deployment) | [Feedback](#feedback) | [License](#license) | [About Code4Ro](#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](.github/CONTRIBUTING.MD).

## Built With

.Net Core 1.1
.Net Core 3.1

Swagger docs for the API are available [here](https://mv-mobile-prod.azurewebsites.net/swagger/ui/index.html).
Swagger docs for the API are available [here](https://app-vmon-api-dev.azurewebsites.net/swagger/index.html).

## Repos and projects

![alt text](https://raw.githubusercontent.com/code4romania/monitorizare-vot/develop/vote_monitor_diagram.png)

Client apps:

- android - https://github.com/code4romania/monitorizare-vot-android
- Android - https://github.com/code4romania/mon-vot-android-kotlin
- iOS - https://github.com/code4romania/monitorizare-vot-ios
- Web admin for NGOs - https://github.com/code4romania/monitorizare-vot-ong

Other MV related repos:

- https://github.com/code4romania/monitorizare-vot-admin
- https://github.com/code4romania/monitorizare-vot-ong
- https://github.com/code4romania/monitorizare-vot-votanti-client/
- https://github.com/code4romania/monitorizare-vot-votanti-api
- https://github.com/code4romania/monitorizare-vot-votanti-admin
- https://github.com/code4romania/monitorizare-vot-docs

## Creating the database
## Creating the database --- WIP you might encounter issues here.

The Assembly VotingIrregularities.Domain has EF Migrations configured and can generate a database complete with test data.

To do this, follow the steps bellow:

Fill-in `appsetings.json` OR add in a new `appsettings.target.json` file the connectionstring to the SQL instance where the DB should be created.

Run the following console command from the `VotingIrregularities.Domain` folder:
Run the following console command from the `VotingIrregularities.Domain.Seed` folder:

```sh
private-api\app\VotingIrregularities.Domain> dotnet run
src\api\VotingIrregularities.Domain.Seed> dotnet run
```

**Important:** the migrate action with delete the data from the following tables: RaspunsDisponibil, Intrebare, Sectiune, Optiune.
**Important:** the migrate action with delete the data from the following tables: `Answers`, `Questions`, `FormSections`, `Options`.

## Deployment

1. install .NetCore (Open Source/Free/Multiplatform) from [here](https://www.microsoft.com/net/core#windows)
1. install .NetCore (refer to the [Built With](#built-with) section for the proper version) (Open Source/Free/Multiplatform) from [here](https://www.microsoft.com/net/core#windows)

2. run the following console command form the `app` folder:
2. run the following console command from the `src` folder:
```sh
private-api\app> dotnet restore
src> dotnet restore
```

3. run the following console command form the `VotingIrregularities.Api` folder:
3. run the following console command from the `VoteMonitor.Api` folder:
```sh
private-api\app\VotingIrregularities.Api> dotnet run
src\api\VoteMonitor.Api> dotnet run
```

4. browse to indicated address: <http://localhost:5000/swagger/ui>

## Contributing

If you would like to contribute to one of our repositories, first identify the scale of what you would like to contribute. If it is small (grammar/spelling or a bug fix) feel free to start working on a fix. If you are submitting a feature or substantial code contribution, please discuss it with the team and ensure it follows the product roadmap.

* Fork it (https://github.com/code4romania/monitorizare-vot/fork)
* Create your feature branch (git checkout -b feature/fooBar)
* Commit your changes (git commit -am 'Add some fooBar')
* Push to the branch (git push origin feature/fooBar)
* Create a new Pull Request

[Pending issues](https://github.com/code4romania/monitorizare-vot/issues)
4. browse to indicated address: <http://localhost:5000/swagger>

## Feedback

Expand All @@ -95,4 +84,4 @@ This project is licensed under the MPL 2.0 License - see the [LICENSE](LICENSE)

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](https://www.code4.ro/en/) or if you want to talk to one of our staff members, please e-mail us at [email protected].

Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread accross 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](https://code4.ro/en/donate/).
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](https://code4.ro/en/donate/).
44 changes: 44 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://aka.ms/yaml

pool:
vmImage: 'windows-latest'

variables:
BuildConfiguration: Release

steps:
- task: DotNetCoreCLI@2
displayName: 'restore packages'
inputs:
command: 'restore'
projects: '**/*.sln'
feedsToUse: 'select'

- task: DotNetCoreCLI@2
displayName: 'build solution'
inputs:
command: 'build'
projects: '**/*.sln'
arguments: '--configuration $(BuildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'publish web project(s)'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--no-restore --no-build --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'

- task: PublishPipelineArtifact@1
displayName: 'Upload artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'


- task: PublishBuildArtifacts@1
enabled: false
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
File renamed without changes.
59 changes: 0 additions & 59 deletions private-api/app/VotingIrregularities.sln

This file was deleted.

15 changes: 0 additions & 15 deletions private-api/app/readme.md

This file was deleted.

Loading

0 comments on commit c340d5f

Please sign in to comment.