From 6bb60c49f4aaee6e0f92c80970774e3e04f54da6 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Sun, 15 Mar 2026 15:23:48 -0700 Subject: [PATCH] initial server stuff --- .gitignore | 2 ++ Dockerfile | 10 ++++++++ compose.yaml | 18 +++++++++++++ potato.yaml | 37 +++++++++++++++++++++++++++ requirements.txt | 7 +++++ src/__pycache__/main.cpython-314.pyc | Bin 0 -> 856 bytes src/main.py | 20 +++++++++++++++ 7 files changed, 94 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 compose.yaml create mode 100644 potato.yaml create mode 100644 requirements.txt create mode 100644 src/__pycache__/main.cpython-314.pyc create mode 100644 src/main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7a4d04 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Created by venv; see https://docs.python.org/3/library/venv.html +venv diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5736b4b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.14.3-trixie + +WORKDIR /app + +COPY requirements.txt requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD ["flask", "--app", "./src/main", "run", "--host=0.0.0.0"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..89b1faa --- /dev/null +++ b/compose.yaml @@ -0,0 +1,18 @@ +services: + api: + build: . + command: ["flask", "--app", "./src/main", "--debug", "run", "--host=0.0.0.0"] + ports: + - 5000:5000 + develop: + watch: + - action: sync + path: ./src + target: /app/src + - action: rebuild + path: requirements.txt + - action: rebuild + path: Dockerfile + - action: rebuild + path: compose.yaml + diff --git a/potato.yaml b/potato.yaml new file mode 100644 index 0000000..a4e0b64 --- /dev/null +++ b/potato.yaml @@ -0,0 +1,37 @@ +services: + proxy: + container_name: traefik + image: traefik + web: + build: ./foundry-manager + command: ["npm", "run", "dev"] + ports: + - 5173:5173 + - 8080:8080 + develop: + watch: + - action: sync + path: ./foundry-manager/src + target: /app/src + - action: rebuild + path: ./foundry-manager/package.json + - action: rebuild + path: ./foundry-manager/Dockerfile + - action: restart + path: compose.yaml + api: + build: ./server + command: ["flask", "--app", "./src/main", "--debug", "run", "--host=0.0.0.0"] + ports: + - 5000:5000 + develop: + watch: + - action: sync + path: ./server/src + target: /app/src + - action: rebuild + path: ./server/requirements.txt + - action: rebuild + path: ./server/Dockerfile + - action: rebuild + path: ./server/compose.yaml diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ff9c766 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +blinker==1.9.0 +click==8.3.1 +Flask==3.1.3 +itsdangerous==2.2.0 +Jinja2==3.1.6 +MarkupSafe==3.0.3 +Werkzeug==3.1.6 diff --git a/src/__pycache__/main.cpython-314.pyc b/src/__pycache__/main.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56943088b40cf452b6cdf36668e4ff875db1de63 GIT binary patch literal 856 zcmZ`$O>fgM7`Ed$NtX_xsep=*#+W#CNX?~3;5d~7(+F3(C`~<@HHm}c6xve}67;}f ze`9}u-!ZgH;@8eKk~DIFi$d?gvTRcGV&rP86R&sei}M{z{4T&xZjOP7OaagzQkxY8?M)CBYe?4CiU%Y-v9mk315>C>1v0e$HlGI~M+o;f`l z3<&dLKk=Uv=46Bo)x-iP_QRx^js)(LD56Z22+Kd)l`sL{?5&w)PoF4wT3~d|C;+ON zbAYOrWY}W1j2qjfv41#H9V{K~mDl~{NOO^^yVx}x{WoW((88YBC~x!PW_oxJMBw2zuuZzS5NO26|AgdWgRQ)cxnBhQ4#o9^_wZ5Wh0m>ps>7BxaSGv zr>Ve<=A4xEEg$_;kaa(%y*wfhSzTtU&S#G$6bM522{b-}#uvk$w%^bR`V94V_1E=t md;0?3zSMMR%@NRc3dM>l(6Bn4KDdDOOU+mu-u$6h>HjCZKDVU+ literal 0 HcmV?d00001 diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..525a66f --- /dev/null +++ b/src/main.py @@ -0,0 +1,20 @@ +from flask import Flask, jsonify, request + +app = Flask(__name__) + +@app.route("/api/active_tables") +def hello(): + return jsonify([{ + "a": 1, + "b": "b", + "potato": "potato" + }]) + +@app.route("/api/tables") +def potato(): + return jsonify([{ + "id": 1, + "table_name": "Nuntis", + "table_link": "vtt.cyberpunkrush.com/nuntis", + "active": False + }])