commit 6bb60c49f4aaee6e0f92c80970774e3e04f54da6 Author: iamBadgers Date: Sun Mar 15 15:23:48 2026 -0700 initial server stuff 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 0000000..5694308 Binary files /dev/null and b/src/__pycache__/main.cpython-314.pyc differ 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 + }])