From 4c2b4bf5d0c1fb463267b52624e59595219d3878 Mon Sep 17 00:00:00 2001 From: Stef Date: Fri, 25 Apr 2025 18:11:27 +0200 Subject: [PATCH] Preparing repo for merge of frontend with backend --- app.py | 6 +++++- application/api/views.py | 2 +- application/auth/templates/.gitkeep | 0 application/auth/views.py | 3 +++ application/dashboard/templates/.gitkeep | 0 application/dashboard/views.py | 3 +++ pico_files/config.py | 2 +- requirements.txt | 1 + 8 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 application/auth/templates/.gitkeep create mode 100644 application/auth/views.py create mode 100644 application/dashboard/templates/.gitkeep create mode 100644 application/dashboard/views.py diff --git a/app.py b/app.py index 2017d01..1847dba 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,11 @@ from application import app from application.api.views import api_blueprint +from application.auth.views import auth_blueprint +from application.dashboard.views import dash_blueprint -app.register_blueprint(api_blueprint) +app.register_blueprint(api_blueprint, url_prefix="/api") +app.register_blueprint(auth_blueprint, url_prefix="/auth") +app.register_blueprint(dash_blueprint, url_prefix="/dash") # Default app route diff --git a/application/api/views.py b/application/api/views.py index 69496b1..06e6f9b 100644 --- a/application/api/views.py +++ b/application/api/views.py @@ -9,7 +9,7 @@ api_blueprint = Blueprint("api", __name__, template_folder="templates") # API to process vehicle -@api_blueprint.route("/api", methods=["POST"]) +@api_blueprint.route("/", methods=["POST"]) def data(): data = request.data np = asyncio.run(process_image(image=data)) diff --git a/application/auth/templates/.gitkeep b/application/auth/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/application/auth/views.py b/application/auth/views.py new file mode 100644 index 0000000..9b4d77c --- /dev/null +++ b/application/auth/views.py @@ -0,0 +1,3 @@ +from flask import Blueprint + +auth_blueprint = Blueprint("auth", __name__, template_folder="templates") diff --git a/application/dashboard/templates/.gitkeep b/application/dashboard/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/application/dashboard/views.py b/application/dashboard/views.py new file mode 100644 index 0000000..eaa1e36 --- /dev/null +++ b/application/dashboard/views.py @@ -0,0 +1,3 @@ +from flask import Blueprint + +dash_blueprint = Blueprint("dash", __name__, template_folder="templates") diff --git a/pico_files/config.py b/pico_files/config.py index e3e99d1..614141f 100644 --- a/pico_files/config.py +++ b/pico_files/config.py @@ -1,5 +1,5 @@ port = 2222 server = "192.168.137.1" -data_path = "api" +data_path = "api/" ssid = "stef" password = "test123123" diff --git a/requirements.txt b/requirements.txt index de23462..51abe46 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,3 +64,4 @@ ultralytics-thop==2.0.14 urllib3==2.4.0 Werkzeug==3.1.3 win32_setctime==1.2.0 +Authlib==1.5.2 \ No newline at end of file