diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f5e96dbfaec8bd23554e839a582259cf17837f26 --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1 @@ +venv \ No newline at end of file diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000000000000000000000000000000000000..82b407500820f32dd1e19836b2145af7124891f6 --- /dev/null +++ b/backend/README.md @@ -0,0 +1,35 @@ +# Requirements +- Visualize statistical data from Statistikdatbasen.scb.se focusing on European Parliamental Election data. +- The data contains geographical information and thus can be vizualized on the map + +- D3 library will be used for graphical visalization +- **Frontend:** React , **Backend:** SQLAlchemy + +- Dataman.se for topological data of sweden borders + +## BASIC: +- Given hard coded table x,y data as input and visualize it on a plot +- Given hard coded table x,y, postition data as input, vizualize it on the map +- Mouse hover interaction on map of Sweden, highlighting the region the mouse currently hovers over + +## IDEA 1: +- Visualize regional data on map of sweden +- Allows for focusing in on specific region for more fine detailed data + +## IDEA2: + +## ADVANDCED: +- Optional parameters? +- Interactive visalization +- Through API(Statistikdatabsen.scb.s) fetch live data and visualize it +- Graphical transitions of the visalization frame + +## Profile +- Log in / Sign out +- Session token for saving log-in state locally +- Access to key features through log-in. +- User profile (Name, e-mail, password) +- Session token +- + + diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1aa680e0077d37a862ff1fa945dd13d11f2e0bc0 --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,9 @@ +blinker==1.7.0 +click==8.1.7 +Flask==3.0.2 +importlib_metadata==7.1.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.5 +Werkzeug==3.0.1 +zipp==3.18.1 diff --git a/backend/server.py b/backend/server.py new file mode 100755 index 0000000000000000000000000000000000000000..991d046f037a68dfed63c7eae07443f9873f06ab --- /dev/null +++ b/backend/server.py @@ -0,0 +1,18 @@ +from flask import Flask, render_template + +app = Flask(__name__) + +@app.route("/") +def homepage(): + return render_template("index.html") + +if __name__ == '__main__': + app.debug = True + app.run() + + + + + + + \ No newline at end of file diff --git a/backend/setup.sh b/backend/setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..11e595dd5eacc4e4879ba8c166fd30b5189da861 --- /dev/null +++ b/backend/setup.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Allow execution by running: chmod u+x setup.sh +python3 -m venv venv +. venv/bin/activate +pip3 install -r requirements.txt \ No newline at end of file diff --git a/backend/templates/index.html b/backend/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..9dfa6e4bc843d036fdb7e49075f4d7ee31f83715 --- /dev/null +++ b/backend/templates/index.html @@ -0,0 +1,9 @@ +<!doctype html> +<html> + <head> + <title>This is the title of the webpage!</title> + </head> + <body> + <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> + </body> +</html> \ No newline at end of file