diff --git a/backend/Dockerfile b/backend/Dockerfile index 6dfe114..10162a5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,19 +1,11 @@ -# For more information, please refer to https://aka.ms/vscode-docker-python -FROM python:3.9 +FROM python -EXPOSE 5000 +WORKDIR /opt/ -# Keeps Python from generating .pyc files in the container -ENV PYTHONDONTWRITEBYTECODE 1 +COPY requirements.txt . -# Turns off buffering for easier container logging -ENV PYTHONUNBUFFERED 1 +RUN pip install -r requirements.txt -# Install pip requirements -ADD requirements.txt . -RUN python -m pip install -r requirements.txt - -WORKDIR /app -ADD . /app +COPY /src . -CMD ["flask", "run"] +CMD [ "python", "app.py" ] diff --git a/backend/Dockerfile.bak b/backend/Dockerfile.bak new file mode 100644 index 0000000..7fa027a --- /dev/null +++ b/backend/Dockerfile.bak @@ -0,0 +1,19 @@ +# For more information, please refer to https://aka.ms/vscode-docker-python +FROM python:3.9 + +#EXPOSE 5000 + +# Keeps Python from generating .pyc files in the container +#ENV PYTHONDONTWRITEBYTECODE 1 + +# Turns off buffering for easier container logging +# ENV PYTHONUNBUFFERED 1 + +# Install pip requirements +ADD requirements.txt . +RUN python -m pip install -r requirements.txt + +WORKDIR /app +ADD . /app + +CMD ["flask", "run"] diff --git a/backend/Dockerfile.prod b/backend/Dockerfile.prod new file mode 100644 index 0000000..3eba885 --- /dev/null +++ b/backend/Dockerfile.prod @@ -0,0 +1,12 @@ +FROM python + +WORKDIR /opt/demo/ + +COPY requirements.txt . + +RUN apt-get -y update && apt-get -y upgrade +RUN pip install -r requirements.txt + +COPY /src . + +CMD [ "python", "main.py" ] diff --git a/backend/requirements.txt b/backend/requirements.txt index 11b010b..336fcb4 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,7 +1,11 @@ click==7.1.2 Flask==1.1.2 +Flask-Login==0.5.0 +Flask-SQLAlchemy==2.5.1 +greenlet==1.1.0 itsdangerous==1.1.0 Jinja2==2.11.3 MarkupSafe==1.1.1 python-dotenv==0.17.1 +SQLAlchemy==1.4.15 Werkzeug==1.0.1 diff --git a/backend/src/app.py b/backend/src/app.py index 07fc55a..66747a3 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -1,8 +1,34 @@ import time from flask import Flask +import os + app = Flask(__name__) +# Read environment variables +if "DEBUG" in os.environ and os.environ["DEBUG"] == 'yes': + debug = True +else: + debug = False +if "HOST" in os.environ: + host = os.environ["HOST"] +else: + host = '0.0.0.0' +if "PORT" in os.environ: + port = int(os.environ["PORT"]) +else: + port = 5000 + + + +@app.route('/') +def home(): + return "Hello World" + @app.route('/time') def get_current_time(): return {'time': time.time()} + + +if __name__ == '__main__': + app.run(debug=debug, host=host, port=port) diff --git a/docker-compose.yml b/docker-compose.yml index 2e20a3f..2d3f675 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,5 +24,6 @@ services: ports: - 5000:5000 environment: + DEBUG: "yes" PORT: 5000 - FLASK_DEBUG: 1 + HOST: "0.0.0.0" diff --git a/frontend/issues.sh b/frontend/issues.sh new file mode 100644 index 0000000..86fb9c1 --- /dev/null +++ b/frontend/issues.sh @@ -0,0 +1,30 @@ +# Labels: backend, bug, content, design, duplicate, enhancement, frontend, help wanted, invalid, question, wontfix, +ISSUE_TITLE="Buttons gleichmässig darstellen" +DESC="Die Buttons sollen alle die gleiche Breite haben" +LABELS="design,frontend,enhancement" +DEADLINE="2021-06-23" +tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}" + +ISSUE_TITLE="login backend implementieren" +DESC="" +LABELS="backend,enhancement" +DEADLINE="2021-06-25" +tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}" + +ISSUE_TITLE="registrieren implementieren backend" +DESC="" +LABELS="backend,enhancement" +DEADLINE="2021-06-25" +tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}" + +ISSUE_TITLE="Umfrage erstellen (für neue Teilnehmer)" +DESC="" +LABELS="frontend,enhancement,backend" +DEADLINE="2021-06-25" +tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}" + +ISSUE_TITLE="Datenerhebung der Maus und Tastatur" +DESC="" +LABELS="frontend,backend,enhancement" +DEADLINE="2021-06-27" +tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}" diff --git a/frontend/package.json b/frontend/package.json index 6bbf714..b2f204f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -39,5 +39,5 @@ "last 1 safari version" ] }, - "proxy": "http://127.0.0.1:5000" + "proxy": "http://localhost:5000" } diff --git a/frontend/src/App.css b/frontend/src/App.css index f478d26..4f1d6f3 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -7,7 +7,7 @@ :root { --primary: rgb(41, 63, 87); - --secondary: #fff; + --secondary: rgb(218,218,218); --third: rgb(171, 183, 183); } @@ -28,20 +28,24 @@ font-size: 100px; } -.products { - background-image: url('images/img-9.jpg'); +.sign-up { + background-image: url("images/img-9.jpg"); background-position: center; - background-size: fill; + background-size: cover; background-repeat: no-repeat; color: var(--primary); font-size: 100px; } -.sign-up { - background-image: url('images/img-9.jpg'); - background-position: center; - background-size: cover; - background-repeat: no-repeat; - color: #fff; - font-size: 100px; +.sitePage { + height: 90vh; + display: flex; + flex-direction: column; + align-content: center; + align-items: center; + background-color: var(--secondary); +} +.sitePage h1 { + font-size: 80px; + margin: 0.7em auto; } diff --git a/frontend/src/App.js b/frontend/src/App.js index 50b3cb5..0c92cb2 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -7,6 +7,9 @@ import SignUp from "./components/pages/SignUp"; import Ueber from "./components/pages/Ueber"; import Lizenzen from "./components/pages/lizenzen"; import Privacy from "./components/pages/Privacy"; +import Login from "./components/pages/Login"; +import Register from "./components/pages/Register" +import Manual from "./components/pages/Manual"; function App() { return ( @@ -19,6 +22,9 @@ function App() { + + + diff --git a/frontend/src/Footer.js b/frontend/src/Footer.js index 8c4c1c3..8ec20ac 100644 --- a/frontend/src/Footer.js +++ b/frontend/src/Footer.js @@ -11,7 +11,7 @@ function Footer() {

