commit b7b0f253ceffde80e1c59fbde0cc5575c6cca28b Author: Bobban Rydh Date: Thu Oct 22 21:00:25 2026 +0200 first commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..43870ca --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +node_modules +.next +.git +.env +.env.* +!.env.example +data +uploads +docker-compose*.yml +Dockerfile +README.md +*.tsbuildinfo diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c72f1f2 --- /dev/null +++ b/.env.example @@ -0,0 +1,31 @@ +# Kopiera till .env och fyll i. .env ska aldrig checkas in. + +# ---------- Produktion (docker-compose.prod.yml) ---------- +# Använd bara bokstäver och siffror i lösenordet, det ingår i en URL. +POSTGRES_PASSWORD= +POSTGRES_USER=bookmanager +POSTGRES_DB=bookmanager + +# Slumpmässig hemlighet för sessioner: openssl rand -base64 32 +AUTH_SECRET= +# Adressen som användarna öppnar, utan avslutande snedstreck +AUTH_URL=https://bocker.example.com +# Port på värddatorn som appen publiceras på +APP_PORT=3000 + +# ---------- Authentik ---------- +# Issuer-URL från din OAuth2/OpenID-provider i Authentik, med avslutande snedstreck: +# https://authentik.example.com/application/o/bokplanerare/ +AUTHENTIK_ISSUER= +AUTHENTIK_CLIENT_ID= +AUTHENTIK_CLIENT_SECRET= + +# ---------- Kartor (valfritt) ---------- +# Standard är OpenStreetMaps publika servrar, som är tänkta för lätt användning. +# MAP_TILE_URL=https://tile.openstreetmap.org/{z}/{x}/{y}.png +# MAP_TILE_ATTRIBUTION=© OpenStreetMap-bidragsgivare +# MAP_GEOCODER_URL=https://nominatim.openstreetmap.org/search + +# ---------- Utveckling (docker-compose.dev.yml) ---------- +# Inloggning utan Authentik, bara i utvecklingsläge. Sätt false för att testa mot Authentik. +# AUTH_DEV_LOGIN=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7538666 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +node_modules +.next +out +next-env.d.ts +*.tsbuildinfo +.env +.env.* +!.env.example +data/ +uploads/ +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b50ee4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +# syntax=docker/dockerfile:1 + +ARG NODE_VERSION=22 + +# ---------- Gemensam bas ---------- +FROM node:${NODE_VERSION}-bookworm-slim AS base +RUN apt-get update \ + && apt-get install -y --no-install-recommends openssl ca-certificates \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app + +# ---------- Utveckling (docker-compose.dev.yml) ---------- +# Källkoden monteras in som volym, så här installeras bara beroenden. +FROM base AS dev +ENV NODE_ENV=development +COPY package.json package-lock.json* ./ +COPY prisma ./prisma +RUN npm ci || npm install +RUN npx prisma generate +EXPOSE 3000 +CMD ["npm", "run", "dev"] + +# ---------- Bygge ---------- +FROM base AS build +COPY package.json package-lock.json* ./ +COPY prisma ./prisma +RUN npm ci || npm install +COPY . . +ENV NEXT_TELEMETRY_DISABLED=1 +# Platshållare som bara behövs för att bygget ska kunna köras. Riktiga värden sätts vid start. +RUN DATABASE_URL="postgresql://build:build@localhost:5432/build" AUTH_SECRET="build-only" npm run build + +# ---------- Produktion ---------- +FROM base AS prod +ENV NODE_ENV=production \ + NEXT_TELEMETRY_DISABLED=1 \ + PORT=3000 \ + HOSTNAME=0.0.0.0 \ + UPLOAD_DIR=/data/uploads +COPY package.json package-lock.json* ./ +COPY prisma ./prisma +RUN (npm ci --omit=dev || npm install --omit=dev) && npx prisma generate && npm cache clean --force +COPY --from=build /app/.next ./.next +COPY --from=build /app/next.config.mjs ./next.config.mjs +RUN mkdir -p /data/uploads && chown -R node:node /data /app +USER node +EXPOSE 3000 +HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \ + CMD node -e "fetch('http://127.0.0.1:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" +# Migrationer körs vid varje start innan appen startar. +CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"] diff --git a/Mall/Bostadsmall.docx b/Mall/Bostadsmall.docx new file mode 100644 index 0000000..dc10e6a Binary files /dev/null and b/Mall/Bostadsmall.docx differ diff --git a/Mall/Djurmall.docx b/Mall/Djurmall.docx new file mode 100644 index 0000000..b3dfdc4 Binary files /dev/null and b/Mall/Djurmall.docx differ diff --git a/Mall/Företagsmall.docx b/Mall/Företagsmall.docx new file mode 100644 index 0000000..934af4e Binary files /dev/null and b/Mall/Företagsmall.docx differ diff --git a/Mall/Karaktärermall-kort.docx b/Mall/Karaktärermall-kort.docx new file mode 100644 index 0000000..89106e2 Binary files /dev/null and b/Mall/Karaktärermall-kort.docx differ diff --git a/Mall/Karaktärermall.docx b/Mall/Karaktärermall.docx new file mode 100644 index 0000000..40a508d Binary files /dev/null and b/Mall/Karaktärermall.docx differ diff --git a/Mall/Lokalmall.docx b/Mall/Lokalmall.docx new file mode 100644 index 0000000..8d87a08 Binary files /dev/null and b/Mall/Lokalmall.docx differ diff --git a/Mall/Relationsmall.docx b/Mall/Relationsmall.docx new file mode 100644 index 0000000..5ffaa65 Binary files /dev/null and b/Mall/Relationsmall.docx differ diff --git a/Mall/Scenariomall.docx b/Mall/Scenariomall.docx new file mode 100644 index 0000000..7e43930 Binary files /dev/null and b/Mall/Scenariomall.docx differ diff --git a/Mall/Schema dag.docx b/Mall/Schema dag.docx new file mode 100644 index 0000000..8205f81 Binary files /dev/null and b/Mall/Schema dag.docx differ diff --git a/Mall/Schema natt.docx b/Mall/Schema natt.docx new file mode 100644 index 0000000..ac63dd3 Binary files /dev/null and b/Mall/Schema natt.docx differ diff --git a/Mall/Utbildningsmall.docx b/Mall/Utbildningsmall.docx new file mode 100644 index 0000000..8026f39 Binary files /dev/null and b/Mall/Utbildningsmall.docx differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebc9b39 --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# Bokplanerare + +Webbaserat planeringsverktyg för författare. Flera böcker, var och en med karaktärer, husdjur, bostäder, platser, företag, lokaler, scenarier, relationer, arbetsscheman och kartor med markeringar. + +- **Next.js 15** (App Router, TypeScript) med utseende från **Tabler** +- **PostgreSQL** via Prisma +- Inloggning med **Authentik** (OpenID Connect via Auth.js) +- Svenska och engelska i gränssnittet (växlas i sidomenyn) +- Kartor: riktig karta (Leaflet + OpenStreetMap) eller egen uppladdad kartbild per karta + +## Starta för utveckling + +```bash +docker compose -f docker-compose.dev.yml up --build +``` + +Öppna http://localhost:3000. Utan Authentik-inställningar visas en **utvecklarinloggning** (bara i utvecklingsläge, finns aldrig i produktionsbygget). Källkoden monteras in så ändringar slår igenom direkt. + +Vill du testa mot din riktiga Authentik: kopiera `.env.example` till `.env`, fyll i `AUTHENTIK_*` och sätt `AUTH_DEV_LOGIN=false`. + +Ändrar du `prisma/schema.prisma`: + +```bash +docker compose -f docker-compose.dev.yml exec app npx prisma migrate dev --name beskrivning +``` + +Ändrar du `package.json`, starta om med `docker compose -f docker-compose.dev.yml up --build -V` så att beroendevolymen byggs om. + +## Sätta upp Authentik + +1. I Authentik: **Applications → Applications → Create with Provider**, välj **OAuth2/OpenID Connect**. +2. Client type **Confidential**. Under **Redirect URIs** lägg till (exakt match): + `https://din-adress.example.com/api/auth/callback/authentik` + (för lokal test mot Authentik: `http://localhost:3000/api/auth/callback/authentik`) +3. Scopes: `openid`, `profile`, `email`. +4. Kopiera **Client ID**, **Client Secret** och **OpenID Configuration Issuer** (slutar på `/application/o//`) till `.env`. + +## Produktion + +```bash +cp .env.example .env # fyll i lösenord, AUTH_SECRET, AUTH_URL och AUTHENTIK_* +docker compose -f docker-compose.prod.yml --env-file .env up -d --build +``` + +- Appen lyssnar på port `APP_PORT` (standard 3000). Lägg en omvänd proxy med HTTPS framför och sätt `AUTH_URL` till den publika adressen. +- Databasmigreringar körs automatiskt vid varje start. +- Data ligger i Docker-volymerna `db-data` (databas) och `uploads` (bilder). Ta backup på båda, eller använd **Bokinställningar → Exportera som JSON** per bok. +- Hälsokontroll: `/api/health`. + +## Mallar + +Varje typ (karaktär, husdjur, bostad, plats, företag, lokal, utbildning, scenario) och relationer har en mall som styr vilka fält formuläret har. Standardmallarna är byggda efter Word-mallarna i `Mall/`: + +| Word-mall | I appen | +|---|---| +| Karaktärsmall (lång och kort) | Karaktär. Den korta finns som knappen *Ladda kort mall* i mallredigeraren | +| Djurmall, Bostadsmall, Företagsmall, Lokalmall, Scenariomall | Husdjur, Bostad, Företag, Lokal, Scenario | +| Utbildningsmall | Utbildning | +| Relationsmall | Relation (öppnas från relationslistan eller från en posts sida) | +| Schema dag / natt | Scheman, vyn *Timrutnät* med Dag 06–18 och Natt 18–06 | +| Karaktärs-ID, Bostads-ID, Skiss-ID ... | Fältet *ID / kod* på alla poster (valfritt, sökbart) | + +Uppgifter som i Word-mallarna är ID-listor (anställda, boende, elever, involverade karaktärer, ägare) görs i appen som **relationer** mellan poster, till exempel ”Jobbar på”, ”Bor på”, ”Elev på”, ”Involverad i”. Då kan du klicka dig mellan dem och se dem i relationsdiagrammet. + +En relation kan ha fler än två deltagare, till exempel en vännergrupp: välj två i *Från* och *Till* och resten under *Fler deltagare*. Gruppen ritas som ett nav i diagrammet, och den visas på varje deltagares sida. + +Under **Mallar** kan du ändra fält, ordning, rubriker och fälttyper (text, textruta, tal, datum, val, kryssruta, länk) per bok, eller klistra in en mall som JSON: + +```json +[ + { "key": "nickname", "label": "Smeknamn", "type": "text", "section": "Grunduppgifter" }, + { "key": "mood", "label": "Läggning", "type": "select", "options": ["Glad", "Butter"] } +] +``` + +Ändrar du en mall försvinner ingen data: värden för borttagna fält finns kvar i databasen. + +## Kartor + +- **Riktig karta**: sök adress, klicka där markeringen ska sitta, koppla den till en bostad, lokal eller plats. Dra för att flytta. *Spara vy* minns utsnittet. +- **Egen kartbild**: ladda upp en bild (PNG/JPG/WebP/GIF, max 15 MB) och placera markeringar på den. +- Från en posts sida kan du gå direkt till *Placera på karta*. +- Kartplattor och adressökning hämtas som standard från OpenStreetMaps publika servrar, som är tänkta för lätt användning. För tyngre bruk, sätt `MAP_TILE_URL` och `MAP_GEOCODER_URL` till egen eller betald tjänst. Adressökningar skickas då från webbläsaren till den tjänsten. + +## Struktur + +``` +prisma/ schema och migreringar +src/auth*.ts Authentik-inloggning (Auth.js) +src/actions/ server actions (skriv-operationer) +src/app/ sidor och API-routes +src/components/ gränssnittskomponenter (Tabler) +src/i18n/ sv.ts och en.ts +src/lib/templates.ts standardmallar och validering +``` + +Varje bok tillhör användaren som skapade den; andra inloggade användare kommer inte åt den. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..0f1f652 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,56 @@ +# Utvecklingsmiljö: docker compose -f docker-compose.dev.yml up --build +# Appen körs med hot reload på http://localhost:3000 och källkoden monteras in från mappen. +name: bookmanager-dev + +services: + db: + image: postgres:16-alpine + environment: + POSTGRES_USER: bookmanager + POSTGRES_PASSWORD: bookmanager + POSTGRES_DB: bookmanager + ports: + - "5432:5432" # för t.ex. DBeaver eller psql från värddatorn + volumes: + - dev-db:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U bookmanager -d bookmanager"] + interval: 5s + timeout: 5s + retries: 10 + + app: + build: + context: . + target: dev + depends_on: + db: + condition: service_healthy + environment: + DATABASE_URL: postgresql://bookmanager:bookmanager@db:5432/bookmanager + AUTH_SECRET: dev-only-secret-change-me + AUTH_URL: http://localhost:3000 + AUTH_TRUST_HOST: "true" + # Lokal inloggning utan Authentik. Fungerar aldrig i produktionsbygget. + AUTH_DEV_LOGIN: ${AUTH_DEV_LOGIN:-true} + # Fyll i .env för att testa mot din riktiga Authentik + AUTHENTIK_ISSUER: ${AUTHENTIK_ISSUER:-} + AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID:-} + AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET:-} + UPLOAD_DIR: /data/uploads + WATCHPACK_POLLING: "true" # filändringar upptäcks även via Windows/Mac-volymer + NEXT_TELEMETRY_DISABLED: "1" + ports: + - "3000:3000" + volumes: + - .:/app + - node-modules:/app/node_modules # beroenden från bilden, inte från värddatorn + - next-cache:/app/.next + - dev-uploads:/data/uploads + command: sh -c "npx prisma migrate deploy && npm run dev" + +volumes: + dev-db: + dev-uploads: + node-modules: + next-cache: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..9ee6bd0 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,60 @@ +# Produktion: docker compose -f docker-compose.prod.yml --env-file .env up -d --build +# Alla hemligheter läses från .env (se .env.example). +name: bookmanager + +services: + db: + image: postgres:16-alpine + restart: unless-stopped + environment: + POSTGRES_USER: ${POSTGRES_USER:-bookmanager} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Sätt POSTGRES_PASSWORD i .env} + POSTGRES_DB: ${POSTGRES_DB:-bookmanager} + volumes: + - db-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 10s + timeout: 5s + retries: 10 + networks: + - internal + + app: + build: + context: . + target: prod + image: bookmanager:latest + restart: unless-stopped + depends_on: + db: + condition: service_healthy + environment: + DATABASE_URL: postgresql://${POSTGRES_USER:-bookmanager}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-bookmanager} + AUTH_SECRET: ${AUTH_SECRET:?Sätt AUTH_SECRET i .env} + AUTH_URL: ${AUTH_URL:?Sätt AUTH_URL i .env, t.ex. https://bocker.example.com} + AUTH_TRUST_HOST: "true" # appen körs bakom en omvänd proxy + AUTHENTIK_ISSUER: ${AUTHENTIK_ISSUER:?Sätt AUTHENTIK_ISSUER i .env} + AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID:?Sätt AUTHENTIK_CLIENT_ID i .env} + AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET:?Sätt AUTHENTIK_CLIENT_SECRET i .env} + UPLOAD_DIR: /data/uploads + MAP_TILE_URL: ${MAP_TILE_URL:-https://tile.openstreetmap.org/{z}/{x}/{y}.png} + MAP_TILE_ATTRIBUTION: ${MAP_TILE_ATTRIBUTION:-© OpenStreetMap-bidragsgivare} + MAP_GEOCODER_URL: ${MAP_GEOCODER_URL:-https://nominatim.openstreetmap.org/search} + volumes: + - uploads:/data/uploads + ports: + # Lägg en omvänd proxy (Traefik, Nginx Proxy Manager, Caddy ...) framför med HTTPS. + - "${APP_PORT:-3000}:3000" + networks: + - internal + # - proxy # avkommentera om din proxy delar ett externt Docker-nätverk (se längst ned) + +networks: + internal: + # proxy: + # external: true + +volumes: + db-data: + uploads: diff --git a/next.config.mjs b/next.config.mjs new file mode 100644 index 0000000..4315361 --- /dev/null +++ b/next.config.mjs @@ -0,0 +1,13 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + poweredByHeader: false, + eslint: { ignoreDuringBuilds: true }, + experimental: { + optimizePackageImports: ["@tabler/icons-react"], + // Kartbilder laddas upp via server actions + serverActions: { bodySizeLimit: "20mb" }, + }, +}; + +export default nextConfig; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a2fc1c7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1660 @@ +{ + "name": "bookmanager", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bookmanager", + "version": "0.1.0", + "dependencies": { + "@fontsource-variable/inter": "^5.2.5", + "@prisma/client": "^6.19.3", + "@tabler/core": "^1.7.0", + "@tabler/icons-react": "^3.49.0", + "leaflet": "^1.9.4", + "next": "^15.5.28", + "next-auth": "5.0.0-beta.32", + "prisma": "^6.19.3", + "react": "^19.1.0", + "react-dom": "^19.1.0" + }, + "devDependencies": { + "@types/leaflet": "^1.9.20", + "@types/node": "^22.10.0", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "typescript": "^5.9.3" + } + }, + "node_modules/@auth/core": { + "version": "0.41.3", + "resolved": "https://registry.npmjs.org/@auth/core/-/core-0.41.3.tgz", + "integrity": "sha512-sJ3JMHHkXMD3aOjopv7mOBTO1Ocw4b0fAEXJBz6k7YHLpYQI6C40jCUPc5fNvUKxXRXNE1/sRISA15UrwWJBTw==", + "license": "ISC", + "dependencies": { + "@panva/hkdf": "^1.2.1", + "jose": "^6.0.6", + "oauth4webapi": "^3.3.0", + "preact": "10.24.3", + "preact-render-to-string": "6.5.11" + }, + "peerDependencies": { + "@simplewebauthn/browser": "^9.0.1", + "@simplewebauthn/server": "^9.0.2", + "nodemailer": "^7.0.7 || ^8.0.5" + }, + "peerDependenciesMeta": { + "@simplewebauthn/browser": { + "optional": true + }, + "@simplewebauthn/server": { + "optional": true + }, + "nodemailer": { + "optional": true + } + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@fontsource-variable/inter": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.3.0.tgz", + "integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@next/env": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.28.tgz", + "integrity": "sha512-xxW5EBI8fMPuVTPBW7LL980IRbuDXlbkUAwp9DDhtb4Lnich3nJ13uYpvrX4VE74hWPf6AvHHAMmGCidcHjbfg==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.28.tgz", + "integrity": "sha512-dPoQYXcfSIqx5o+TOXVXO7kONK5qbtNRDeiTfII0bT3puGIT6VF5e0QwmxNZfEZ5Zety5f3m9P/p4xqwfiLlPg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.28.tgz", + "integrity": "sha512-RgCJ7buBivTH+6sddqaVm+/v8kwMHlFkobvdt3DfETutws5HrxnToMIWSN9X3MZ3aAi7BbKrGZZWUDQLEycXqw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.28.tgz", + "integrity": "sha512-OHXQe13olE59aKe++zHavGcJPh5SLHXi6Anret3BBeq1+qhSuOJDNAli/EDDfxs6UTqA4Qddo4uyYry2slyjiQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.28.tgz", + "integrity": "sha512-nTB7bB6vfn4ezCJNYP43ukt2o8L3+WxKF/sTcTxepdXsJh3SM9RhlU7wrZYbH7L4HO5M87dqDTwm8587vAkCiw==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.28.tgz", + "integrity": "sha512-WXCfVI32rW3xCusoUX1RpZKtyChWU2Zwe27JUDmM3KrXwcDNc9vV4zEq0GKFAURnuQ/Ouo/XqPvB0yh445XZCg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.28.tgz", + "integrity": "sha512-Miq+NDb/HWsXuxseYxMM6fuEOQXgTziarkKIRpVKCn8W69cEfhQaQr+90pO+u4q2CbJR2wzXmUuCFyZaJs/Nng==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.28.tgz", + "integrity": "sha512-5LR79lemgDlgxvG7MQJ+zHCkVcrUoQuO7CiIvq3I58vNW4goSOE2b+19Z6FujRWMouvni4gvudYFuFuNxolGWA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.28.tgz", + "integrity": "sha512-GNipvXUYROSTf4PXEyH95FrWImIB5zdaK6uEOg0RP1/X2drnvoMwiBkJ0VWdzX7w3iiBm3y5g2TxkKDGVTOQcg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@panva/hkdf": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.2.1.tgz", + "integrity": "sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@prisma/client": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.19.3.tgz", + "integrity": "sha512-mKq3jQFhjvko5LTJFHGilsuQs+W+T3Gm451NzuTDGQxwCzwXHYnIu2zGkRoW+Exq3Rob7yp2MfzSrdIiZVhrBg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*", + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@prisma/config": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.19.3.tgz", + "integrity": "sha512-CBPT44BjlQxEt8kiMEauji2WHTDoVBOKl7UlewXmUgBPnr/oPRZC3psci5chJnYmH0ivEIog2OU9PGWoki3DLQ==", + "license": "Apache-2.0", + "dependencies": { + "c12": "3.1.0", + "deepmerge-ts": "7.1.5", + "effect": "3.21.0", + "empathic": "2.0.0" + } + }, + "node_modules/@prisma/debug": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.19.3.tgz", + "integrity": "sha512-ljkJ+SgpXNktLG0Q/n4JGYCkKf0f8oYLyjImS2I8e2q2WCfdRRtWER062ZV/ixaNP2M2VKlWXVJiGzZaUgbKZw==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.19.3.tgz", + "integrity": "sha512-RSYxtlYFl5pJ8ZePgMv0lZ9IzVCOdTPOegrs2qcbAEFrBI1G33h6wyC9kjQvo0DnYEhEVY0X4LsuFHXLKQk88g==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3", + "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "@prisma/fetch-engine": "6.19.3", + "@prisma/get-platform": "6.19.3" + } + }, + "node_modules/@prisma/engines-version": { + "version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7.tgz", + "integrity": "sha512-03bgb1VD5gvuumNf+7fVGBzfpJPjmqV423l/WxsWk2cNQ42JD0/SsFBPhN6z8iAvdHs07/7ei77SKu7aZfq8bA==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.19.3.tgz", + "integrity": "sha512-tKtl/qco9Nt7LU5iKhpultD8O4vMCZcU2CHjNTnRrL1QvSUr5W/GcyFPjNL87GtRrwBc7ubXXD9xy4EvLvt8JA==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3", + "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "@prisma/get-platform": "6.19.3" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.19.3.tgz", + "integrity": "sha512-xFj1VcJ1N3MKooOQAGO0W5tsd0W2QzIvW7DD7c/8H14Zmp4jseeWAITm+w2LLoLrlhoHdPPh0NMZ8mfL6puoHA==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "license": "MIT" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tabler/core": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@tabler/core/-/core-1.7.0.tgz", + "integrity": "sha512-f3a18Binkl4soRdzjaf7DhJFCuJXRJ45H1mJxmCFeHvqI2QIAZ6Djq2dVtYc1jJJgYYeIyVc+Rws8dK1yQp+Uw==", + "license": "MIT", + "dependencies": { + "@popperjs/core": "^2.11.8" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + }, + "peerDependencies": { + "vanilla-calendar-pro": "^3.3.2" + }, + "peerDependenciesMeta": { + "vanilla-calendar-pro": { + "optional": true + } + } + }, + "node_modules/@tabler/icons": { + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.49.0.tgz", + "integrity": "sha512-l+GnSkFETx0U26icxv1VUFnxxiTqXfCcVRiRAnyMwibupM2S2L/hSaZ9gmSgz01rkrsH/93NvLsxykqdanc6lw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + } + }, + "node_modules/@tabler/icons-react": { + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.49.0.tgz", + "integrity": "sha512-Um59pm5RVNUaQjFUtG0r4oYJbZuBS3tGugAA2tgBg0WufMk34Eio3nsO30RUkLuL2giYPQUNdY9HvqltLLYyNA==", + "license": "MIT", + "dependencies": { + "@tabler/icons": "3.49.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + }, + "peerDependencies": { + "react": ">= 16" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/leaflet": { + "version": "1.9.22", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.22.tgz", + "integrity": "sha512-h3lhECYEKDasG7LFHu+GiHqAvsgLuQvlJvVZzJDGONo3sEL+wUOqSFLnwkZlK0qVxnxbuGFW8iBlJNYs5wgndA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/c12": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^16.6.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.4.2", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/confbox": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", + "integrity": "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==", + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge-ts": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "license": "MIT" + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/effect": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.21.0.tgz", + "integrity": "sha512-PPN80qRokCd1f015IANNhrwOnLO7GrrMQfk4/lnZRE/8j7UPWrNNjPV0uBrZutI/nHzernbW+J0hdqQysHiSnQ==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "fast-check": "^3.23.1" + } + }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/exsolve": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.3.tgz", + "integrity": "sha512-kuzL9zherLQoqDeQaS55AiiIg1kb4KYXaSusTtgZTPlvKP2gGCI82LNmBNh5RjDVUXIcmgx+/Mx7vPwRzBbhJA==", + "license": "MIT" + }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/giget": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/jose": { + "version": "6.2.13", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.13.tgz", + "integrity": "sha512-7TIg10ZE1x82YediN+lcrPNvGMKge9yFHQD+Qho/b8y2adfugU3AsvvHfxV0fzyFllT6l9xCjf4RWY9g/Z9PJQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/leaflet": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", + "license": "BSD-2-Clause" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/next": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/next/-/next-15.5.28.tgz", + "integrity": "sha512-JjhLBBY1PNnuwPtcZ7t8yxVeJVYvD2Jyp633J+gRCNbzSt7N0E+xqCf6uQiff3+3qmUkwcF/ksfSsK1xsZ76Tw==", + "license": "MIT", + "dependencies": { + "@next/env": "15.5.28", + "@swc/helpers": "0.5.15", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.5.28", + "@next/swc-darwin-x64": "15.5.28", + "@next/swc-linux-arm64-gnu": "15.5.28", + "@next/swc-linux-arm64-musl": "15.5.28", + "@next/swc-linux-x64-gnu": "15.5.28", + "@next/swc-linux-x64-musl": "15.5.28", + "@next/swc-win32-arm64-msvc": "15.5.28", + "@next/swc-win32-x64-msvc": "15.5.28", + "sharp": "^0.34.3 || ^0.35.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.51.1", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next-auth": { + "version": "5.0.0-beta.32", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-5.0.0-beta.32.tgz", + "integrity": "sha512-CGlChIEWZ6LltNVxrE5yiySMID+Idpmry47JYA5lLwgD8Sx02a8M65VL0TWVz9nbnOioS/tCW/rP/0+mE7Qp4Q==", + "license": "ISC", + "dependencies": { + "@auth/core": "0.41.3" + }, + "peerDependencies": { + "@simplewebauthn/browser": "^9.0.1", + "@simplewebauthn/server": "^9.0.2", + "next": "^14.0.0-0 || ^15.0.0 || ^16.0.0", + "nodemailer": "^7.0.7 || ^8.0.5", + "react": "^18.2.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@simplewebauthn/browser": { + "optional": true + }, + "@simplewebauthn/server": { + "optional": true + }, + "nodemailer": { + "optional": true + } + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, + "node_modules/nypm": { + "version": "0.6.11", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.11.tgz", + "integrity": "sha512-wrVBTLWDu7nTUKGWplQebWOXWnhaIwyKQhBxobH/CGxJHoVw27r9vG5ba7kdZnxG+f4rC6dZd6m2oHmpkOcO7g==", + "license": "MIT", + "dependencies": { + "citty": "^0.2.2", + "pathe": "^2.0.3", + "tinyexec": "^1.3.1" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nypm/node_modules/citty": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.2.2.tgz", + "integrity": "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==", + "license": "MIT" + }, + "node_modules/oauth4webapi": { + "version": "3.8.8", + "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-3.8.8.tgz", + "integrity": "sha512-8N28E+a/oxfXWBgOMt+ZP/JUf/XR+IFbvkAEPP3gznXOMv9BpAAwiIj0TFNz3tGTPc0ZQ8zmWBNgN1nAys0gng==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/ohash": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.12.tgz", + "integrity": "sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==", + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/pkg-types": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.4.0.tgz", + "integrity": "sha512-07Fys7iVx0X6TcviMOgogM1Lk33ZyqOezMnU79S+kffWqwolG/5W9V8EgQSeYCIfFTYVgssRbnH630Oa2+soBA==", + "license": "MIT", + "dependencies": { + "confbox": "^0.3.1", + "exsolve": "^1.1.3", + "pathe": "^2.0.3" + } + }, + "node_modules/pkg-types/node_modules/confbox": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.1.tgz", + "integrity": "sha512-cKUSoKa8YxFZZSmraVi7onONx3amu77ngK3kGpsYHDH7drPwCRkQE1RYMPlLRrMtnciRj274XNRxcHxnKmDSnA==", + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/preact": { + "version": "10.24.3", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz", + "integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/preact-render-to-string": { + "version": "6.5.11", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.5.11.tgz", + "integrity": "sha512-ubnauqoGczeGISiOh6RjX0/cdaF8v/oDXIjO85XALCQjwQP+SB4RDXXtvZ6yTYSjG+PC1QRP2AhPgCEsM2EvUw==", + "license": "MIT", + "peerDependencies": { + "preact": ">=10" + } + }, + "node_modules/prisma": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.19.3.tgz", + "integrity": "sha512-++ZJ0ijLrDJF6hNB4t4uxg2br3fC4H9Yc9tcbjr2fcNFP3rh/SBNrAgjhsqBU4Ght8JPrVofG/ZkXfnSfnYsFg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/config": "6.19.3", + "@prisma/engines": "6.19.3" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a5f7460 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "bookmanager", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "prisma generate && next build", + "start": "next start", + "typecheck": "tsc --noEmit", + "db:deploy": "prisma migrate deploy", + "db:migrate": "prisma migrate dev" + }, + "dependencies": { + "@fontsource-variable/inter": "^5.2.5", + "@prisma/client": "^6.19.3", + "@tabler/core": "^1.7.0", + "@tabler/icons-react": "^3.49.0", + "leaflet": "^1.9.4", + "next": "^15.5.28", + "next-auth": "5.0.0-beta.32", + "prisma": "^6.19.3", + "react": "^19.1.0", + "react-dom": "^19.1.0" + }, + "devDependencies": { + "@types/leaflet": "^1.9.20", + "@types/node": "^22.10.0", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", + "typescript": "^5.9.3" + } +} diff --git a/prisma/migrations/0001_init/migration.sql b/prisma/migrations/0001_init/migration.sql new file mode 100644 index 0000000..e273b43 --- /dev/null +++ b/prisma/migrations/0001_init/migration.sql @@ -0,0 +1,203 @@ +-- CreateSchema +CREATE SCHEMA IF NOT EXISTS "public"; + +-- CreateEnum +CREATE TYPE "EntityKind" AS ENUM ('CHARACTER', 'HOME', 'PLACE', 'COMPANY', 'PREMISES', 'SCENARIO', 'EDUCATION', 'PET'); + +-- CreateEnum +CREATE TYPE "MapKind" AS ENUM ('GEO', 'IMAGE'); + +-- CreateEnum +CREATE TYPE "WeekPattern" AS ENUM ('ALL', 'ODD', 'EVEN'); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "externalId" TEXT NOT NULL, + "email" TEXT, + "name" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Book" ( + "id" TEXT NOT NULL, + "ownerId" TEXT NOT NULL, + "title" TEXT NOT NULL, + "subtitle" TEXT, + "genre" TEXT, + "description" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Book_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Entity" ( + "id" TEXT NOT NULL, + "bookId" TEXT NOT NULL, + "kind" "EntityKind" NOT NULL, + "name" TEXT NOT NULL, + "summary" TEXT, + "imageFile" TEXT, + "code" TEXT, + "tags" TEXT[], + "data" JSONB NOT NULL DEFAULT '{}', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Entity_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Relation" ( + "id" TEXT NOT NULL, + "bookId" TEXT NOT NULL, + "fromId" TEXT NOT NULL, + "toId" TEXT NOT NULL, + "type" TEXT NOT NULL, + "description" TEXT, + "data" JSONB NOT NULL DEFAULT '{}', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Relation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Shift" ( + "id" TEXT NOT NULL, + "bookId" TEXT NOT NULL, + "personId" TEXT NOT NULL, + "workplaceId" TEXT, + "weekday" INTEGER NOT NULL, + "startTime" TEXT NOT NULL, + "endTime" TEXT NOT NULL, + "weeks" "WeekPattern" NOT NULL DEFAULT 'ALL', + "label" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Shift_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BookMap" ( + "id" TEXT NOT NULL, + "bookId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "kind" "MapKind" NOT NULL, + "imageFile" TEXT, + "centerLat" DOUBLE PRECISION, + "centerLng" DOUBLE PRECISION, + "zoom" INTEGER, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "BookMap_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Marker" ( + "id" TEXT NOT NULL, + "mapId" TEXT NOT NULL, + "entityId" TEXT, + "label" TEXT NOT NULL, + "note" TEXT, + "color" TEXT NOT NULL DEFAULT 'blue', + "lat" DOUBLE PRECISION NOT NULL, + "lng" DOUBLE PRECISION NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Marker_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Template" ( + "id" TEXT NOT NULL, + "bookId" TEXT NOT NULL, + "kind" TEXT NOT NULL, + "fields" JSONB NOT NULL, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Template_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "User_externalId_key" ON "User"("externalId"); + +-- CreateIndex +CREATE INDEX "Book_ownerId_idx" ON "Book"("ownerId"); + +-- CreateIndex +CREATE INDEX "Entity_bookId_kind_idx" ON "Entity"("bookId", "kind"); + +-- CreateIndex +CREATE INDEX "Entity_bookId_code_idx" ON "Entity"("bookId", "code"); + +-- CreateIndex +CREATE INDEX "Relation_bookId_idx" ON "Relation"("bookId"); + +-- CreateIndex +CREATE INDEX "Relation_fromId_idx" ON "Relation"("fromId"); + +-- CreateIndex +CREATE INDEX "Relation_toId_idx" ON "Relation"("toId"); + +-- CreateIndex +CREATE INDEX "Shift_bookId_idx" ON "Shift"("bookId"); + +-- CreateIndex +CREATE INDEX "Shift_personId_idx" ON "Shift"("personId"); + +-- CreateIndex +CREATE INDEX "Shift_workplaceId_idx" ON "Shift"("workplaceId"); + +-- CreateIndex +CREATE INDEX "BookMap_bookId_idx" ON "BookMap"("bookId"); + +-- CreateIndex +CREATE INDEX "Marker_mapId_idx" ON "Marker"("mapId"); + +-- CreateIndex +CREATE INDEX "Marker_entityId_idx" ON "Marker"("entityId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Template_bookId_kind_key" ON "Template"("bookId", "kind"); + +-- AddForeignKey +ALTER TABLE "Book" ADD CONSTRAINT "Book_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Entity" ADD CONSTRAINT "Entity_bookId_fkey" FOREIGN KEY ("bookId") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Relation" ADD CONSTRAINT "Relation_bookId_fkey" FOREIGN KEY ("bookId") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Relation" ADD CONSTRAINT "Relation_fromId_fkey" FOREIGN KEY ("fromId") REFERENCES "Entity"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Relation" ADD CONSTRAINT "Relation_toId_fkey" FOREIGN KEY ("toId") REFERENCES "Entity"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Shift" ADD CONSTRAINT "Shift_bookId_fkey" FOREIGN KEY ("bookId") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Shift" ADD CONSTRAINT "Shift_personId_fkey" FOREIGN KEY ("personId") REFERENCES "Entity"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Shift" ADD CONSTRAINT "Shift_workplaceId_fkey" FOREIGN KEY ("workplaceId") REFERENCES "Entity"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BookMap" ADD CONSTRAINT "BookMap_bookId_fkey" FOREIGN KEY ("bookId") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Marker" ADD CONSTRAINT "Marker_mapId_fkey" FOREIGN KEY ("mapId") REFERENCES "BookMap"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Marker" ADD CONSTRAINT "Marker_entityId_fkey" FOREIGN KEY ("entityId") REFERENCES "Entity"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Template" ADD CONSTRAINT "Template_bookId_fkey" FOREIGN KEY ("bookId") REFERENCES "Book"("id") ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/prisma/migrations/0002_relation_members/migration.sql b/prisma/migrations/0002_relation_members/migration.sql new file mode 100644 index 0000000..8deffa9 --- /dev/null +++ b/prisma/migrations/0002_relation_members/migration.sql @@ -0,0 +1,21 @@ +-- CreateTable +CREATE TABLE "RelationMember" ( + "id" TEXT NOT NULL, + "relationId" TEXT NOT NULL, + "entityId" TEXT NOT NULL, + + CONSTRAINT "RelationMember_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "RelationMember_entityId_idx" ON "RelationMember"("entityId"); + +-- CreateIndex +CREATE UNIQUE INDEX "RelationMember_relationId_entityId_key" ON "RelationMember"("relationId", "entityId"); + +-- AddForeignKey +ALTER TABLE "RelationMember" ADD CONSTRAINT "RelationMember_relationId_fkey" FOREIGN KEY ("relationId") REFERENCES "Relation"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "RelationMember" ADD CONSTRAINT "RelationMember_entityId_fkey" FOREIGN KEY ("entityId") REFERENCES "Entity"("id") ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..044d57c --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..c914548 --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,193 @@ +generator client { + provider = "prisma-client-js" + binaryTargets = ["native", "debian-openssl-3.0.x", "linux-musl-openssl-3.0.x"] +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +enum EntityKind { + CHARACTER + HOME + PLACE + COMPANY + PREMISES + SCENARIO + EDUCATION + PET +} + +enum MapKind { + GEO + IMAGE +} + +enum WeekPattern { + ALL + ODD + EVEN +} + +model User { + id String @id @default(cuid()) + // ":", t.ex. "authentik:abc123" + externalId String @unique + email String? + name String? + createdAt DateTime @default(now()) + books Book[] +} + +model Book { + id String @id @default(cuid()) + ownerId String + title String + subtitle String? + genre String? + description String? @db.Text + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + entities Entity[] + relations Relation[] + shifts Shift[] + maps BookMap[] + templates Template[] + + @@index([ownerId]) +} + +// Karaktärer, bostäder, platser, företag, lokaler, scenarier och husdjur. +// Mallfälten ligger i `data` (nyckel = fältets key i mallen). +model Entity { + id String @id @default(cuid()) + bookId String + kind EntityKind + name String + summary String? @db.Text + imageFile String? + code String? + tags String[] + data Json @default("{}") + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade) + outgoing Relation[] @relation("RelationFrom") + incoming Relation[] @relation("RelationTo") + shifts Shift[] @relation("ShiftPerson") + hostedShifts Shift[] @relation("ShiftWorkplace") + markers Marker[] + memberOf RelationMember[] + + @@index([bookId, kind]) + @@index([bookId, code]) +} + +model Relation { + id String @id @default(cuid()) + bookId String + fromId String + toId String + type String + description String? @db.Text + data Json @default("{}") + createdAt DateTime @default(now()) + + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade) + from Entity @relation("RelationFrom", fields: [fromId], references: [id], onDelete: Cascade) + to Entity @relation("RelationTo", fields: [toId], references: [id], onDelete: Cascade) + // Fler deltagare utöver from/to, t.ex. i en vännergrupp + members RelationMember[] + + @@index([bookId]) + @@index([fromId]) + @@index([toId]) +} + +// Arbetspass. weekday: 0 = måndag ... 6 = söndag. +model Shift { + id String @id @default(cuid()) + bookId String + personId String + workplaceId String? + weekday Int + startTime String + endTime String + weeks WeekPattern @default(ALL) + label String? + createdAt DateTime @default(now()) + + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade) + person Entity @relation("ShiftPerson", fields: [personId], references: [id], onDelete: Cascade) + workplace Entity? @relation("ShiftWorkplace", fields: [workplaceId], references: [id], onDelete: SetNull) + + @@index([bookId]) + @@index([personId]) + @@index([workplaceId]) +} + +model BookMap { + id String @id @default(cuid()) + bookId String + name String + kind MapKind + imageFile String? + centerLat Float? + centerLng Float? + zoom Int? + createdAt DateTime @default(now()) + + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade) + markers Marker[] + + @@index([bookId]) +} + +// GEO-karta: lat/lng i grader. IMAGE-karta: lat = y och lng = x i bildens pixlar (y uppåt från nederkanten). +model Marker { + id String @id @default(cuid()) + mapId String + entityId String? + label String + note String? @db.Text + color String @default("blue") + lat Float + lng Float + createdAt DateTime @default(now()) + + map BookMap @relation(fields: [mapId], references: [id], onDelete: Cascade) + entity Entity? @relation(fields: [entityId], references: [id], onDelete: SetNull) + + @@index([mapId]) + @@index([entityId]) +} + +// Egen mall för en typ i en bok. Saknas raden används standardmallen. +model Template { + id String @id @default(cuid()) + bookId String + // EntityKind eller "RELATION" + kind String + fields Json + updatedAt DateTime @updatedAt + + book Book @relation(fields: [bookId], references: [id], onDelete: Cascade) + + @@unique([bookId, kind]) +} + +model RelationMember { + id String @id @default(cuid()) + relationId String + entityId String + + relation Relation @relation(fields: [relationId], references: [id], onDelete: Cascade) + entity Entity @relation(fields: [entityId], references: [id], onDelete: Cascade) + + @@unique([relationId, entityId]) + @@index([entityId]) +} diff --git a/src/actions/books.ts b/src/actions/books.ts new file mode 100644 index 0000000..0b87e62 --- /dev/null +++ b/src/actions/books.ts @@ -0,0 +1,54 @@ +"use server"; + +import { redirect } from "next/navigation"; +import { revalidatePath } from "next/cache"; +import { prisma } from "@/lib/db"; +import { deleteImage } from "@/lib/files"; +import { optStr, revalidateBook, str } from "@/lib/form"; +import { requireBook, requireUser } from "@/lib/session"; + +export async function createBook(formData: FormData) { + const user = await requireUser(); + const title = str(formData, "title", 200); + if (!title) return; + const book = await prisma.book.create({ + data: { + ownerId: user.id, + title, + subtitle: optStr(formData, "subtitle", 200), + genre: optStr(formData, "genre", 100), + description: optStr(formData, "description"), + }, + }); + revalidatePath("/"); + redirect(`/books/${book.id}`); +} + +export async function updateBook(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const title = str(formData, "title", 200); + if (!title) return; + await prisma.book.update({ + where: { id: book.id }, + data: { + title, + subtitle: optStr(formData, "subtitle", 200), + genre: optStr(formData, "genre", 100), + description: optStr(formData, "description"), + }, + }); + revalidateBook(book.id); + revalidatePath("/"); +} + +export async function deleteBook(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const [entities, maps] = await Promise.all([ + prisma.entity.findMany({ where: { bookId: book.id, imageFile: { not: null } }, select: { imageFile: true } }), + prisma.bookMap.findMany({ where: { bookId: book.id, imageFile: { not: null } }, select: { imageFile: true } }), + ]); + await prisma.book.delete({ where: { id: book.id } }); + await Promise.all([...entities, ...maps].map((row) => deleteImage(row.imageFile))); + revalidatePath("/"); + redirect("/"); +} diff --git a/src/actions/entities.ts b/src/actions/entities.ts new file mode 100644 index 0000000..95a93e8 --- /dev/null +++ b/src/actions/entities.ts @@ -0,0 +1,77 @@ +"use server"; + +import type { Prisma } from "@prisma/client"; +import { redirect } from "next/navigation"; +import { prisma } from "@/lib/db"; +import { deleteImage, isUpload, saveImage } from "@/lib/files"; +import { optStr, parseTags, revalidateBook, str } from "@/lib/form"; +import { KIND_INFO, parseKind } from "@/lib/kinds"; +import { requireBook, requireEntity } from "@/lib/session"; +import { getTemplate } from "@/lib/templates"; +import { getLocale } from "@/i18n/server"; + +export async function saveEntity(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const id = str(formData, "id"); + const existing = id ? await requireEntity(book.id, id) : null; + const kind = existing?.kind ?? parseKind(str(formData, "kind")); + if (!kind) throw new Error("Invalid kind"); + + const name = str(formData, "name", 200); + if (!name) throw new Error("Name is required"); + + const { fields } = await getTemplate(book.id, kind, await getLocale()); + const data: Record = { ...((existing?.data as Record | null) ?? {}) }; + for (const field of fields) { + const name = `f_${field.key}`; + if (field.type === "checkbox") { + data[field.key] = formData.has(name); + continue; + } + const raw = str(formData, name, 20000); + if (raw === "") { + delete data[field.key]; + } else if (field.type === "number") { + const n = Number(raw.replace(",", ".")); + if (Number.isFinite(n)) data[field.key] = n; + } else { + data[field.key] = raw; + } + } + + let imageFile = existing?.imageFile ?? null; + const upload = formData.get("image"); + if (isUpload(upload)) { + const saved = await saveImage(upload); + await deleteImage(imageFile); + imageFile = saved; + } else if (formData.has("removeImage")) { + await deleteImage(imageFile); + imageFile = null; + } + + const values = { + name, + code: optStr(formData, "code", 50), + summary: optStr(formData, "summary"), + tags: parseTags(str(formData, "tags", 1000)), + data: data as Prisma.InputJsonObject, + imageFile, + }; + + const saved = existing + ? await prisma.entity.update({ where: { id: existing.id }, data: values }) + : await prisma.entity.create({ data: { ...values, bookId: book.id, kind } }); + + revalidateBook(book.id); + redirect(`/books/${book.id}/entity/${saved.id}`); +} + +export async function deleteEntity(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const entity = await requireEntity(book.id, str(formData, "id")); + await prisma.entity.delete({ where: { id: entity.id } }); + await deleteImage(entity.imageFile); + revalidateBook(book.id); + redirect(`/books/${book.id}/e/${KIND_INFO[entity.kind].slug}`); +} diff --git a/src/actions/maps.ts b/src/actions/maps.ts new file mode 100644 index 0000000..b3949b5 --- /dev/null +++ b/src/actions/maps.ts @@ -0,0 +1,116 @@ +"use server"; + +import { redirect } from "next/navigation"; +import { prisma } from "@/lib/db"; +import { deleteImage, isUpload, saveImage } from "@/lib/files"; +import { revalidateBook, str } from "@/lib/form"; +import { MARKER_COLORS } from "@/lib/kinds"; +import { requireBook } from "@/lib/session"; + +async function requireMap(bookId: string, mapId: string) { + const book = await requireBook(bookId); + const map = await prisma.bookMap.findFirst({ where: { id: mapId, bookId: book.id } }); + if (!map) throw new Error("Map not found"); + return { book, map }; +} + +export async function createMap(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const name = str(formData, "name", 200); + const kind = str(formData, "kind") === "IMAGE" ? "IMAGE" : "GEO"; + if (!name) return; + + let imageFile: string | null = null; + if (kind === "IMAGE") { + const upload = formData.get("image"); + if (!isUpload(upload)) return; + imageFile = await saveImage(upload); + } + + const map = await prisma.bookMap.create({ data: { bookId: book.id, name, kind, imageFile } }); + revalidateBook(book.id); + redirect(`/books/${book.id}/maps/${map.id}`); +} + +export async function renameMap(formData: FormData) { + const { book, map } = await requireMap(str(formData, "bookId"), str(formData, "mapId")); + const name = str(formData, "name", 200); + if (!name) return; + await prisma.bookMap.update({ where: { id: map.id }, data: { name } }); + revalidateBook(book.id); +} + +export async function deleteMap(formData: FormData) { + const { book, map } = await requireMap(str(formData, "bookId"), str(formData, "mapId")); + await prisma.bookMap.delete({ where: { id: map.id } }); + await deleteImage(map.imageFile); + revalidateBook(book.id); + redirect(`/books/${book.id}/maps`); +} + +export async function saveMapView(bookId: string, mapId: string, lat: number, lng: number, zoom: number) { + const { book, map } = await requireMap(bookId, mapId); + if (![lat, lng, zoom].every(Number.isFinite)) return; + await prisma.bookMap.update({ + where: { id: map.id }, + data: { centerLat: lat, centerLng: lng, zoom: Math.round(zoom) }, + }); + revalidateBook(book.id); +} + +export type MarkerInput = { + label: string; + note: string; + color: string; + entityId: string | null; + lat: number; + lng: number; +}; + +async function cleanMarker(bookId: string, input: MarkerInput) { + const label = String(input.label ?? "").trim().slice(0, 200); + if (!label) throw new Error("Label is required"); + if (!Number.isFinite(input.lat) || !Number.isFinite(input.lng)) throw new Error("Invalid position"); + const color = input.color in MARKER_COLORS ? input.color : "blue"; + let entityId: string | null = null; + if (input.entityId) { + const entity = await prisma.entity.findFirst({ where: { id: input.entityId, bookId }, select: { id: true } }); + entityId = entity?.id ?? null; + } + return { + label, + note: String(input.note ?? "").trim().slice(0, 5000) || null, + color, + entityId, + lat: input.lat, + lng: input.lng, + }; +} + +export async function createMarker(bookId: string, mapId: string, input: MarkerInput) { + const { book, map } = await requireMap(bookId, mapId); + await prisma.marker.create({ data: { ...(await cleanMarker(book.id, input)), mapId: map.id } }); + revalidateBook(book.id); +} + +export async function updateMarker(bookId: string, mapId: string, markerId: string, input: MarkerInput) { + const { book, map } = await requireMap(bookId, mapId); + await prisma.marker.updateMany({ + where: { id: markerId, mapId: map.id }, + data: await cleanMarker(book.id, input), + }); + revalidateBook(book.id); +} + +export async function moveMarker(bookId: string, mapId: string, markerId: string, lat: number, lng: number) { + const { book, map } = await requireMap(bookId, mapId); + if (![lat, lng].every(Number.isFinite)) return; + await prisma.marker.updateMany({ where: { id: markerId, mapId: map.id }, data: { lat, lng } }); + revalidateBook(book.id); +} + +export async function deleteMarker(bookId: string, mapId: string, markerId: string) { + const { book, map } = await requireMap(bookId, mapId); + await prisma.marker.deleteMany({ where: { id: markerId, mapId: map.id } }); + revalidateBook(book.id); +} diff --git a/src/actions/relations.ts b/src/actions/relations.ts new file mode 100644 index 0000000..990d6f4 --- /dev/null +++ b/src/actions/relations.ts @@ -0,0 +1,92 @@ +"use server"; + +import type { Prisma } from "@prisma/client"; +import { redirect } from "next/navigation"; +import { prisma } from "@/lib/db"; +import { optStr, revalidateBook, str } from "@/lib/form"; +import { requireBook } from "@/lib/session"; +import { getTemplate } from "@/lib/templates"; +import { getLocale } from "@/i18n/server"; + +/** Extra deltagare från formuläret: bara poster i boken, utan dubbletter och utan from/to. */ +async function cleanMemberIds(bookId: string, formData: FormData, exclude: string[]): Promise { + const wanted = [...new Set(formData.getAll("memberIds").map(String))].filter((id) => id && !exclude.includes(id)); + if (wanted.length === 0) return []; + const found = await prisma.entity.findMany({ where: { bookId, id: { in: wanted } }, select: { id: true } }); + return found.map((e) => e.id); +} + +export async function addRelation(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const fromId = str(formData, "fromId"); + const toId = str(formData, "toId"); + const type = str(formData, "type", 100); + if (!fromId || !toId || !type || fromId === toId) return; + + // Båda posterna måste höra till boken + const count = await prisma.entity.count({ where: { bookId: book.id, id: { in: [fromId, toId] } } }); + if (count !== 2) return; + + const memberIds = await cleanMemberIds(book.id, formData, [fromId, toId]); + await prisma.relation.create({ + data: { + bookId: book.id, + fromId, + toId, + type, + description: optStr(formData, "description", 2000), + members: { create: memberIds.map((entityId) => ({ entityId })) }, + }, + }); + revalidateBook(book.id); +} + +export async function saveRelation(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const relation = await prisma.relation.findFirst({ where: { id: str(formData, "id"), bookId: book.id } }); + if (!relation) throw new Error("Relation not found"); + const type = str(formData, "type", 100); + if (!type) return; + + const { fields } = await getTemplate(book.id, "RELATION", await getLocale()); + const data: Record = { ...((relation.data as Record | null) ?? {}) }; + for (const field of fields) { + const name = `f_${field.key}`; + if (field.type === "checkbox") { + data[field.key] = formData.has(name); + continue; + } + const raw = str(formData, name, 20000); + if (raw === "") { + delete data[field.key]; + } else if (field.type === "number") { + const n = Number(raw.replace(",", ".")); + if (Number.isFinite(n)) data[field.key] = n; + } else { + data[field.key] = raw; + } + } + + const memberIds = await cleanMemberIds(book.id, formData, [relation.fromId, relation.toId]); + await prisma.$transaction([ + prisma.relationMember.deleteMany({ where: { relationId: relation.id } }), + prisma.relation.update({ + where: { id: relation.id }, + data: { + type, + description: optStr(formData, "description", 2000), + data: data as Prisma.InputJsonObject, + members: { create: memberIds.map((entityId) => ({ entityId })) }, + }, + }), + ]); + revalidateBook(book.id); + redirect(`/books/${book.id}/relations/${relation.id}?saved=1`); +} + +export async function deleteRelation(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + await prisma.relation.deleteMany({ where: { id: str(formData, "id"), bookId: book.id } }); + revalidateBook(book.id); + if (formData.get("redirect") === "list") redirect(`/books/${book.id}/relations`); +} diff --git a/src/actions/settings.ts b/src/actions/settings.ts new file mode 100644 index 0000000..355a99c --- /dev/null +++ b/src/actions/settings.ts @@ -0,0 +1,12 @@ +"use server"; + +import { cookies } from "next/headers"; +import { revalidatePath } from "next/cache"; +import { isLocale } from "@/i18n/core"; + +export async function setLocale(formData: FormData) { + const locale = formData.get("locale"); + if (!isLocale(locale)) return; + (await cookies()).set("lang", locale, { path: "/", maxAge: 60 * 60 * 24 * 365, sameSite: "lax" }); + revalidatePath("/", "layout"); +} diff --git a/src/actions/shifts.ts b/src/actions/shifts.ts new file mode 100644 index 0000000..85ef23c --- /dev/null +++ b/src/actions/shifts.ts @@ -0,0 +1,48 @@ +"use server"; + +import type { WeekPattern } from "@prisma/client"; +import { prisma } from "@/lib/db"; +import { optStr, revalidateBook, str } from "@/lib/form"; +import { requireBook } from "@/lib/session"; + +const TIME = /^([01]\d|2[0-3]):[0-5]\d$/; + +export async function addShifts(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const personId = str(formData, "personId"); + const workplaceId = str(formData, "workplaceId") || null; + const startTime = str(formData, "startTime"); + const endTime = str(formData, "endTime"); + const weeksRaw = str(formData, "weeks"); + const weeks: WeekPattern = weeksRaw === "ODD" || weeksRaw === "EVEN" ? weeksRaw : "ALL"; + const days = [...new Set(formData.getAll("days").map((d) => Number(d)))].filter( + (d) => Number.isInteger(d) && d >= 0 && d <= 6, + ); + + if (!personId || days.length === 0 || !TIME.test(startTime) || !TIME.test(endTime)) return; + + const ids = [personId, ...(workplaceId ? [workplaceId] : [])]; + const found = await prisma.entity.count({ where: { bookId: book.id, id: { in: ids } } }); + if (found !== ids.length) return; + + const label = optStr(formData, "label", 100); + await prisma.shift.createMany({ + data: days.map((weekday) => ({ + bookId: book.id, + personId, + workplaceId, + weekday, + startTime, + endTime, + weeks, + label, + })), + }); + revalidateBook(book.id); +} + +export async function deleteShift(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + await prisma.shift.deleteMany({ where: { id: str(formData, "id"), bookId: book.id } }); + revalidateBook(book.id); +} diff --git a/src/actions/templates.ts b/src/actions/templates.ts new file mode 100644 index 0000000..2da0140 --- /dev/null +++ b/src/actions/templates.ts @@ -0,0 +1,41 @@ +"use server"; + +import type { Prisma } from "@prisma/client"; +import { redirect } from "next/navigation"; +import { prisma } from "@/lib/db"; +import { revalidateBook, str } from "@/lib/form"; +import { parseTemplateKind, templateSlug } from "@/lib/kinds"; +import { requireBook } from "@/lib/session"; +import { validateFields } from "@/lib/templates"; + +export async function saveTemplate(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const kind = parseTemplateKind(str(formData, "kind")); + if (!kind) throw new Error("Invalid kind"); + const url = `/books/${book.id}/templates/${templateSlug(kind)}`; + + let fields; + try { + fields = validateFields(JSON.parse(str(formData, "fields", 200000))); + } catch (error) { + const reason = error instanceof Error ? error.message : "unknown"; + redirect(`${url}?error=${encodeURIComponent(reason)}`); + } + + await prisma.template.upsert({ + where: { bookId_kind: { bookId: book.id, kind } }, + update: { fields: fields as unknown as Prisma.InputJsonArray }, + create: { bookId: book.id, kind, fields: fields as unknown as Prisma.InputJsonArray }, + }); + revalidateBook(book.id); + redirect(`${url}?saved=1`); +} + +export async function resetTemplate(formData: FormData) { + const book = await requireBook(str(formData, "bookId")); + const kind = parseTemplateKind(str(formData, "kind")); + if (!kind) throw new Error("Invalid kind"); + await prisma.template.deleteMany({ where: { bookId: book.id, kind } }); + revalidateBook(book.id); + redirect(`/books/${book.id}/templates/${templateSlug(kind)}`); +} diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx new file mode 100644 index 0000000..6462929 --- /dev/null +++ b/src/app/(main)/layout.tsx @@ -0,0 +1,7 @@ +import { Shell } from "@/components/shell"; +import { requireUser } from "@/lib/session"; + +export default async function MainLayout({ children }: { children: React.ReactNode }) { + const user = await requireUser(); + return {children}; +} diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx new file mode 100644 index 0000000..3255bc6 --- /dev/null +++ b/src/app/(main)/page.tsx @@ -0,0 +1,90 @@ +import Link from "next/link"; +import { IconBook2 } from "@tabler/icons-react"; +import { createBook } from "@/actions/books"; +import { EmptyState, PageBody, PageHeader } from "@/components/page"; +import { getT } from "@/i18n/server"; +import { prisma } from "@/lib/db"; +import { requireUser } from "@/lib/session"; + +export const metadata = { title: "Mina böcker" }; + +export default async function BooksPage() { + const user = await requireUser(); + const { t } = await getT(); + const books = await prisma.book.findMany({ + where: { ownerId: user.id }, + orderBy: { updatedAt: "desc" }, + include: { _count: { select: { entities: true } } }, + }); + + return ( + <> + + +
+
+ {books.length === 0 ? ( + {t("books.empty")} + ) : ( +
+ {books.map((book) => ( +
+ +
+
+ + + +
+
{book.title}
+ {book.subtitle ?
{book.subtitle}
: null} +
+
+ {book.description ?

{book.description}

: null} +
+ {book.genre ? {book.genre} : null} + {t("books.items", { n: book._count.entities })} +
+
+ +
+ ))} +
+ )} +
+ +
+
+
+

{t("books.new")}

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +