6 Commits

Author SHA1 Message Date
c9f227c70c read database connection string from .env 2025-12-18 19:30:57 +01:00
25c1728c27 remove dev origin 2025-12-18 19:30:29 +01:00
7df09f580a move PyQt6 to dev deps 2025-12-18 19:29:38 +01:00
407b778131 move public dir to frontend 2025-12-18 19:29:24 +01:00
a38fd042ba build frontend in node docker container 2025-12-18 19:28:39 +01:00
45a842b6fe move frontend stuff to its own directory 2025-12-18 16:47:47 +01:00
42 changed files with 28 additions and 13 deletions

View File

@@ -1,3 +1,4 @@
import os
from datetime import datetime, timezone
from sqlmodel import (
ARRAY,
@@ -10,8 +11,9 @@ from sqlmodel import (
create_engine,
)
with open("db.secrets", "r") as f:
db_secrets = f.readline().strip()
# with open("db.secrets", "r") as f:
# db_secrets = f.readline().strip()
db_secrets = f"postgresql+psycopg://{os.environ['DB_USER']}:{os.environ['DB_PASS']}@{os.environ['DB_HOST']}:{os.environ['DB_PORT']}/{os.environ['DB_NAME']}"
engine = create_engine(
db_secrets,

View File

@@ -28,10 +28,7 @@ app = FastAPI(
title="cutt", swagger_ui_parameters={"syntaxHighlight": {"theme": "monokai"}}
)
api_router = APIRouter(prefix="/api")
origins = [
"https://cutt.0124816.xyz",
"http://localhost:5173",
]
origins = ["https://cutt.0124816.xyz"]
app.add_middleware(
CORSMiddleware,

1
frontend/.env Normal file
View File

@@ -0,0 +1 @@
VITE_BASE_URL=

View File

@@ -0,0 +1,10 @@
FROM node:alpine
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build

View File

@@ -27,9 +27,9 @@
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="12.413459"
inkscape:cx="38.909381"
inkscape:cy="55.745945"
inkscape:window-width="2880"
inkscape:window-height="1800"
inkscape:cy="55.786224"
inkscape:window-width="1408"
inkscape:window-height="1727"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
@@ -53,6 +53,6 @@
id="text1"><tspan
x="39.788086"
y="29.819336"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14px;font-family:Sans;-inkscape-font-specification:'Sans Bold';fill:#ffffff;stroke:#ffffff;stroke-width:0.655;stroke-dasharray:none;stroke-opacity:1;letter-spacing:2.83px"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14px;font-family:Sans;-inkscape-font-specification:'Sans Bold';letter-spacing:2.83px;fill:#ffffff;stroke:#ffffff;stroke-width:0.655;stroke-dasharray:none;stroke-opacity:1"
id="tspan1">CUTT</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

@@ -1,6 +1,6 @@
import { useSession } from "./Session";
export const baseUrl = import.meta.env.VITE_BASE_URL as string;
export const baseUrl = "";
export async function apiAuth(
path: string,
@@ -95,6 +95,7 @@ export type LoginRequest = {
};
export const login = async (req: LoginRequest): Promise<void> => {
console.log("baseUrl", baseUrl);
try {
const response = await fetch(`${baseUrl}api/token`, {
method: "POST",

View File

@@ -11,10 +11,14 @@ dependencies = [
"matplotlib>=3.10.0",
"networkx>=3.4.2",
"passlib>=1.7.4",
"psycopg>=3.2.4",
"psycopg[binary]>=3.2.4",
"pydantic-settings>=2.7.1",
"pyjwt>=2.10.1",
"pyqt6>=6.8.0",
"sqlmodel>=0.0.22",
"uvicorn>=0.34.0",
]
[dependency-groups]
dev = [
"pyqt6>=6.10.1",
]