fix: TS errors + Docker Compose running locally
- Removed unused imports (PublicRoute, GripVertical, addFromRecipe, X, ShoppingGroup) - Fixed HouseholdCard unused var - Fixed ShoppingPage household query (missing queryFn) - Killed tmux sessions, app runs fully on Docker now - 3 containers: db (postgres:17), backend (node:22), frontend (nginx)
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
FROM node:22-alpine AS base
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
RUN npm ci
|
||||
|
||||
# Copy source
|
||||
COPY src/ src/
|
||||
COPY .env* ./
|
||||
COPY tsconfig.json ./
|
||||
|
||||
# Install tsx for running TypeScript
|
||||
RUN npm install -g tsx
|
||||
|
||||
EXPOSE 6001
|
||||
|
||||
CMD ["tsx", "src/index.ts"]
|
||||
CMD ["npx", "tsx", "src/index.ts"]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:17-alpine
|
||||
@@ -10,6 +8,8 @@ services:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-luna-recipes-secret-2026}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "127.0.0.1:5433:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U luna -d luna_recipes"]
|
||||
interval: 5s
|
||||
@@ -30,7 +30,7 @@ services:
|
||||
PORT: "6001"
|
||||
NODE_ENV: production
|
||||
ports:
|
||||
- "127.0.0.1:6001:6001"
|
||||
- "6001:6001"
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "80:80"
|
||||
- "6100:80"
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { BrowserRouter, Routes, Route } from 'react-router'
|
||||
import { AppShell } from './components/layout/AppShell'
|
||||
import { AuthProvider } from './context/AuthContext'
|
||||
import { PublicRoute } from './components/auth/AuthGuard'
|
||||
import { HomePage } from './pages/HomePage'
|
||||
import { RecipePage } from './pages/RecipePage'
|
||||
import { SearchPage } from './pages/SearchPage'
|
||||
|
||||
@@ -66,7 +66,7 @@ export function HouseholdCard() {
|
||||
|
||||
const regenMut = useMutation({
|
||||
mutationFn: () => regenerateInviteCode(household!.id),
|
||||
onSuccess: (res) => {
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ['household'] })
|
||||
showToast.success('Neuer Code generiert')
|
||||
},
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { createContext, useContext, useState, useEffect, type ReactNode } from 'react'
|
||||
import {
|
||||
type User,
|
||||
getMe,
|
||||
refreshToken,
|
||||
logout as apiLogout
|
||||
} from '../api/auth'
|
||||
import { setAuthToken, getAuthToken } from '../api/token'
|
||||
import { setAuthToken } from '../api/token'
|
||||
|
||||
interface AuthContextType {
|
||||
user: User | null
|
||||
|
||||
@@ -2,12 +2,11 @@ import { useState, useEffect, useRef } from 'react'
|
||||
import { useParams, useNavigate } from 'react-router'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import toast from 'react-hot-toast'
|
||||
import { ArrowLeft, Plus, Trash2, Camera, X, GripVertical, Link, Loader2 } from 'lucide-react'
|
||||
import { ArrowLeft, Plus, Trash2, Camera, X, Link, Loader2 } from 'lucide-react'
|
||||
import { fetchRecipe, createRecipe, updateRecipe, deleteRecipe, uploadRecipeImage, fetchOgPreview } from '../api/recipes'
|
||||
import { fetchCategories } from '../api/categories'
|
||||
import { Confetti } from '../components/ui/Confetti'
|
||||
import type { RecipeFormData } from '../api/recipes'
|
||||
import type { Ingredient, Step } from '../api/types'
|
||||
|
||||
interface IngredientRow {
|
||||
key: string
|
||||
|
||||
@@ -6,7 +6,7 @@ import toast from 'react-hot-toast'
|
||||
import { ArrowLeft, Heart, Clock, Users, ChefHat, ShoppingCart, Pencil, Minus, Plus, Send, Trash2 } from 'lucide-react'
|
||||
import { Dices } from 'lucide-react'
|
||||
import { fetchRecipe, toggleFavorite, fetchRandomRecipe } from '../api/recipes'
|
||||
import { addFromRecipe, addCustomItem } from '../api/shopping'
|
||||
import { addCustomItem } from '../api/shopping'
|
||||
import { IngredientPickerModal } from '../components/recipe/IngredientPickerModal'
|
||||
import { createNote, deleteNote } from '../api/notes'
|
||||
import { Badge } from '../components/ui/Badge'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { Trash2, Plus, X } from 'lucide-react'
|
||||
import { Trash2, Plus } from 'lucide-react'
|
||||
import {
|
||||
fetchShopping,
|
||||
addCustomItem,
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
deleteChecked,
|
||||
deleteAll,
|
||||
} from '../api/shopping'
|
||||
import type { ShoppingGroup, ShoppingItem } from '../api/shopping'
|
||||
import type { ShoppingItem } from '../api/shopping'
|
||||
import { useAuth } from '../context/AuthContext'
|
||||
import { EmptyState } from '../components/ui/EmptyState'
|
||||
|
||||
@@ -23,10 +23,19 @@ export function ShoppingPage() {
|
||||
// Check if user has a household
|
||||
const { data: householdData } = useQuery({
|
||||
queryKey: ['household'],
|
||||
queryFn: async () => {
|
||||
const { getMyHousehold } = await import('../api/households')
|
||||
try {
|
||||
const res = await getMyHousehold()
|
||||
return res.data
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
},
|
||||
enabled: isAuthenticated,
|
||||
retry: false,
|
||||
})
|
||||
const hasHousehold = !!householdData?.data
|
||||
const hasHousehold = !!householdData
|
||||
|
||||
const activeScope = hasHousehold ? scope : undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user