From 2236b8af7d7496f4e51cd3255c6b170692f92f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Fri, 28 Aug 2026 08:55:15 +0300 Subject: [PATCH] Add minimal Flask service --- requirements.txt | 2 ++ site/app.py | 29 +++++++++++++++++++++++++++ site/static/style.css | 42 +++++++++++++++++++++++++++++++++++++++ site/templates/index.html | 21 ++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 requirements.txt create mode 100644 site/app.py create mode 100644 site/static/style.css create mode 100644 site/templates/index.html diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..33dd199 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask>=3.0 +gunicorn>=21.2 \ No newline at end of file diff --git a/site/app.py b/site/app.py new file mode 100644 index 0000000..bba5bd3 --- /dev/null +++ b/site/app.py @@ -0,0 +1,29 @@ +import platform +from datetime import datetime, timezone + +from flask import Flask, jsonify, render_template +import flask + + +VERSION = "0.0.1" +app = Flask(__name__, template_folder="templates", static_folder="static") + + +@app.route("/") +def index(): + return render_template( + "index.html", + version=VERSION, + current_time=datetime.now(timezone.utc).isoformat(), + python_version=platform.python_version(), + flask_version=flask.__version__, + ) + + +@app.route("/health") +def health(): + return jsonify(status="ok", version=VERSION) + + +if __name__ == "__main__": + app.run(debug=True, host="0.0.0.0", port=5000) \ No newline at end of file diff --git a/site/static/style.css b/site/static/style.css new file mode 100644 index 0000000..1fcd275 --- /dev/null +++ b/site/static/style.css @@ -0,0 +1,42 @@ +:root { + color-scheme: light; + font-family: system-ui, sans-serif; +} + +body { + margin: 0; + min-height: 100vh; + display: grid; + place-items: center; + background: #eef4f2; + color: #18322f; +} + +main { + width: min(92vw, 36rem); + padding: 2.5rem; + background: white; + border: 1px solid #c7d9d4; + border-radius: 8px; + box-shadow: 0 1rem 3rem rgb(24 50 47 / 12%); +} + +h1 { + margin-top: 0; +} + +dl { + display: grid; + grid-template-columns: max-content 1fr; + gap: 0.75rem 1.5rem; + margin-top: 2rem; +} + +dt { + color: #52736d; +} + +dd { + margin: 0; + font-family: ui-monospace, monospace; +} \ No newline at end of file diff --git a/site/templates/index.html b/site/templates/index.html new file mode 100644 index 0000000..0691c8a --- /dev/null +++ b/site/templates/index.html @@ -0,0 +1,21 @@ + + + + + + Recipe handwriting recognition + + + +
+

Recipe handwriting recognition

+

Managed Flask server is running.

+
+
Version
{{ version }}
+
UTC time
{{ current_time }}
+
Python
{{ python_version }}
+
Flask
{{ flask_version }}
+
+
+ + \ No newline at end of file