Compare commits
6 Commits
4d07dde87a
...
c9f227c70c
| Author | SHA1 | Date | |
|---|---|---|---|
|
c9f227c70c
|
|||
|
25c1728c27
|
|||
|
7df09f580a
|
|||
|
407b778131
|
|||
|
a38fd042ba
|
|||
|
45a842b6fe
|
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from sqlmodel import (
|
from sqlmodel import (
|
||||||
ARRAY,
|
ARRAY,
|
||||||
@@ -10,8 +11,9 @@ from sqlmodel import (
|
|||||||
create_engine,
|
create_engine,
|
||||||
)
|
)
|
||||||
|
|
||||||
with open("db.secrets", "r") as f:
|
# with open("db.secrets", "r") as f:
|
||||||
db_secrets = f.readline().strip()
|
# 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(
|
engine = create_engine(
|
||||||
db_secrets,
|
db_secrets,
|
||||||
|
|||||||
@@ -28,10 +28,7 @@ app = FastAPI(
|
|||||||
title="cutt", swagger_ui_parameters={"syntaxHighlight": {"theme": "monokai"}}
|
title="cutt", swagger_ui_parameters={"syntaxHighlight": {"theme": "monokai"}}
|
||||||
)
|
)
|
||||||
api_router = APIRouter(prefix="/api")
|
api_router = APIRouter(prefix="/api")
|
||||||
origins = [
|
origins = ["https://cutt.0124816.xyz"]
|
||||||
"https://cutt.0124816.xyz",
|
|
||||||
"http://localhost:5173",
|
|
||||||
]
|
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
|
|||||||
1
frontend/.env
Normal file
1
frontend/.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
VITE_BASE_URL=
|
||||||
10
frontend/Dockerfile.frontend
Normal file
10
frontend/Dockerfile.frontend
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM node:alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
inkscape:deskcolor="#d1d1d1"
|
inkscape:deskcolor="#d1d1d1"
|
||||||
inkscape:zoom="12.413459"
|
inkscape:zoom="12.413459"
|
||||||
inkscape:cx="38.909381"
|
inkscape:cx="38.909381"
|
||||||
inkscape:cy="55.745945"
|
inkscape:cy="55.786224"
|
||||||
inkscape:window-width="2880"
|
inkscape:window-width="1408"
|
||||||
inkscape:window-height="1800"
|
inkscape:window-height="1727"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
inkscape:window-y="0"
|
inkscape:window-y="0"
|
||||||
inkscape:window-maximized="0"
|
inkscape:window-maximized="0"
|
||||||
@@ -53,6 +53,6 @@
|
|||||||
id="text1"><tspan
|
id="text1"><tspan
|
||||||
x="39.788086"
|
x="39.788086"
|
||||||
y="29.819336"
|
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>
|
id="tspan1">CUTT</tspan></text>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
@@ -1,6 +1,6 @@
|
|||||||
import { useSession } from "./Session";
|
import { useSession } from "./Session";
|
||||||
|
|
||||||
export const baseUrl = import.meta.env.VITE_BASE_URL as string;
|
export const baseUrl = "";
|
||||||
|
|
||||||
export async function apiAuth(
|
export async function apiAuth(
|
||||||
path: string,
|
path: string,
|
||||||
@@ -95,6 +95,7 @@ export type LoginRequest = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const login = async (req: LoginRequest): Promise<void> => {
|
export const login = async (req: LoginRequest): Promise<void> => {
|
||||||
|
console.log("baseUrl", baseUrl);
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${baseUrl}api/token`, {
|
const response = await fetch(`${baseUrl}api/token`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -11,10 +11,14 @@ dependencies = [
|
|||||||
"matplotlib>=3.10.0",
|
"matplotlib>=3.10.0",
|
||||||
"networkx>=3.4.2",
|
"networkx>=3.4.2",
|
||||||
"passlib>=1.7.4",
|
"passlib>=1.7.4",
|
||||||
"psycopg>=3.2.4",
|
"psycopg[binary]>=3.2.4",
|
||||||
"pydantic-settings>=2.7.1",
|
"pydantic-settings>=2.7.1",
|
||||||
"pyjwt>=2.10.1",
|
"pyjwt>=2.10.1",
|
||||||
"pyqt6>=6.8.0",
|
|
||||||
"sqlmodel>=0.0.22",
|
"sqlmodel>=0.0.22",
|
||||||
"uvicorn>=0.34.0",
|
"uvicorn>=0.34.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = [
|
||||||
|
"pyqt6>=6.10.1",
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user