Informationen

Hintergrund - Ziel dieser Webseite + Wie funktioniert das?

Kontakt

diff --git a/frontend/src/components/Input.css b/frontend/src/components/Input.css new file mode 100644 index 0000000..3b23b35 --- /dev/null +++ b/frontend/src/components/Input.css @@ -0,0 +1,11 @@ +.input-field { + width: auto; +} + +.input-field p{ + font-size: 36px; +} +.input-field input { + width: 100%; + border-color: var(--primary); +} \ No newline at end of file diff --git a/frontend/src/components/InputField.js b/frontend/src/components/InputField.js new file mode 100644 index 0000000..f71a029 --- /dev/null +++ b/frontend/src/components/InputField.js @@ -0,0 +1,13 @@ +import React from "react"; +import "./Input.css"; + +function InputField(props) { + return ( + + ); +} + +export default InputField; diff --git a/frontend/src/components/Navbar.css b/frontend/src/components/Navbar.css index da8f609..23680d3 100644 --- a/frontend/src/components/Navbar.css +++ b/frontend/src/components/Navbar.css @@ -146,7 +146,7 @@ background-color: transparent; color: var(--primary); padding: 14px 20px; - border: 1px solid #fff; + border: 1px solid var(--primary); transition: all 0.3s ease-out; } diff --git a/frontend/src/components/SubmitField.js b/frontend/src/components/SubmitField.js new file mode 100644 index 0000000..ec5e168 --- /dev/null +++ b/frontend/src/components/SubmitField.js @@ -0,0 +1,14 @@ +import React from "react"; +import "./Input.css" +import "./Button.css" + +function SubmitField(props) { + const InputValue = props.LabelName; + return ( + + ); +} + +export default SubmitField; diff --git a/frontend/src/components/pages/Login.js b/frontend/src/components/pages/Login.js new file mode 100644 index 0000000..b3fe806 --- /dev/null +++ b/frontend/src/components/pages/Login.js @@ -0,0 +1,30 @@ +import React from "react"; +import "../../App.css"; +import Footer from "../../Footer"; +import InputField from "../InputField"; +import SubmitField from "../SubmitField"; + +export default function Login() { + return ( + <> +
+

Login

+
+ + +
+ + +
+