From 901b342871f304b5ad003328b450b0e6831e02a5 Mon Sep 17 00:00:00 2001 From: Lars Behrends Date: Fri, 22 May 2026 09:57:56 +0200 Subject: [PATCH] test --- .env.example | 6 +++-- AGENTS.md | 17 +++++++++++++ Dockerfile | 51 ++++++++++++++++++++++++++++++++++++++ src/lib/api/castApi.ts | 2 +- src/lib/api/mediaApi.ts | 2 +- src/lib/api/settingsApi.ts | 2 +- 6 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/.env.example b/.env.example index 809b409..b0685f0 100644 --- a/.env.example +++ b/.env.example @@ -3,8 +3,10 @@ # Used for self-referential links, OAuth callbacks, and API endpoints. APP_URL="MY_APP_URL" -# Backend API URL -VITE_API_URL="http://192.168.1.102:6400" +# Backend API URL (Omnyx Backend) +# Default: http://localhost:3001 for local dev +# Change this if backend runs on different host/port +VITE_API_URL="http://localhost:3001" # Importer Configurations # XBVR Importer diff --git a/AGENTS.md b/AGENTS.md index 70eaa42..178cea3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -378,6 +378,23 @@ export default defineConfig({ - Check tsconfig.json configuration - Use `npm run type-check` for type checking +## Task Management + +### Todo-Listen System + +Alle AIs MÜSSEN Todo-Listen für komplexe Aufgaben verwenden: + +- **Erstellung**: Bei mehreren Schritten oder komplexen Aufgaben eine Todo-Liste erstellen +- **Aktualisierung**: Fortschritt regelmäßig aktualisieren (in_progress, completed) +- **Priorisierung**: Aufgaben mit high/medium/low priorisieren +- **Dokumentation**: Wichtige Entscheidungen in der Todo festhalten + +Beispiel Workflow: +1. Todo-Liste am Anfang erstellen mit allen geplanten Schritten +2. Aktuellen Schritt als `in_progress` markieren +3. Erledigte Schritte als `completed` markieren +4. Bei neuen Erkenntnissen die Liste aktualisieren + ## Reference Resources - [React Official Documentation](https://react.dev/) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec07198 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +# Multi-stage build for Omnyx Frontend + +# Stage 1: Build +FROM node:20-alpine AS builder + +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm ci + +# Copy source code +COPY . . + +# Build the application +RUN npm run build + +# Stage 2: Production +FROM nginx:alpine AS production + +# Copy built files to nginx +COPY --from=builder /app/dist /usr/share/nginx/html + +# Copy nginx configuration +RUN echo 'server { \ + listen 3000; \ + server_name localhost; \ + location / { \ + root /usr/share/nginx/html; \ + index index.html; \ + try_files $uri $uri/ /index.html; \ + } \ + location /api { \ + proxy_pass http://backend:3001; \ + proxy_http_version 1.1; \ + proxy_set_header Upgrade $http_upgrade; \ + proxy_set_header Connection "upgrade"; \ + proxy_set_header Host $host; \ + proxy_set_header X-Real-IP $remote_addr; \ + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \ + proxy_set_header X-Forwarded-Proto $scheme; \ + } \ +}' > /etc/nginx/conf.d/default.conf + +# Expose port +EXPOSE 3000 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/src/lib/api/castApi.ts b/src/lib/api/castApi.ts index af6f548..e165bea 100644 --- a/src/lib/api/castApi.ts +++ b/src/lib/api/castApi.ts @@ -2,7 +2,7 @@ import { Staff, Media } from '../../types'; import { ApiResponse, PaginatedResponse, ApiCastItem, CreateCastInput, UpdateCastInput } from './types'; import { convertApiCastToStaff, convertApiToMedia } from './converters'; -const BASE_URL = import.meta.env.VITE_API_URL; +const BASE_URL = import.meta.env.VITE_API_URL || ''; export async function fetchAllCast(page: number = 1, limit: number = 100000): Promise { try { diff --git a/src/lib/api/mediaApi.ts b/src/lib/api/mediaApi.ts index 2f2b6b5..3c4550c 100644 --- a/src/lib/api/mediaApi.ts +++ b/src/lib/api/mediaApi.ts @@ -2,7 +2,7 @@ import { Media } from '../../types'; import { ApiResponse, PaginatedResponse, ApiMediaItem, CreateMediaInput, UpdateMediaInput } from './types'; import { convertApiToMedia } from './converters'; -const BASE_URL = import.meta.env.VITE_API_URL; +const BASE_URL = import.meta.env.VITE_API_URL || ''; export async function fetchAllMedia(page: number = 1, limit: number = 10000): Promise { try { diff --git a/src/lib/api/settingsApi.ts b/src/lib/api/settingsApi.ts index 732c2bd..d187a0f 100644 --- a/src/lib/api/settingsApi.ts +++ b/src/lib/api/settingsApi.ts @@ -2,7 +2,7 @@ import { UserSettings } from '../../types'; import { ApiResponse, ApiSettingsItem, CreateSettingsInput, UpdateSettingsInput } from './types'; import { convertApiToSettings, convertSettingsToApi } from './converters'; -const BASE_URL = import.meta.env.VITE_API_URL; +const BASE_URL = import.meta.env.VITE_API_URL || ''; export async function fetchSettings(): Promise { try {