Skip to content

nikigawlik/WebAppTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup instruction

requires python 3.7+

To parse the csv file first delete the database.db file. Then run python parse_csv.py. The database should be created and filled with values.

To run the app run it as a package like this: python -m election_stats

project structure

Running the web app and routing is implemented in __main__. The data model is implemented in model.py using SQLAlchemy. The database is a SQLite .db file.

REST API documentation

GET /regions/
-> get list of all region objects (JSON)
GET /regions/<regionID>/
-> get specific region object (JSON)
GET /regions/<regionID>/subregions/
-> get list of contained subregions (JSON)
GET /regions/<regionID>/results/
-> get list of result objects (JSON)
GET /parties/
-> get list of all party objects (JSON)

region object format:

{
    "id": ...,
    "name": ...,
    "parent_region_id": ...,
    "eligibleVoters": ...,
    "voters": ...,
    "regionType": ...
}

party object format:

{
    "name": ...,
    "id": ...
}

result object format:

{
    "region_id": ...,
    "party_id": ...,
    "erststimmen": ...,
    "zweitstimmen": ...
}

About

Making a web app with flask and vue.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published