From 1f177f859efb819c1d0da66045e1cbfdb4cbc4ee Mon Sep 17 00:00:00 2001 From: feco Date: Sun, 15 Nov 2026 21:00:50 +0000 Subject: [PATCH] Start the Next.js frontend: Google login, profile, birth data, admin services/frontend (Next.js 16, App Router) runs on port 3001 in compose. The browser only talks to the frontend: /api/v1/* is proxied to the backend, so the session cookie lives on the frontend's host, and /api/geo/* exposes the country list and place search of the horoscope-api. - /belepes: Google Identity Services button, client id from /v1/config - /profil: account facts, display name and language, own birth data with place search, DST ambiguity prompt and the chart's positions - /admin: user search, role toggles, credit grants (admins only, 404 otherwise) Services now tolerate migrations newer than their binary, so they can be rebuilt one at a time. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL --- README.md | 3 +- crates/db/src/lib.rs | 9 + docker-compose.yml | 23 +- services/backend/src/main.rs | 2 +- services/frontend/.dockerignore | 3 + services/frontend/.gitignore | 4 + services/frontend/Dockerfile | 23 + services/frontend/README.md | 70 ++ services/frontend/next.config.ts | 9 + services/frontend/package-lock.json | 1023 +++++++++++++++++ services/frontend/package.json | 23 + .../frontend/src/app/admin/AdminUsers.tsx | 182 +++ services/frontend/src/app/admin/page.tsx | 23 + .../frontend/src/app/api/geo/[kind]/route.ts | 23 + .../src/app/api/v1/[...path]/route.ts | 48 + .../frontend/src/app/belepes/GoogleLogin.tsx | 63 + services/frontend/src/app/belepes/page.tsx | 71 ++ services/frontend/src/app/globals.css | 158 +++ services/frontend/src/app/healthz/route.ts | 4 + services/frontend/src/app/layout.tsx | 31 + services/frontend/src/app/not-found.tsx | 13 + services/frontend/src/app/page.tsx | 8 + .../frontend/src/app/profil/BirthEditor.tsx | 83 ++ .../frontend/src/app/profil/BirthForm.tsx | 326 ++++++ .../frontend/src/app/profil/ProfileForm.tsx | 62 + services/frontend/src/app/profil/page.tsx | 80 ++ .../frontend/src/components/ChartTables.tsx | 140 +++ .../frontend/src/components/LogoutButton.tsx | 27 + services/frontend/src/components/NavLinks.tsx | 17 + .../frontend/src/components/SiteHeader.tsx | 29 + .../frontend/src/components/ZodiacWheel.tsx | 73 ++ services/frontend/src/google.d.ts | 33 + services/frontend/src/lib/api.ts | 45 + services/frontend/src/lib/astro.ts | 92 ++ services/frontend/src/lib/server.ts | 43 + services/frontend/src/lib/types.ts | 92 ++ services/frontend/tsconfig.json | 41 + services/worker/src/main.rs | 2 +- 38 files changed, 2996 insertions(+), 5 deletions(-) create mode 100644 services/frontend/.dockerignore create mode 100644 services/frontend/.gitignore create mode 100644 services/frontend/Dockerfile create mode 100644 services/frontend/README.md create mode 100644 services/frontend/next.config.ts create mode 100644 services/frontend/package-lock.json create mode 100644 services/frontend/package.json create mode 100644 services/frontend/src/app/admin/AdminUsers.tsx create mode 100644 services/frontend/src/app/admin/page.tsx create mode 100644 services/frontend/src/app/api/geo/[kind]/route.ts create mode 100644 services/frontend/src/app/api/v1/[...path]/route.ts create mode 100644 services/frontend/src/app/belepes/GoogleLogin.tsx create mode 100644 services/frontend/src/app/belepes/page.tsx create mode 100644 services/frontend/src/app/globals.css create mode 100644 services/frontend/src/app/healthz/route.ts create mode 100644 services/frontend/src/app/layout.tsx create mode 100644 services/frontend/src/app/not-found.tsx create mode 100644 services/frontend/src/app/page.tsx create mode 100644 services/frontend/src/app/profil/BirthEditor.tsx create mode 100644 services/frontend/src/app/profil/BirthForm.tsx create mode 100644 services/frontend/src/app/profil/ProfileForm.tsx create mode 100644 services/frontend/src/app/profil/page.tsx create mode 100644 services/frontend/src/components/ChartTables.tsx create mode 100644 services/frontend/src/components/LogoutButton.tsx create mode 100644 services/frontend/src/components/NavLinks.tsx create mode 100644 services/frontend/src/components/SiteHeader.tsx create mode 100644 services/frontend/src/components/ZodiacWheel.tsx create mode 100644 services/frontend/src/google.d.ts create mode 100644 services/frontend/src/lib/api.ts create mode 100644 services/frontend/src/lib/astro.ts create mode 100644 services/frontend/src/lib/server.ts create mode 100644 services/frontend/src/lib/types.ts create mode 100644 services/frontend/tsconfig.json diff --git a/README.md b/README.md index f45f083..7ffa3e4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Asztrológiai rendszer konténeres backendje. A frontenden kívül minden Rustba |---|---| | `services/horoscope-api` | HTTP API: születési adatokból születési horoszkóp (radix) és szinasztria | | `services/backend` | felhasználók, belépés, mentett képletek, szinasztriák, meghívók, elemzések, kreditek, megosztás. Részletek: [services/backend/README.md](services/backend/README.md) | -| `services/worker` | háttérmunkák: e-mail-küldés, takarítás (később az LLM-elemzések). Részletek: [services/worker/README.md](services/worker/README.md) | +| `services/worker` | háttérmunkák: e-mail-küldés, LLM-elemzések, takarítás. Részletek: [services/worker/README.md](services/worker/README.md) | +| `services/frontend` | Next.js webes felület: Google-belépés, profil, születési adatok, admin. Részletek: [services/frontend/README.md](services/frontend/README.md) | | `crates/db` | PostgreSQL-séma (migrációk) és a szolgáltatások közös adatelérése | | `crates/horoscope-client` | a horoscope-api HTTP-kliense (a backend és később a worker használja) | | `crates/service-kit` | közös alapok: naplózás, listen cím, healthcheck, leállítás | diff --git a/crates/db/src/lib.rs b/crates/db/src/lib.rs index 0fb02cf..0f73e30 100644 --- a/crates/db/src/lib.rs +++ b/crates/db/src/lib.rs @@ -17,6 +17,15 @@ pub use sqlx; /// All schema migrations, embedded at compile time. pub static MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("./migrations"); +/// Applies the pending migrations. Migrations newer than this binary (applied +/// by an already updated service) are tolerated, so services can be rebuilt +/// one at a time. +pub async fn migrate(pool: &PgPool) -> Result<(), sqlx::migrate::MigrateError> { + let mut migrator = sqlx::migrate!("./migrations"); + migrator.set_ignore_missing(true); + migrator.run(pool).await +} + pub async fn connect(url: &str) -> Result { PgPoolOptions::new().max_connections(20).acquire_timeout(Duration::from_secs(5)).connect(url).await } diff --git a/docker-compose.yml b/docker-compose.yml index 6112cf0..3516ab0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,7 +42,7 @@ services: environment: DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD:-sorsfonalak-dev}@postgres:5432/sorsfonalak HOROSCOPE_API_URL: http://horoscope-api:8080 - PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:3000} + PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:3001} # Plain HTTP in development; leave the default (true) in production. COOKIE_SECURE: ${COOKIE_SECURE:-false} GOOGLE_CLIENT_IDS: ${GOOGLE_CLIENT_IDS:-} @@ -68,7 +68,7 @@ services: # points it at Mailpit. SMTP_URL: ${SMTP_URL:-} MAIL_FROM: ${MAIL_FROM:-Sorsfonalak } - PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:3000} + PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:3001} # OPENROUTER_API_KEY (not in git); without it analyses stay pending. env_file: - path: .env.secrets @@ -79,5 +79,24 @@ services: read_only: true restart: unless-stopped + frontend: + build: + context: services/frontend + image: sorsfonalak/frontend:latest + # Host port 3001 (3000 is taken on the dev server). + ports: + - "3001:3000" + environment: + BACKEND_URL: http://backend:8081 + HOROSCOPE_API_URL: http://horoscope-api:8080 + depends_on: + backend: + condition: service_healthy + read_only: true + tmpfs: + - /app/.next/cache + - /tmp + restart: unless-stopped + volumes: pgdata: diff --git a/services/backend/src/main.rs b/services/backend/src/main.rs index ff90423..fb77920 100644 --- a/services/backend/src/main.rs +++ b/services/backend/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> anyhow::Result<()> { service_kit::init_logging(); let config = Config::from_env()?; let pool = db::connect(&config.database_url).await.context("connecting to the database")?; - db::MIGRATOR.run(&pool).await.context("running database migrations")?; + db::migrate(&pool).await.context("running database migrations")?; tracing::info!( google_login = !config.google_client_ids.is_empty(), horoscope_api = %config.horoscope_api_url, diff --git a/services/frontend/.dockerignore b/services/frontend/.dockerignore new file mode 100644 index 0000000..6a1de35 --- /dev/null +++ b/services/frontend/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.next +*.tsbuildinfo diff --git a/services/frontend/.gitignore b/services/frontend/.gitignore new file mode 100644 index 0000000..a8827f0 --- /dev/null +++ b/services/frontend/.gitignore @@ -0,0 +1,4 @@ +/node_modules/ +/.next/ +/next-env.d.ts +*.tsbuildinfo diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile new file mode 100644 index 0000000..3ffd9be --- /dev/null +++ b/services/frontend/Dockerfile @@ -0,0 +1,23 @@ +# Next.js frontend (standalone output) on Node 22. +FROM node:22.23-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN --mount=type=cache,target=/root/.npm,sharing=locked npm ci --no-audit --no-fund + +FROM node:22.23-alpine AS build +WORKDIR /app +ENV NEXT_TELEMETRY_DISABLED=1 +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN npm run build + +FROM node:22.23-alpine +WORKDIR /app +ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=3000 HOSTNAME=0.0.0.0 +RUN addgroup -S app && adduser -S -G app app +COPY --from=build --chown=app:app /app/.next/standalone ./ +COPY --from=build --chown=app:app /app/.next/static ./.next/static +USER app +EXPOSE 3000 +HEALTHCHECK --interval=10s --timeout=3s --retries=5 CMD wget -qO- http://127.0.0.1:3000/healthz >/dev/null || exit 1 +CMD ["node", "server.js"] diff --git a/services/frontend/README.md b/services/frontend/README.md new file mode 100644 index 0000000..87e580e --- /dev/null +++ b/services/frontend/README.md @@ -0,0 +1,70 @@ +# Frontend + +Next.js (App Router, TypeScript) webes felület. A compose-ban a **3001-es** porton fut, mert a dev szerveren a 3000-est más használja. + +## Ami kész + +- **Belépés** (`/belepes`): Google-fiókkal, a Google Identity Services gombbal. A kapott ID tokent a `POST /v1/auth/google` végpont ellenőrzi; az első belépéskor létrejön a fiók. +- **Profil** (`/profil`): + - fiókadatok: e-mail, belépési mód, szerepkörök, kreditek; + - a megjelenített név és az elemzések nyelve szerkeszthető; + - **saját születési adatok**: dátum, idő (vagy „nem tudom”), ország és település helykeresővel. Mentéskor kiszámolja a képletet, és megmutatja a pozíciókat (bolygók, tengelyek, házcsúcsok). + - A javított adatokból új képlet lesz (a backend a születési adatot nem módosítja), és az lesz a saját képlet. + - Ha a megadott időpont az óraátállítás miatt kétszer is előfordult, a felület megkérdezi, melyikről van szó. +- **Admin** (`/admin`, csak `admin` szerepkörrel; másnak 404): + - felhasználók keresése; + - szerepkörök be- és kikapcsolása (felhasználó, prémium, VIP, szerző, admin); + - kredit jóváírása. +- **Jogosultság:** a belépést nem igénylő oldalakon kívül minden oldal a szerveren ellenőrzi a munkamenetet; belépés nélkül a belépőoldalra irányít, majd vissza. + +## Felépítés + +- `src/app/api/v1/[...path]`: proxy a backend felé. A böngésző csak a frontend címét hívja, így a munkamenet-süti (`sf_session`, HttpOnly) a frontend domainjén él, és nem kell CORS. +- `src/app/api/geo/[kind]`: a horoscope-api ország- és helykeresője (`countries`, `places`). Más végpontot nem enged át. +- `src/lib/server.ts`: backend-hívás szerveroldalon a látogató munkamenetével (`getMe`, `requireMe`). +- `src/lib/api.ts`: backend-hívás a böngészőből. +- `src/lib/astro.ts`: magyar jegy- és bolygónevek, jelek, dátumformázás. +- A színek és betűk a design-vászonból jönnek (`src/app/globals.css`): éjkék háttér, arany kiemelés, Cormorant Garamond és Inter. + +## Beállítás + +| Változó | Alapérték | Mire | +|---|---|---| +| `BACKEND_URL` | `http://localhost:8081` | a backend belső címe | +| `HOROSCOPE_API_URL` | `http://localhost:8080` | a horoscope-api belső címe (helykereső) | + +A Google kliens-azonosítót a frontend a backend `GET /v1/config` végpontjáról kapja, ezért a frontendnek nem kell külön beállítás. + +## Google-belépés beállítása + +1. A Google Cloud Console-ban (APIs & Services → Credentials) hozz létre egy **OAuth client ID**-t **Web application** típussal. +2. Az **Authorized JavaScript origins** listába vedd fel azokat a címeket, ahonnan a felületet megnyitod, például: + - `http://localhost:3001` (fejlesztés); + - később az éles domaint, `https://` előtaggal. + + A Google csak `https://` vagy `localhost` címet fogad el. A dev szervert ezért SSH-alagúton keresztül nyisd meg: `ssh -L 3001:localhost:3001 dev`, utána a böngészőben `http://localhost:3001`. +3. A repó gyökerében lévő `.env` fájlba (nincs a gitben) írd be: + + ``` + GOOGLE_CLIENT_IDS=.apps.googleusercontent.com + BOOTSTRAP_ADMIN_EMAILS= + ``` + + A `BOOTSTRAP_ADMIN_EMAILS` címek az első belépéskor admin szerepkört kapnak. +4. `docker compose up -d backend` + +## Fejlesztés + +```bash +cd services/frontend +npm ci +BACKEND_URL=http://localhost:8081 HOROSCOPE_API_URL=http://localhost:8080 npm run dev # http://localhost:3001 +npm run typecheck +``` + +## Később + +- interaktív radix SVG-komponens (ugyanaz rajzolja az OG-képet is); +- szinasztria, meghívók, elemzések kérése és megjelenítése; +- angol felület; +- további belépési módok (e-mail és jelszó, Facebook, Apple, passkey). diff --git a/services/frontend/next.config.ts b/services/frontend/next.config.ts new file mode 100644 index 0000000..b040616 --- /dev/null +++ b/services/frontend/next.config.ts @@ -0,0 +1,9 @@ +import type { NextConfig } from "next"; + +const config: NextConfig = { + // Small self-contained server for the container image. + output: "standalone", + poweredByHeader: false, +}; + +export default config; diff --git a/services/frontend/package-lock.json b/services/frontend/package-lock.json new file mode 100644 index 0000000..e245202 --- /dev/null +++ b/services/frontend/package-lock.json @@ -0,0 +1,1023 @@ +{ + "name": "sorsfonalak-frontend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sorsfonalak-frontend", + "version": "0.1.0", + "dependencies": { + "next": "16.4.6", + "react": "19.3.1", + "react-dom": "19.3.1", + "server-only": "0.0.1" + }, + "devDependencies": { + "@types/node": "22.20.5", + "@types/react": "19.3.0", + "@types/react-dom": "19.3.0", + "typescript": "5.9.3" + } + }, + "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/@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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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" + ], + "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": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.4.6.tgz", + "integrity": "sha512-SunBjJ6t+oBtecS3dTjdVuMhUogP5wD/vrGL5EVuQYM1iS4O5ilL51HkiJ3sPjMzRHiCChvr4dbaSJbR7F3lxA==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.4.6.tgz", + "integrity": "sha512-kJ4VVZkley17xKaJx72QN2IBqjrj7zenCQZaUF0l9ShS/1Mt2kW4+Z5KGG6vgr3L/J562xTOizVyM1iA/u5nlg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.4.6.tgz", + "integrity": "sha512-eIPGZIqC+8JKaeZmvnCANJQF4xWkkHqSnAAajtFxgwDMAOnCgxNvP52SeWZ41PyVwoe+Le/NQuZSaQ8j7YshSA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.4.6.tgz", + "integrity": "sha512-9nI6O8vvczH2D9ZNdMGqb/3NuT15T9ksOZnAmx9/gjF2cOi74+xxyf1Hk96uIMfm14c9y6wHeBq6SH8g6udvcA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.4.6.tgz", + "integrity": "sha512-7/qPhTxDp2ScluOJOhLuhWmlA17o1yZ0SIgpISBCpBxXgtnK4+KGywBpFkfLPiU1rnSM1faFGzYkH6i7JdTrqA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.4.6.tgz", + "integrity": "sha512-oOpbNa8XOW1qCGd9VvzC4fbkkRxEls7/WI6tz+YHC0xRA7KpV1U7DrAnCPjzVyOk/karzWEepCOcTIDmwK8FwQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.4.6.tgz", + "integrity": "sha512-aM8CZ+OR2EwXaAYw7KGkW2GDmNDsLBIRe1MMRZCJPTdw/xhTD0IMUVO4sf3KqrzuRouGzwwLZn34+gFeVXiUQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.4.6.tgz", + "integrity": "sha512-U0p7/tEtqvHX2crhd841CDwKtp5CFkKXVjOhmfccR3Pvp64sj8KBwRqsvltqLOwVBbj0NtkxwXSDpEHYGbxeXQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.4.6.tgz", + "integrity": "sha512-3ZG15/5WIdlTQsIEvc9sPTTSL5XFrlLklIKmfF4fwsDnoAhu6NcBDXsk3mbGxNyo6aVLEGex+fHCv2MahY7a9g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.23", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.23.tgz", + "integrity": "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "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/baseline-browser-mapping": { + "version": "2.11.37", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.37.tgz", + "integrity": "sha512-QYph+vfurmaxhNwi9FprfmtkT5cx2Keg8FzZ0vnjO8ukscIybVyZGMFwdllKGlTI6qyU8ck43OM9UXh+IFJihQ==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001826", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz", + "integrity": "sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==", + "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/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/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/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/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": "16.4.6", + "resolved": "https://registry.npmjs.org/next/-/next-16.4.6.tgz", + "integrity": "sha512-QZJiYhaZLJMo2KpkQGQIwvmd79WVsAWeYIU554a8d7zArS3si/IRy3lBNV/rtYhE70oLwdLYhPAXLPx8HwcwtA==", + "license": "MIT", + "dependencies": { + "@next/env": "16.4.6", + "@swc/helpers": "0.5.23", + "baseline-browser-mapping": "^2.9.19", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.5.23", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=20.9.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "16.4.6", + "@next/swc-darwin-x64": "16.4.6", + "@next/swc-linux-arm64-gnu": "16.4.6", + "@next/swc-linux-arm64-musl": "16.4.6", + "@next/swc-linux-x64-gnu": "16.4.6", + "@next/swc-linux-x64-musl": "16.4.6", + "@next/swc-win32-arm64-msvc": "16.4.6", + "@next/swc-win32-x64-msvc": "16.4.6", + "sharp": "^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/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/postcss": { + "version": "8.5.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.23.tgz", + "integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==", + "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.16", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "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/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.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/server-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", + "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==", + "license": "MIT" + }, + "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/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": 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/services/frontend/package.json b/services/frontend/package.json new file mode 100644 index 0000000..a0b9b85 --- /dev/null +++ b/services/frontend/package.json @@ -0,0 +1,23 @@ +{ + "name": "sorsfonalak-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev -p 3001", + "build": "next build", + "start": "next start -p 3001", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "next": "16.4.6", + "react": "19.3.1", + "react-dom": "19.3.1", + "server-only": "0.0.1" + }, + "devDependencies": { + "@types/node": "22.20.5", + "@types/react": "19.3.0", + "@types/react-dom": "19.3.0", + "typescript": "5.9.3" + } +} diff --git a/services/frontend/src/app/admin/AdminUsers.tsx b/services/frontend/src/app/admin/AdminUsers.tsx new file mode 100644 index 0000000..a3fdc89 --- /dev/null +++ b/services/frontend/src/app/admin/AdminUsers.tsx @@ -0,0 +1,182 @@ +"use client"; + +import { useCallback, useEffect, useState } from "react"; + +import { api, errorText } from "@/lib/api"; +import { ROLE_LABELS, formatDate } from "@/lib/astro"; +import type { AdminUser, Role } from "@/lib/types"; + +const EDITABLE_ROLES: Role[] = ["user", "premium", "vip", "creator", "admin"]; + +export function AdminUsers({ selfId }: { selfId: string }) { + const [query, setQuery] = useState(""); + const [users, setUsers] = useState(null); + const [error, setError] = useState(null); + + const load = useCallback(async (q: string) => { + try { + const data = await api<{ users: AdminUser[] }>(`/admin/users?q=${encodeURIComponent(q)}`); + setUsers(data.users); + setError(null); + } catch (e) { + setError(errorText(e)); + } + }, []); + + useEffect(() => { + const t = setTimeout(() => load(query.trim()), 250); + return () => clearTimeout(t); + }, [query, load]); + + return ( +
+
+ + setQuery(e.target.value)} + placeholder="pl. anna@" + /> +
+ {error && ( +

+ {error} +

+ )} + {users === null ? ( +

Betöltés…

+ ) : users.length === 0 ? ( +

Nincs találat.

+ ) : ( +
+ + + + + + + + + + + + + {users.map((u) => ( + setUsers((list) => list?.map((x) => (x.id === next.id ? next : x)) ?? null)} + /> + ))} + +
FelhasználóSzerepkörökKreditKépletekRegisztráltUtoljára belépett
+
+ )} +
+ ); +} + +function UserRow({ user, isSelf, onChange }: { user: AdminUser; isSelf: boolean; onChange: (u: AdminUser) => void }) { + const [status, setStatus] = useState<{ ok: boolean; text: string } | null>(null); + const [busy, setBusy] = useState(false); + const [delta, setDelta] = useState(""); + + async function toggleRole(role: Role, on: boolean) { + const roles = on ? [...user.roles, role] : user.roles.filter((r) => r !== role); + if (roles.length === 0) return setStatus({ ok: false, text: "Legalább egy szerepkör kell." }); + setBusy(true); + setStatus(null); + try { + const res = await api<{ roles: Role[] }>(`/admin/users/${user.id}`, { method: "PATCH", body: { roles } }); + onChange({ ...user, roles: res.roles }); + } catch (e) { + setStatus({ ok: false, text: errorText(e) }); + } finally { + setBusy(false); + } + } + + async function grant(e: React.FormEvent) { + e.preventDefault(); + const n = Number.parseInt(delta, 10); + if (!Number.isFinite(n) || n === 0) return setStatus({ ok: false, text: "Adj meg egy nem nulla egész számot." }); + setBusy(true); + setStatus(null); + try { + await api(`/admin/users/${user.id}/credits`, { body: { delta: n, note: "admin" } }); + onChange({ ...user, credits: user.credits + n }); + setDelta(""); + setStatus({ ok: true, text: n > 0 ? `+${n} kredit` : `${n} kredit` }); + } catch (e) { + setStatus({ ok: false, text: errorText(e) }); + } finally { + setBusy(false); + } + } + + return ( + + +
{user.display_name || (nincs név)}
+
+ {user.email} + {isSelf && " · te"} +
+ + +
+ {EDITABLE_ROLES.map((role) => { + const on = user.roles.includes(role); + const locked = isSelf && role === "admin"; + return ( + + ); + })} +
+ + +
+ + {user.credits} + + + setDelta(e.target.value)} + /> + +
+ {status && ( + + {status.text} + + )} + + {user.charts} + {formatDate(user.created_at)} + {formatDate(user.last_login_at, true)} + + ); +} diff --git a/services/frontend/src/app/admin/page.tsx b/services/frontend/src/app/admin/page.tsx new file mode 100644 index 0000000..2b71bb0 --- /dev/null +++ b/services/frontend/src/app/admin/page.tsx @@ -0,0 +1,23 @@ +import type { Metadata } from "next"; +import { notFound } from "next/navigation"; + +import { requireMe } from "@/lib/server"; + +import { AdminUsers } from "./AdminUsers"; + +export const metadata: Metadata = { title: "Admin" }; + +export default async function AdminPage() { + const me = await requireMe("/admin"); + // Non-admins see the same 404 as for a missing page. + if (!me.user.roles.includes("admin")) notFound(); + return ( +
+
+

Felhasználók

+

Szerepkörök és kreditek kezelése. A prémium és a VIP szerepkör nyitja meg a drágább elemző modelleket.

+
+ +
+ ); +} diff --git a/services/frontend/src/app/api/geo/[kind]/route.ts b/services/frontend/src/app/api/geo/[kind]/route.ts new file mode 100644 index 0000000..c5517dc --- /dev/null +++ b/services/frontend/src/app/api/geo/[kind]/route.ts @@ -0,0 +1,23 @@ +// Country list and place search for the birth data form (public data from +// the horoscope-api; only these two endpoints are passed through). +import type { NextRequest } from "next/server"; + +const HOROSCOPE_API_URL = (process.env.HOROSCOPE_API_URL ?? "http://localhost:8080").replace(/\/$/, ""); +const ALLOWED = new Set(["countries", "places"]); + +export async function GET(req: NextRequest, ctx: { params: Promise<{ kind: string }> }) { + const { kind } = await ctx.params; + if (!ALLOWED.has(kind)) return Response.json({ error: { code: "not_found", message: "not found" } }, { status: 404 }); + try { + const res = await fetch(`${HOROSCOPE_API_URL}/v1/${kind}${req.nextUrl.search}`, { + // The country list rarely changes. + ...(kind === "countries" ? { next: { revalidate: 86400 } } : { cache: "no-store" as const }), + }); + return new Response(res.body, { + status: res.status, + headers: { "content-type": res.headers.get("content-type") ?? "application/json" }, + }); + } catch { + return Response.json({ error: { code: "unavailable", message: "A helykereső most nem érhető el." } }, { status: 502 }); + } +} diff --git a/services/frontend/src/app/api/v1/[...path]/route.ts b/services/frontend/src/app/api/v1/[...path]/route.ts new file mode 100644 index 0000000..7fed2fd --- /dev/null +++ b/services/frontend/src/app/api/v1/[...path]/route.ts @@ -0,0 +1,48 @@ +// Forwards /api/v1/* to the backend, so the browser talks to one origin and +// the session cookie belongs to the frontend's host (no CORS needed). +import type { NextRequest } from "next/server"; + +import { BACKEND_URL } from "@/lib/server"; + +const REQUEST_HEADERS = ["accept", "accept-language", "authorization", "content-type", "cookie", "user-agent"]; +// Hop-by-hop or re-computed by the runtime. +const SKIP_RESPONSE_HEADERS = new Set(["connection", "content-encoding", "content-length", "set-cookie", "transfer-encoding"]); + +async function forward(req: NextRequest, ctx: { params: Promise<{ path: string[] }> }) { + const { path } = await ctx.params; + const target = `${BACKEND_URL}/v1/${path.map(encodeURIComponent).join("/")}${req.nextUrl.search}`; + + const headers = new Headers(); + for (const name of REQUEST_HEADERS) { + const value = req.headers.get(name); + if (value) headers.set(name, value); + } + const forwardedFor = req.headers.get("x-forwarded-for"); + if (forwardedFor) headers.set("x-forwarded-for", forwardedFor); + + let res: Response; + try { + res = await fetch(target, { + method: req.method, + headers, + body: req.method === "GET" || req.method === "HEAD" ? undefined : await req.arrayBuffer(), + redirect: "manual", + cache: "no-store", + }); + } catch { + return Response.json({ error: { code: "backend_unavailable", message: "A szerver most nem érhető el." } }, { status: 502 }); + } + + const out = new Headers(); + res.headers.forEach((value, name) => { + if (!SKIP_RESPONSE_HEADERS.has(name)) out.set(name, value); + }); + for (const cookie of res.headers.getSetCookie()) out.append("set-cookie", cookie); + return new Response(res.body, { status: res.status, headers: out }); +} + +export const GET = forward; +export const POST = forward; +export const PATCH = forward; +export const PUT = forward; +export const DELETE = forward; diff --git a/services/frontend/src/app/belepes/GoogleLogin.tsx b/services/frontend/src/app/belepes/GoogleLogin.tsx new file mode 100644 index 0000000..35ff8c3 --- /dev/null +++ b/services/frontend/src/app/belepes/GoogleLogin.tsx @@ -0,0 +1,63 @@ +"use client"; + +import Script from "next/script"; +import { useRouter } from "next/navigation"; +import { useCallback, useEffect, useRef, useState } from "react"; + +import { api, errorText } from "@/lib/api"; + +export function GoogleLogin({ clientId, target }: { clientId: string; target: string }) { + const router = useRouter(); + const slot = useRef(null); + const [ready, setReady] = useState(false); + const [error, setError] = useState(null); + const [busy, setBusy] = useState(false); + + const onCredential = useCallback( + async (response: GoogleCredentialResponse) => { + setBusy(true); + setError(null); + try { + await api("/auth/google", { body: { id_token: response.credential } }); + router.replace(target); + router.refresh(); + } catch (e) { + setError(errorText(e)); + setBusy(false); + } + }, + [router, target], + ); + + useEffect(() => { + const google = window.google; + if (!ready || !google || !slot.current) return; + google.accounts.id.initialize({ client_id: clientId, callback: onCredential, ux_mode: "popup", itp_support: true }); + google.accounts.id.renderButton(slot.current, { + theme: "filled_black", + size: "large", + text: "continue_with", + shape: "rectangular", + locale: "hu", + width: Math.min(400, slot.current.clientWidth || 400), + }); + }, [ready, clientId, onCredential]); + + return ( +
+