Started debugging backend stuff..

This commit is contained in:
cami 2021-06-22 02:15:40 +02:00
parent 838f673107
commit 02fc2bb4ef
5 changed files with 40 additions and 4 deletions

View file

@ -1,6 +1,6 @@
FROM python FROM python
WORKDIR /opt/ WORKDIR /app
COPY requirements.txt . COPY requirements.txt .

View file

@ -1,11 +1,26 @@
blinker==1.4
click==7.1.2 click==7.1.2
Deprecated==1.2.12
Flask==1.1.2 Flask==1.1.2
flask-buzz==0.1.15
Flask-Cors==3.0.10
Flask-Login==0.5.0 Flask-Login==0.5.0
Flask-Mail==0.9.1
flask-praetorian==1.2.0
Flask-SQLAlchemy==2.5.1 Flask-SQLAlchemy==2.5.1
greenlet==1.1.0 greenlet==1.1.0
inflection==0.3.1
itsdangerous==1.1.0 itsdangerous==1.1.0
Jinja2==2.11.3 Jinja2==2.11.3
MarkupSafe==1.1.1 MarkupSafe==1.1.1
passlib==1.7.4
pendulum==2.1.2
py-buzz==1.0.3
PyJWT==2.1.0
python-dateutil==2.8.1
python-dotenv==0.17.1 python-dotenv==0.17.1
pytzdata==2020.1
six==1.16.0
SQLAlchemy==1.4.15 SQLAlchemy==1.4.15
Werkzeug==1.0.1 Werkzeug==1.0.1
wrapt==1.12.1

View file

@ -1,5 +1,8 @@
import time import time
from flask import Flask from flask import Flask
import flask_sqlalchemy
import flask_praetorian
import flask_cors
import os import os
@ -20,6 +23,16 @@ else:
port = 5000 port = 5000
db = flask_sqlalchemy.SQLAlchemy()
guard = flask_praetorian.Praetorian()
cors = flask_cors.CORS()
class User(db.model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.Text, unique=True)
password = db.Column(db.Text)
@app.route('/') @app.route('/')
def home(): def home():

View file

@ -20,7 +20,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
tty: true tty: true
volumes: volumes:
- ./backend:/usr/src/app/ - ./backend:/app
ports: ports:
- 5000:5000 - 5000:5000
environment: environment:

View file

@ -1,11 +1,19 @@
import React from "react"; import React, {useState, useEffect} from "react";
import "../../App.css"; import "../../App.css";
import Footer from "../../Footer"; import Footer from "../../Footer";
export default function Manual() { export default function Manual() {
const [currentTime, setCurrentTime] = useState(0);
useEffect(() => {
fetch('/time').then(res => res.json()).then(data => {
setCurrentTime(data.time);
});
}, []);
return ( return (
<> <>
<h2 className="about">Anleitung / Bedienungshinweise</h2> <h2 className="about">Anleitung / Bedienungshinweise {currentTime}</h2>
<Footer /> <Footer />
</> </>
); );