diff --git a/.dockerignore b/.dockerignore index 33be128..2f67877 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,6 +8,7 @@ !app !components !lib +!content !messages !i18n !global.d.ts diff --git a/.env.example b/.env.example index 1cf1800..2aef1b6 100644 --- a/.env.example +++ b/.env.example @@ -1,15 +1,5 @@ # Site NEXT_PUBLIC_SITE_URL=http://localhost:3000 -# Supabase — copy from `source scripts/export-supabase-env.sh` after `supabase start` -SUPABASE_URL=http://127.0.0.1:54321 -SUPABASE_PUBLISHABLE_KEY= -# Seed only (writes) — never use for static build / publish -SUPABASE_SECRET_KEY= - -# Legacy JWT keys (optional fallback until removed by Supabase ~late 2026) -# SUPABASE_ANON_KEY= -# SUPABASE_SERVICE_ROLE_KEY= - # Analytics (production only) NEXT_PUBLIC_GA_ID=G-QV2E7L8324 diff --git a/.github/actions/docker-build-env/action.yaml b/.github/actions/docker-build-env/action.yaml deleted file mode 100644 index aa328b6..0000000 --- a/.github/actions/docker-build-env/action.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Docker build env -description: Start local Supabase and write secret files for CI Docker validation (not publish) - -outputs: - supabase_url_file: - description: Path to supabase URL secret file for Docker build - value: ${{ steps.secrets.outputs.supabase_url_file }} - supabase_publishable_key_file: - description: Path to publishable key secret file for Docker build - value: ${{ steps.secrets.outputs.supabase_publishable_key_file }} - -runs: - using: composite - steps: - - name: Prepare Supabase - shell: bash - run: bash scripts/prepare-supabase-for-build.sh - - - name: Write Docker build secret files - id: secrets - shell: bash - env: - DOCKER_SUPABASE_URL: http://host.docker.internal:54321 - run: bash scripts/write-docker-build-secrets.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65d2f7a..693c5fd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -290,10 +290,6 @@ jobs: - name: Bootstrap Node uses: ./.github/actions/node-bootstrap - - name: Prepare Supabase for Docker build - id: docker_build_env - uses: ./.github/actions/docker-build-env - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 @@ -306,10 +302,5 @@ jobs: tags: cv:ci build-args: | NEXT_PUBLIC_SITE_URL=${{ env.NEXT_PUBLIC_SITE_URL }} - secret-files: | - supabase_url=${{ steps.docker_build_env.outputs.supabase_url_file }} - supabase_publishable_key=${{ steps.docker_build_env.outputs.supabase_publishable_key_file }} - add-hosts: | - host.docker.internal:172.17.0.1 cache-from: type=gha,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }} cache-to: type=gha,mode=max,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 433a4ae..fda0db7 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -20,24 +20,8 @@ env: NEXT_PUBLIC_SITE_URL: https://95gabor.me jobs: - supabase-migrate: - name: Apply Supabase migrations (prod) - runs-on: *runner-image - steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Bootstrap Node - uses: ./.github/actions/node-bootstrap - - - name: Push migrations to production - run: bash scripts/supabase-push-prod.sh - env: - SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }} - docker-image: name: Publish Docker image - needs: supabase-migrate runs-on: *runner-image permissions: contents: read @@ -67,14 +51,6 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Write Docker build secret files - id: docker_secrets - shell: bash - env: - SUPABASE_URL: ${{ secrets.SUPABASE_URL || vars.SUPABASE_URL }} - SUPABASE_PUBLISHABLE_KEY: ${{ secrets.SUPABASE_PUBLISHABLE_KEY || vars.SUPABASE_PUBLISHABLE_KEY }} - run: bash scripts/write-docker-build-secrets.sh - - name: Build and push Docker image uses: docker/build-push-action@v7 with: @@ -85,9 +61,6 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | NEXT_PUBLIC_SITE_URL=${{ env.NEXT_PUBLIC_SITE_URL }} - secret-files: | - supabase_url=${{ steps.docker_secrets.outputs.supabase_url_file }} - supabase_publishable_key=${{ steps.docker_secrets.outputs.supabase_publishable_key_file }} cache-from: type=gha,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }} cache-to: type=gha,mode=max,scope=${{ env.DOCKER_BUILD_CACHE_SCOPE }} platforms: | @@ -96,11 +69,7 @@ jobs: pages: name: Publish GitHub Pages - needs: supabase-migrate runs-on: *runner-image - env: - SUPABASE_URL: ${{ secrets.SUPABASE_URL || vars.SUPABASE_URL }} - SUPABASE_PUBLISHABLE_KEY: ${{ secrets.SUPABASE_PUBLISHABLE_KEY || vars.SUPABASE_PUBLISHABLE_KEY }} permissions: contents: read pages: write @@ -115,8 +84,8 @@ jobs: - name: Bootstrap Node uses: ./.github/actions/node-bootstrap - - name: Generate static site (prod Supabase) - run: bash scripts/prepare-static-site-prod.sh + - name: Generate static site + run: pnpm run generate - name: Setup Pages uses: actions/configure-pages@v6 diff --git a/.gitignore b/.gitignore index fe0ec62..a6e6a7e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,8 +57,6 @@ !public/** !scripts/ !scripts/** -!supabase/ -!supabase/** !tests/ !tests/** @@ -69,8 +67,6 @@ public/llms.txt .env .env.* !.env.example -supabase/.temp/ -supabase/.branches/ tsconfig.tsbuildinfo playwright-report/ test-results/ diff --git a/Dockerfile b/Dockerfile index 7aa77a8..76ae642 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # syntax=docker/dockerfile:1 # Multi-stage production image: Next.js static export inside Docker, served by nginx. -# Supabase credentials via BuildKit secrets (not ARG/ENV — avoids layer leakage + scanner warnings). -# CI validation uses local Supabase (host.docker.internal:54321); publish uses cloud URL. +# CV data is read from content/*.yaml at build time. FROM node:24.21.0-alpine3.24 AS builder RUN corepack enable && corepack prepare pnpm@12.4.1 --activate @@ -16,11 +15,7 @@ COPY . . ARG NEXT_PUBLIC_SITE_URL=https://95gabor.me ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL -RUN --mount=type=secret,id=supabase_url \ - --mount=type=secret,id=supabase_publishable_key \ - export SUPABASE_URL="$(cat /run/secrets/supabase_url)" && \ - export SUPABASE_PUBLISHABLE_KEY="$(cat /run/secrets/supabase_publishable_key)" && \ - pnpm run generate +RUN pnpm run generate # --- Production Stage --- FROM nginx:1.31.6-alpine3.24-slim AS production diff --git a/README.md b/README.md index 7425609..ddb069d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # CV — Next.js Personal CV site built with **Next.js 16**, **React**, **TypeScript**, -**Tailwind CSS v4**, **shadcn/ui**, and **Supabase** (build-time data fetch). -Static export to `out/` for GitHub Pages and Docker/nginx. +**Tailwind CSS v4**, **shadcn/ui**, and committed **YAML** CV data. Static +export to `out/` for GitHub Pages and Docker/nginx. ## Prerequisites -- Node.js ≥ 24.18.0 (see `.nvmrc`) -- [pnpm](https://pnpm.io/) 10.x -- [Docker](https://www.docker.com/) (for local Supabase) +- Node.js ≥ 24.21.0 (see `.nvmrc`) +- [pnpm](https://pnpm.io/) 12.x +- [Docker](https://www.docker.com/) (optional, for the production image) ## First-time setup @@ -17,23 +17,20 @@ git clone https://github.com/95gabor/cv.git cd cv pnpm install cp .env.example .env.local -pnpm exec supabase start -pnpm run db:seed pnpm run dev # → http://localhost:3000 ``` ## Common commands -| Command | Purpose | -| -------------------------------------------------------- | ------------------------------------ | -| `pnpm run dev` | Dev server (Turbopack) | -| `pnpm run build` | Static export to `out/` | -| `pnpm run generate` | Alias for `build` (CI compatibility) | -| `pnpm run lint` | ESLint | -| `pnpm run typecheck` | TypeScript | -| `pnpm run test:e2e` | Playwright functional tests | -| `pnpm run db:start` / `db:stop` / `db:reset` / `db:seed` | Local Supabase | +| Command | Purpose | +| -------------------- | ------------------------------------ | +| `pnpm run dev` | Dev server (Turbopack) | +| `pnpm run build` | Static export to `out/` | +| `pnpm run generate` | Alias for `build` (CI compatibility) | +| `pnpm run lint` | ESLint | +| `pnpm run typecheck` | TypeScript | +| `pnpm run test:e2e` | Playwright functional tests | ## Quality gate (before PR) @@ -44,14 +41,12 @@ pnpm run typecheck pnpm run build ``` -Requires Supabase env vars (`SUPABASE_URL`, `SUPABASE_PUBLISHABLE_KEY` for -build; `SUPABASE_SECRET_KEY` for seed) — see `.env.example`. +CV data lives in `content/gabor-pichner.yaml` — edit it and rebuild. ## Docker (optional) ```bash -# Requires .env.local with SUPABASE_* and running Docker daemon -bash scripts/prepare-supabase-for-build.sh +# Requires a running Docker daemon docker compose up --build # → http://localhost:8000 ``` @@ -66,5 +61,5 @@ Uses the root `Dockerfile` (Next.js build inside Docker + nginx with gzip). ## Stack -Next.js App Router · shadcn/ui · Supabase · static export · Playwright · +Next.js App Router · shadcn/ui · YAML content · static export · Playwright · Lighthouse · semantic-release diff --git a/SKILLS.md b/SKILLS.md index a85ea62..c3ef598 100644 --- a/SKILLS.md +++ b/SKILLS.md @@ -6,7 +6,7 @@ Concise skills and responsibilities for agents working on this repository. - **Next.js / React maintenance**: App Router, static export, shadcn/ui components. -- **Supabase data layer**: Migrations, seed script, build-time fetch. +- **YAML content layer**: `content/*.yaml` loaded at build time. - **TypeScript quality**: Keep type checks passing and fix surfaced issues. - **Lint/format hygiene**: ESLint and Prettier rules respected. - **CI design**: pnpm-based workflows — fast, deterministic, actionable. @@ -20,5 +20,5 @@ Concise skills and responsibilities for agents working on this repository. - `pnpm install --frozen-lockfile` - `pnpm run lint` - `pnpm run typecheck` - - `pnpm run build` (with Supabase env vars set) + - `pnpm run build` - Keep workflow steps minimal and avoid redundant build stages. diff --git a/docker-compose.yml b/docker-compose.yml index 9fcf880..71ad058 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,19 +3,8 @@ services: build: context: . dockerfile: Dockerfile - extra_hosts: - - host.docker.internal:host-gateway args: NEXT_PUBLIC_SITE_URL: ${NEXT_PUBLIC_SITE_URL:-https://95gabor.me} - secrets: - - supabase_url - - supabase_publishable_key image: ghcr.io/95gabor/cv:latest ports: - '8000:80' - -secrets: - supabase_url: - environment: SUPABASE_URL - supabase_publishable_key: - environment: SUPABASE_PUBLISHABLE_KEY diff --git a/docs/.ai/README.md b/docs/.ai/README.md index 43f93de..2c23e2a 100644 --- a/docs/.ai/README.md +++ b/docs/.ai/README.md @@ -16,22 +16,22 @@ needs. ## Stack (v2 branch) **Next.js 16** · App Router · static export · **shadcn/ui** · **Tailwind v4** · -**Supabase** (build-time fetch) · **pnpm** +**YAML content** (build-time read) · **pnpm** ## Active projects -| Project | Status | -| --------------------------------------------------------------------------- | ------------------------------------------------ | -| [next-shadcn-supabase-rewrite](../projects/next-shadcn-supabase-rewrite.md) | Phases 1–5 done on `v2`; Phase 6 cutover pending | +| Project | Status | +| --------------------------------------------------------------------------- | --------------------------------------------------- | +| [next-shadcn-supabase-rewrite](../projects/next-shadcn-supabase-rewrite.md) | Superseded: Supabase dropped, content is YAML again | ## Agent roles -| Role | Focus | -| -------------------- | --------------------------------------------- | -| **Dependency Agent** | pnpm updates in controlled batches | -| **Quality Agent** | lint, typecheck, build before PR | -| **CI Agent** | GitHub Actions — pnpm, Supabase in CI, `out/` | -| **Release Agent** | semantic-release, tag workflow, publish | +| Role | Focus | +| -------------------- | --------------------------------------- | +| **Dependency Agent** | pnpm updates in controlled batches | +| **Quality Agent** | lint, typecheck, build before PR | +| **CI Agent** | GitHub Actions — pnpm, `out/` | +| **Release Agent** | semantic-release, tag workflow, publish | See also root [`SKILLS.md`](../../SKILLS.md). diff --git a/docs/.ai/architecture.md b/docs/.ai/architecture.md index c0107b3..8b5d5a9 100644 --- a/docs/.ai/architecture.md +++ b/docs/.ai/architecture.md @@ -6,11 +6,8 @@ flowchart TB subgraph build [Build time] YAML[content/gabor-pichner.yaml] - Seed[scripts/seed-from-yaml.mts] - SB[(Supabase)] Next[next build] - YAML --> Seed --> SB - SB --> Next + YAML --> Next Next --> Static[out/] end @@ -27,15 +24,14 @@ flowchart TB ## Component responsibilities -| Layer | Owns | Does NOT own | -| -------------------------- | -------------------------------------- | --------------------------------------------------- | -| **`content/*.yaml`** | Source CV data for seeding | Runtime reads (Supabase is runtime source at build) | -| **`supabase/migrations/`** | DB schema | UI | -| **`lib/cv/*`** | Types, DB mapping, `getCvProfile()` | React markup | -| UI strings / i18n | `messages/`, `i18n/`, `next-intl` | CV body text | -| **`components/*`** | Section rendering, client widgets | Global routing | -| **`app/`** | Routes (`/`, `/hu`), metadata, sitemap | Section details | -| **`lib/seo/*`** | Metadata, JSON-LD, llms.txt content | Visual design | +| Layer | Owns | Does NOT own | +| -------------------- | -------------------------------------- | --------------- | +| **`content/*.yaml`** | Source of truth for CV data | UI strings | +| **`lib/cv/*`** | Types, YAML loader, `getCvProfile()` | React markup | +| UI strings / i18n | `messages/`, `i18n/`, `next-intl` | CV body text | +| **`components/*`** | Section rendering, client widgets | Global routing | +| **`app/`** | Routes (`/`, `/hu`), metadata, sitemap | Section details | +| **`lib/seo/*`** | Metadata, JSON-LD, llms.txt content | Visual design | ## Request / data flow @@ -43,14 +39,11 @@ flowchart TB sequenceDiagram participant Browser participant Next as Next.js Server Component - participant SB as Supabase - participant DB as PostgreSQL - - Note over Next,DB: At build time (SSG) - Next->>SB: getCvProfile(slug, locale) - SB->>DB: SELECT cv_profiles + relations - DB-->>SB: rows - SB-->>Next: CV model + participant FS as content/*.yaml + + Note over Next,FS: At build time (SSG) + Next->>FS: getCvProfile(slug, locale) + FS-->>Next: CV model Next->>Browser: Pre-rendered HTML (static export) ``` @@ -58,22 +51,20 @@ Routes: `/` (English), `/hu` (Hungarian). No client-side CV fetch in production. ## Key paths -| Task | Path | -| ---------------------- | ----------------------------------------------------- | -| Change CV data (local) | Edit YAML → `pnpm run db:seed` | -| Change CV data (prod) | Edit YAML → `pnpm run db:seed` (cloud env) → `v*` tag | -| CV types | `lib/cv/types.ts` | -| DB mapping | `lib/cv/map-from-db.ts` | -| Fetch at build | `lib/cv/fetch.ts` | -| Site meta / URL | `lib/site-config.ts` | -| UI strings (i18n) | `messages/`, `i18n/`, `next-intl` | -| Docker prod image | Root `Dockerfile` (build inside Docker + nginx) | -| Global styles | `app/globals.css` | -| Components | `components/*.tsx`, `components/ui/` | -| SEO | `lib/seo/`, `app/sitemap.ts`, `app/robots.ts` | -| E2E tests | `tests/e2e/` | -| CI | `.github/workflows/ci.yaml` | -| Deploy | `.github/workflows/publish.yaml` (on `v*` tag) | +| Task | Path | +| ----------------- | --------------------------------------------------- | +| Change CV data | Edit `content/*.yaml` → commit → release (`v*` tag) | +| CV types | `lib/cv/types.ts` | +| YAML loader | `lib/cv/fetch.ts` | +| Site meta / URL | `lib/site-config.ts` | +| UI strings (i18n) | `messages/`, `i18n/`, `next-intl` | +| Docker prod image | Root `Dockerfile` (build inside Docker + nginx) | +| Global styles | `app/globals.css` | +| Components | `components/*.tsx`, `components/ui/` | +| SEO | `lib/seo/`, `app/sitemap.ts`, `app/robots.ts` | +| E2E tests | `tests/e2e/` | +| CI | `.github/workflows/ci.yaml` | +| Deploy | `.github/workflows/publish.yaml` (on `v*` tag) | ## Styling @@ -90,13 +81,12 @@ Routes: `/` (English), `/hu` (Hungarian). No client-side CV fetch in production. ```mermaid flowchart LR Tag[v* git tag] --> Publish[publish.yaml] - Publish --> Migrate[supabase db push prod] - Migrate --> Build[pnpm run generate prod] + Publish --> Build[pnpm run generate] Build --> Pages[GitHub Pages out/] Publish --> Docker[Dockerfile build + GHCR] PR[PR] --> CI[ci.yaml] CI --> Lint[lint + typecheck] - CI --> Gen[build + local Supabase] + CI --> Gen[build] CI --> E2E[Playwright on out/] CI --> LH[Lighthouse on out/] ``` @@ -110,12 +100,9 @@ flowchart LR ## Environment variables -| Variable | Purpose | -| -------------------------- | ---------------------------------------------------------------------- | -| `SUPABASE_URL` | Build-time Supabase API URL | -| `SUPABASE_PUBLISHABLE_KEY` | Build-time read (RLS); legacy fallback: `SUPABASE_ANON_KEY` | -| `SUPABASE_SECRET_KEY` | Seed writes only (local); legacy fallback: `SUPABASE_SERVICE_ROLE_KEY` | -| `NEXT_PUBLIC_SITE_URL` | Canonical URL, sitemap, OG | -| `NEXT_PUBLIC_GA_ID` | Google Analytics (production) | +| Variable | Purpose | +| ---------------------- | ----------------------------- | +| `NEXT_PUBLIC_SITE_URL` | Canonical URL, sitemap, OG | +| `NEXT_PUBLIC_GA_ID` | Google Analytics (production) | See `.env.example`. diff --git a/docs/.ai/coding-standards.md b/docs/.ai/coding-standards.md index b23a973..45c840c 100644 --- a/docs/.ai/coding-standards.md +++ b/docs/.ai/coding-standards.md @@ -15,11 +15,10 @@ components/ i18n/ ├── config.ts, request.ts # next-intl plugin config lib/ -├── cv/ # types, fetch, map-from-db +├── cv/ # types, YAML loader ├── seo/ # metadata, JSON-LD, llms messages/ # UI strings (en, hu) -content/ # YAML seed source -supabase/migrations/ +content/ # YAML CV data (source of truth) ``` ### Conventions diff --git a/docs/.ai/content-model.md b/docs/.ai/content-model.md index 9d406c0..7bc0b11 100644 --- a/docs/.ai/content-model.md +++ b/docs/.ai/content-model.md @@ -7,13 +7,11 @@ CV data schema, localization, and validation rules. ```mermaid flowchart LR YAML[content/gabor-pichner.yaml] - Seed[pnpm run db:seed] - DB[(Supabase)] Build[getCvProfile at build] - YAML --> Seed --> DB --> Build + YAML --> Build ``` -**Source of truth for editing:** `content/gabor-pichner.yaml` (seed into DB). +**Source of truth for editing:** `content/gabor-pichner.yaml`. **Source of truth for types:** `lib/cv/types.ts`. ## Top-level shape @@ -34,7 +32,7 @@ Type: `Record<'en' | 'hu', string>` for user-facing CV text fields. | Layer | Location | Example | | ---------- | ------------------------------------------------------ | ---------------------------------------------- | -| CV content | DB / YAML | `title.en`, `title.hu` | +| CV content | YAML | `title.en`, `title.hu` | | UI chrome | `messages/en.json`, `messages/hu.json` via `next-intl` | `cv.workExperience`, `experience.technologies` | Routing: English at `/`, Hungarian at `/hu`. @@ -70,17 +68,13 @@ See `lib/cv/types.ts` and `content/example.yaml`. `lib/site-config.ts` — URL, SEO defaults, `cv.slug` (default: `gabor-pichner`). -Optional DB override: `site_config` table via `lib/get-site-config.ts`. - ## Editing workflow 1. Edit `content/gabor-pichner.yaml`. -2. `pnpm run db:seed` (local or prod Supabase env). -3. `pnpm run dev` or `pnpm run build` to verify. -4. Prod: push `v*` tag after seeding cloud DB. +2. `pnpm run dev` or `pnpm run build` to verify. +3. Prod: commit, then release (`v*` tag). ## Do not - Put UI labels in YAML — use `messages/*.json`. - Commit secrets or `.env.local`. -- Edit `lib/supabase/types.ts` by hand — use `pnpm run db:types`. diff --git a/docs/.ai/workflows/edit-cv-content.md b/docs/.ai/workflows/edit-cv-content.md index 697b82f..7a4d638 100644 --- a/docs/.ai/workflows/edit-cv-content.md +++ b/docs/.ai/workflows/edit-cv-content.md @@ -14,11 +14,10 @@ Schema: [../content-model.md](../content-model.md) ```mermaid flowchart LR Edit[Edit content/*.yaml] - Seed[pnpm run db:seed] Dev[pnpm run dev] Check[Visual check en + hu] Build[pnpm run build] - Edit --> Seed --> Dev --> Check --> Build + Edit --> Dev --> Check --> Build ``` ## Checklist @@ -31,14 +30,12 @@ flowchart LR ## New CV profile 1. Copy `content/example.yaml` → `content/.yaml` -2. Add seed logic or extend `scripts/seed-from-yaml.mts` for the new slug -3. Update `lib/site-config.ts` → `cv.slug` -4. Replace `public/` assets as needed +2. Update `lib/site-config.ts` → `cv.slug` +3. Replace `public/` assets as needed ## Verify ```bash -pnpm run db:seed pnpm run dev pnpm run build ``` diff --git a/docs/.ai/workflows/local-setup.md b/docs/.ai/workflows/local-setup.md index e63dca4..bfa4338 100644 --- a/docs/.ai/workflows/local-setup.md +++ b/docs/.ai/workflows/local-setup.md @@ -6,11 +6,9 @@ Human guide: [`../../setup.md`](../../setup.md) ```bash cd /path/to/cv -nvm use # Node 24.18.0 +nvm use # Node 24.21.0 pnpm install cp .env.example .env.local -pnpm exec supabase start -pnpm run db:seed pnpm run dev # http://localhost:3000 ``` @@ -34,5 +32,5 @@ pnpm run build ## Report back - Node / pnpm versions -- Whether Supabase + dev server started -- Any errors from install, seed, or build +- Whether the dev server started +- Any errors from install or build diff --git a/docs/.ai/workflows/release.md b/docs/.ai/workflows/release.md index dfde369..df84a0a 100644 --- a/docs/.ai/workflows/release.md +++ b/docs/.ai/workflows/release.md @@ -20,23 +20,10 @@ release. Release workflow (see above); semantic-release creates the tag and GitHub release, which triggers publish. -1. **Supabase migrations** — `supabase-push-prod.sh` (`db push --db-url`) -2. **GitHub Pages** — `prepare-static-site-prod.sh` → upload `out/` (prod data) -3. **GHCR Docker** — `Dockerfile` build with prod `SUPABASE_*` secrets +1. **GitHub Pages** — `pnpm run generate` → upload `out/` +2. **GHCR Docker** — `Dockerfile` build (CV data comes from committed YAML) -Required for publish: **secrets** `SUPABASE_DB_URL`, `SUPABASE_URL`, -`SUPABASE_PUBLISHABLE_KEY` (URL and publishable key may be repository variables -instead). Seed uses `SUPABASE_SECRET_KEY` locally only. - -Seed prod content **before** running Release if CV data changed (migrations do -not seed): - -```bash -export SUPABASE_URL=https://.supabase.co -export SUPABASE_SECRET_KEY= -pnpm run db:seed -# Then: GitHub → Actions → Release → Run workflow -``` +No CV data secrets are required. Commit YAML changes before running Release. ## Pre-release verify @@ -51,10 +38,9 @@ Preview static output: npx http-server out -p 4173 ``` -Preview Docker image (local Supabase): +Preview Docker image: ```bash -bash scripts/prepare-supabase-for-build.sh docker compose up --build # → http://localhost:8000 ``` diff --git a/docs/.ai/workflows/run-and-verify.md b/docs/.ai/workflows/run-and-verify.md index 2ed1793..2921b21 100644 --- a/docs/.ai/workflows/run-and-verify.md +++ b/docs/.ai/workflows/run-and-verify.md @@ -15,8 +15,6 @@ pnpm run build | Typecheck | Exit 0 | | Build | Static output in `out/`, sitemap + robots + llms.txt | -Requires `SUPABASE_URL` and `SUPABASE_SERVICE_ROLE_KEY` (local Supabase or CI). - ## E2E (when UI/routing changed) ```bash diff --git a/docs/README.md b/docs/README.md index ce13e1a..615d24f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ docs/.ai/ ├── README.md ← entry point ├── architecture.md ├── coding-standards.md -├── content-model.md ← CV schema, YAML seed, i18n model +├── content-model.md ← CV schema, YAML source, i18n model └── workflows/ ├── local-setup.md ├── edit-cv-content.md diff --git a/docs/content.md b/docs/content.md index 96310be..e14430b 100644 --- a/docs/content.md +++ b/docs/content.md @@ -13,7 +13,7 @@ | `lib/site-config.ts` → `cv.slug` | Which profile to load (`gabor-pichner`) | | `messages/en.json`, `messages/hu.json` | UI strings — **not** CV body text | -After YAML edits, run `pnpm run db:seed` to update local Supabase. +The YAML is read at build time by `lib/cv/fetch.ts`; no extra step is needed. ## Bilingual model @@ -37,14 +37,11 @@ field. ```mermaid flowchart TB YAML[content/gabor-pichner.yaml] - Seed[db:seed] - DB[(Supabase)] - YAML --> Seed --> DB - DB --> Header[Header] - DB --> Work[Experience] - DB --> Edu[Education] - DB --> Skills[Skills] - DB --> Hobbies[Hobbies] + YAML --> Header[Header] + YAML --> Work[Experience] + YAML --> Edu[Education] + YAML --> Skills[Skills] + YAML --> Hobbies[Hobbies] ``` ## Common fields @@ -83,7 +80,7 @@ Hobbies: localized `name.en` / `name.hu`, optional `link`. ## Validation - Types: `lib/cv/types.ts` -- Seed script validates while inserting: `scripts/seed-from-yaml.mts` +- Loader checks required top-level sections: `lib/cv/fetch.ts` - Full build check: `pnpm run build` ## UI strings (not in YAML) diff --git a/docs/projects/README.md b/docs/projects/README.md index 0796116..6179947 100644 --- a/docs/projects/README.md +++ b/docs/projects/README.md @@ -2,9 +2,9 @@ Documentation for larger, multi-step initiatives. -| Project | Status | Description | -| ----------------------------------------------------------------- | --------------- | ------------------------------------------------------------ | -| [next-shadcn-supabase-rewrite](./next-shadcn-supabase-rewrite.md) | cutover pending | Next + shadcn + Supabase SSG → GitHub Pages (`v2`, **pnpm**) | +| Project | Status | Description | +| ----------------------------------------------------------------- | ----------------------------- | ------------------------------------------------- | +| [next-shadcn-supabase-rewrite](./next-shadcn-supabase-rewrite.md) | superseded (Supabase dropped) | Next + shadcn SSG → GitHub Pages (`v2`, **pnpm**) | ## Status values diff --git a/docs/projects/next-shadcn-supabase-rewrite.md b/docs/projects/next-shadcn-supabase-rewrite.md index 252ed5d..b25c07e 100644 --- a/docs/projects/next-shadcn-supabase-rewrite.md +++ b/docs/projects/next-shadcn-supabase-rewrite.md @@ -1,5 +1,9 @@ # Next.js + shadcn + Supabase rewrite +> **Superseded.** The Supabase data layer was dropped; CV data is committed YAML +> (`content/*.yaml`) read at build time by `lib/cv/fetch.ts`. The Next.js +> migration stays. This document is kept as historical record only. + ## Metadata | Field | Value | @@ -96,18 +100,18 @@ See [architecture detail](./next-shadcn-supabase-rewrite/architecture.md). ## Decisions (locked) -| # | Topic | Decision | -| --- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| 1 | Deploy target | **GitHub Pages** | -| 2 | Repo strategy | **`v2` branch** until cutover merge to `main` | -| 3 | Rebuild trigger | **Manual `v*` git tag** → `publish.yaml` (webhook deferred) | -| 4 | E2E testing | **Playwright** (keep current tooling) | -| 5 | Supabase schema | **Editor-first hybrid** — tables + `_en`/`_hu` columns; see [supabase-schema.md](./next-shadcn-supabase-rewrite/supabase-schema.md) | -| 6 | Package manager | **pnpm** (`pnpm-lock.yaml`, `packageManager` in `package.json`) | -| 7 | Local Supabase | **Self-hosted** via Supabase CLI + Docker; cloud for CI/prod | +| # | Topic | Decision | +| --- | --------------- | ---------------------------------------------------------------------------------------- | +| 1 | Deploy target | **GitHub Pages** | +| 2 | Repo strategy | **`v2` branch** until cutover merge to `main` | +| 3 | Rebuild trigger | **Manual `v*` git tag** → `publish.yaml` (webhook deferred) | +| 4 | E2E testing | **Playwright** (keep current tooling) | +| 5 | Supabase schema | **Editor-first hybrid** — tables + `_en`/`_hu` columns; see supabase-schema.md (removed) | +| 6 | Package manager | **pnpm** (`pnpm-lock.yaml`, `packageManager` in `package.json`) | +| 7 | Local Supabase | **Self-hosted** via Supabase CLI + Docker; cloud for CI/prod | Detail: [deploy.md](./next-shadcn-supabase-rewrite/deploy.md) · -[local-supabase.md](./next-shadcn-supabase-rewrite/local-supabase.md). +local-supabase.md (removed). ## Content authoring goal @@ -138,10 +142,9 @@ Full checklist: [seo-parity.md](./next-shadcn-supabase-rewrite/seo-parity.md). Supabase replaces `content/*.yaml`. Proposed schema maps current Zod types: -- `site_config`, `cv_profiles`, child tables — see - [supabase-schema.md](./next-shadcn-supabase-rewrite/supabase-schema.md) +- `site_config`, `cv_profiles`, child tables — see supabase-schema.md (removed) -Detail: [supabase-schema.md](./next-shadcn-supabase-rewrite/supabase-schema.md). +Detail: supabase-schema.md (removed). ## Migration path @@ -190,16 +193,14 @@ Phases: [phases.md](./next-shadcn-supabase-rewrite/phases.md). ## Related docs -| Document | Purpose | -| ----------------------------------------------------------------------- | -------------------------------------------------- | -| [architecture.md](./next-shadcn-supabase-rewrite/architecture.md) | Folder layout, data flow, env vars | -| [supabase-schema.md](./next-shadcn-supabase-rewrite/supabase-schema.md) | Tables, RLS, seed from YAML | -| [seo-parity.md](./next-shadcn-supabase-rewrite/seo-parity.md) | Current → Next mapping | -| [phases.md](./next-shadcn-supabase-rewrite/phases.md) | Implementation phases | -| [deploy.md](./next-shadcn-supabase-rewrite/deploy.md) | GitHub Pages, `v*` tag release, prod Supabase seed | -| [local-supabase.md](./next-shadcn-supabase-rewrite/local-supabase.md) | Self-hosted local Supabase (CLI + Docker) | -| [../content.md](../content.md) | Current YAML model (baseline) | -| [../.ai/content-model.md](../.ai/content-model.md) | CV types + YAML seed model | +| Document | Purpose | +| ----------------------------------------------------------------- | -------------------------------------------------- | +| [architecture.md](./next-shadcn-supabase-rewrite/architecture.md) | Folder layout, data flow, env vars | +| [seo-parity.md](./next-shadcn-supabase-rewrite/seo-parity.md) | Current → Next mapping | +| [phases.md](./next-shadcn-supabase-rewrite/phases.md) | Implementation phases | +| [deploy.md](./next-shadcn-supabase-rewrite/deploy.md) | GitHub Pages, `v*` tag release, prod Supabase seed | +| [../content.md](../content.md) | Current YAML model (baseline) | +| [../.ai/content-model.md](../.ai/content-model.md) | CV types + YAML seed model | ## Agent quick start diff --git a/docs/projects/next-shadcn-supabase-rewrite/README.md b/docs/projects/next-shadcn-supabase-rewrite/README.md index 98a4af4..c7b54f0 100644 --- a/docs/projects/next-shadcn-supabase-rewrite/README.md +++ b/docs/projects/next-shadcn-supabase-rewrite/README.md @@ -1,15 +1,16 @@ # Next + shadcn + Supabase rewrite — index +> **Superseded.** The Supabase data layer was dropped; CV data is committed YAML +> (`content/*.yaml`) read at build time by `lib/cv/fetch.ts`. The Next.js +> migration stays. This document is kept as historical record only. + | Document | Purpose | | ------------------------------------------------------------------------ | ----------------------------------------------------- | | [../next-shadcn-supabase-rewrite.md](../next-shadcn-supabase-rewrite.md) | **Project brief** — goals, acceptance criteria, risks | | [architecture.md](./architecture.md) | Target folder layout, rendering, env vars | -| [supabase-schema.md](./supabase-schema.md) | Postgres tables, RLS, seed strategy | | [seo-parity.md](./seo-parity.md) | Nuxt → Next SEO mapping + verification | | [phases.md](./phases.md) | Implementation phases 0–6 | | [deploy.md](./deploy.md) | **GitHub Pages**, tag release, prod Supabase seed | -| [github-secrets.md](./github-secrets.md) | GitHub Secrets checklist + where to find each value | -| [local-supabase.md](./local-supabase.md) | Self-hosted local dev (Supabase CLI + Docker) | **Status:** `implementation complete` — **cutover pending** (Phase 6) diff --git a/docs/projects/next-shadcn-supabase-rewrite/architecture.md b/docs/projects/next-shadcn-supabase-rewrite/architecture.md index fafe903..c89e1ec 100644 --- a/docs/projects/next-shadcn-supabase-rewrite/architecture.md +++ b/docs/projects/next-shadcn-supabase-rewrite/architecture.md @@ -133,10 +133,10 @@ Never expose service role key to the browser. ### Local vs cloud URLs -| Environment | `SUPABASE_URL` | Docs | -| --------------- | --------------------------- | ---------------------------------------- | -| Local dev | `http://127.0.0.1:54321` | [local-supabase.md](./local-supabase.md) | -| CI / production | `https://.supabase.co` | GitHub Secrets | +| Environment | `SUPABASE_URL` | Docs | +| --------------- | --------------------------- | --------------------------- | +| Local dev | `http://127.0.0.1:54321` | local-supabase.md (removed) | +| CI / production | `https://.supabase.co` | GitHub Secrets | ## i18n diff --git a/docs/projects/next-shadcn-supabase-rewrite/deploy.md b/docs/projects/next-shadcn-supabase-rewrite/deploy.md index e74bece..7293775 100644 --- a/docs/projects/next-shadcn-supabase-rewrite/deploy.md +++ b/docs/projects/next-shadcn-supabase-rewrite/deploy.md @@ -69,8 +69,7 @@ Supabase + seed. 3. Docker: `Dockerfile` build-args from prod secrets (no local Supabase) **Publish credentials:** 1 secret (`SUPABASE_DB_URL`) + 2 variables -(`SUPABASE_URL`, `SUPABASE_PUBLISHABLE_KEY`) — see -[github-secrets.md](./github-secrets.md). +(`SUPABASE_URL`, `SUPABASE_PUBLISHABLE_KEY`) — see github-secrets.md (removed). ## Production Supabase seed @@ -128,6 +127,5 @@ this doc or Supabase Dashboard docs if enabling later. - [architecture.md](./architecture.md) — app structure - [phases.md](./phases.md) — Phase 5–6 tasks -- [local-supabase.md](./local-supabase.md) — local vs cloud Supabase - [../next-shadcn-supabase-rewrite.md](../next-shadcn-supabase-rewrite.md) — project brief diff --git a/docs/projects/next-shadcn-supabase-rewrite/github-secrets.md b/docs/projects/next-shadcn-supabase-rewrite/github-secrets.md deleted file mode 100644 index 3344e81..0000000 --- a/docs/projects/next-shadcn-supabase-rewrite/github-secrets.md +++ /dev/null @@ -1,158 +0,0 @@ -# GitHub Secrets — production Supabase + publish - -Minimal setup for `publish.yaml` (`v*` tag). CI (`ci.yaml`) uses local Supabase -only — no cloud credentials. - -## Setup: 3 repository secrets (works) - -All three can live under -[Settings → Secrets → Actions](https://github.com/95gabor/cv/settings/secrets/actions): - -| Name | Risk | Purpose | -| -------------------------- | -------------------------- | -------------------- | -| `SUPABASE_DB_URL` | **High** — direct Postgres | `db push` on release | -| `SUPABASE_URL` | Low — public API URL | Static build fetch | -| `SUPABASE_PUBLISHABLE_KEY` | Low — RLS read only | Static build fetch | - -`publish.yaml` reads URL and publishable key from **secrets first**, then falls -back to repository **variables** if you move them later. - -**Optional:** `SUPABASE_URL` and `SUPABASE_PUBLISHABLE_KEY` may be -[repository variables](https://github.com/95gabor/cv/settings/variables/actions) -instead of secrets — they are not sensitive. One secret (`SUPABASE_DB_URL`) is -enough for security; the other two as secrets is fine if you prefer one place to -configure. - -**Not in GitHub:** `SUPABASE_SECRET_KEY` — seed writes only; keep in -`.env.local`. - ---- - -## Why not 5 secrets? - -| Old secret | Still needed? | Replacement | -| -------------------------- | --------------- | ------------------------------------------------------------------------- | -| `SUPABASE_ACCESS_TOKEN` | **No** | Account-level token; replaced by `SUPABASE_DB_URL` for `db push --db-url` | -| `SUPABASE_PROJECT_REF` | **No** | Derivable from `SUPABASE_URL` if ever needed locally | -| `SUPABASE_DB_PASSWORD` | **No** | Embedded in `SUPABASE_DB_URL` | -| `SUPABASE_URL` | Yes | Secret **or** variable (public URL) | -| `SUPABASE_PUBLISHABLE_KEY` | Yes | Secret **or** variable (RLS read) | -| `SUPABASE_SECRET_KEY` | Never in GitHub | Local seed only | - -Publishable key and project URL are low-risk; variables are enough, but storing -them as secrets (all in one place) works the same in CI. - ---- - -## Checklist - -| # | Name | Where | Got it? | -| --- | -------------------------- | ------------------ | ------- | -| 1 | `SUPABASE_DB_URL` | Secret | ☐ | -| 2 | `SUPABASE_URL` | Secret or variable | ☐ | -| 3 | `SUPABASE_PUBLISHABLE_KEY` | Secret or variable | ☐ | - -Optional (other workflows): - -| Name | Type | Usage | -| -------------------------- | ------ | ----------------------------- | -| `PERCY_TOKEN` | Secret | Visual regression (`ci.yaml`) | -| `RELEASE_BOT_GITHUB_TOKEN` | Secret | `release.yaml` | - ---- - -## Where to get each value - -### `SUPABASE_DB_URL` (secret) - -**What:** Direct Postgres connection URI for migrations. - -**Where:** - -1. [Supabase Dashboard](https://supabase.com/dashboard) → project → **Settings → - Database** -2. **Connection string** → **URI** tab -3. Choose **Direct connection** (not pooler — safer for DDL / migrations) -4. Copy URI, replace `[YOUR-PASSWORD]` with your database password - -Example shape: - -```text -postgresql://postgres.[ref]:[password]@db.[ref].supabase.co:5432/postgres -``` - -Used only by `scripts/supabase-push-prod.sh` in CI. Never commit. - ---- - -### `SUPABASE_URL` (secret or variable) - -**What:** `https://.supabase.co` - -**Where:** **Settings → API → Project URL** - ---- - -### `SUPABASE_PUBLISHABLE_KEY` (secret or variable) - -**What:** `sb_publishable_...` — read via RLS only. - -**Where:** **Settings → API Keys → Publishable key** - -If missing, click **Create new API keys** (legacy `anon` JWT still works locally -as fallback). - ---- - -### Local seed only: `SUPABASE_SECRET_KEY` - -**Where:** **Settings → API Keys → Secret keys** - -For `pnpm run db:seed` — `.env.local` only. - ---- - -## Local verify - -```bash -# Migrate (same as CI) -export SUPABASE_DB_URL='postgresql://postgres.[ref]:[password]@db.[ref].supabase.co:5432/postgres' -pnpm exec supabase db push --db-url "$SUPABASE_DB_URL" --yes - -# Seed + build -export SUPABASE_URL=https://.supabase.co -export SUPABASE_PUBLISHABLE_KEY=sb_publishable_... -export SUPABASE_SECRET_KEY=sb_secret_... -pnpm run db:seed -pnpm run build -``` - -### Legacy local link (optional) - -If you prefer `supabase link` without storing the full DB URL: - -```bash -export SUPABASE_ACCESS_TOKEN= -export SUPABASE_PROJECT_REF= -export SUPABASE_DB_PASSWORD= -bash scripts/supabase-push-prod.sh -``` - ---- - -## Release flow - -1. Seed prod when YAML changed (`pnpm run db:seed` with `.env.prod`) -2. Merge to `main`, CI green -3. **GitHub → Actions → Release → Run workflow** (semantic-release) -4. Release creates `v*` tag + GitHub release → `publish.yaml` deploys Pages + - Docker - -Do **not** `git tag` manually unless recovering from a broken release. - ---- - -## Related - -- [deploy.md](./deploy.md) -- [Supabase API keys](https://supabase.com/docs/guides/getting-started/api-keys) diff --git a/docs/projects/next-shadcn-supabase-rewrite/local-supabase.md b/docs/projects/next-shadcn-supabase-rewrite/local-supabase.md deleted file mode 100644 index 4731c01..0000000 --- a/docs/projects/next-shadcn-supabase-rewrite/local-supabase.md +++ /dev/null @@ -1,215 +0,0 @@ -# Local Supabase — self-hosted dev stack - -## Decision - -| Environment | Supabase | Purpose | -| -------------------- | ------------------------------------------------------- | ---------------------------------------- | -| **Local dev** | **Self-hosted** via Supabase CLI (`supabase start`) | Schema, seed, editor dev, offline builds | -| **CI (PR)** | **Local** Supabase in Docker (`prepare-static-site.sh`) | Fast CI builds | -| **Production build** | **Supabase Cloud** project | `publish.yaml` on `v*` tag | - -Local stack runs in **Docker** on the developer machine — same Postgres + Auth + -Storage APIs as cloud, without hitting a remote project during day-to-day work. - -Production self-hosting (own VPS/K8s) is **out of scope** for v1; cloud Supabase -for staging/prod. - -## Architecture - -```mermaid -flowchart TB - subgraph local [Local machine] - CLI[Supabase CLI] - Docker[Docker Compose] - CLI --> Docker - Docker --> PG[(Postgres :54322)] - Docker --> Studio[Studio :54323] - Docker --> API[Kong API :54321] - NextDev[pnpm dev / build] - NextDev -->|SUPABASE_URL local| API - end - - subgraph cloud [Supabase Cloud — prod] - CloudPG[(Postgres)] - end - - subgraph ci [GitHub Actions — publish on v* tag] - Build[pnpm run build] - Build -->|SUPABASE_URL cloud| CloudPG - end -``` - -Manual `v*` tag triggers rebuild. Supabase webhook auto-deploy is **deferred**. - -## Prerequisites - -| Tool | Notes | -| ------------ | --------------------------------------------------------------------------------------------- | -| Docker | Running daemon (Docker Desktop or colima) | -| Supabase CLI | `brew install supabase/tap/supabase` or [install guide](https://supabase.com/docs/guides/cli) | -| Node.js | ≥ 24 (Next build) | -| pnpm | see project brief | - -## Repo layout - -``` -supabase/ -├── config.toml # CLI config (ports, auth, storage) -├── migrations/ # SQL migrations (schema) -└── .gitignore # ignore .branches, temp -``` - -CV data seed: `pnpm run db:seed` → `scripts/seed-from-yaml.mts` (not -`seed.sql`). - -`config.toml` and migrations are **version-controlled**. Local DB data is -ephemeral (`supabase db reset`). - -## Quick start - -```bash -# once per machine -supabase login # only needed for link/deploy to cloud - -# in repo root (v2 branch) -supabase init # if not already present -supabase start # pulls images, starts stack - -supabase status # prints API URL, keys, Studio URL -``` - -Typical local URLs (default): - -| Service | URL | -| -------- | --------------------------------------------------------- | -| API | `http://127.0.0.1:54321` | -| Studio | `http://127.0.0.1:54323` | -| Postgres | `postgresql://postgres:postgres@127.0.0.1:54322/postgres` | - -## Environment files - -```bash -# .env.local (gitignored) — local self-hosted -SUPABASE_URL=http://127.0.0.1:54321 -SUPABASE_SERVICE_ROLE_KEY= -NEXT_PUBLIC_SITE_URL=http://localhost:3000 -``` - -```bash -# CI / production — Supabase Cloud (GitHub Secrets) -SUPABASE_URL=https://.supabase.co -SUPABASE_SERVICE_ROLE_KEY= -NEXT_PUBLIC_SITE_URL=https://95gabor.me -``` - -Never commit service role keys. Add `.env.local` to `.gitignore`. - -### Example `package.json` scripts - -```json -{ - "scripts": { - "db:start": "supabase start", - "db:stop": "supabase stop", - "db:reset": "supabase db reset", - "db:status": "supabase status", - "db:types": "supabase gen types typescript --local > lib/supabase/types.ts" - } -} -``` - -## Workflow - -### Schema changes - -```bash -supabase migration new create_cv_tables -# edit supabase/migrations/_create_cv_tables.sql -supabase db reset # apply migrations + seed locally -pnpm run db:types # regenerate TS types -``` - -### Seed from YAML - -```bash -pnpm run db:seed # content/gabor-pichner.yaml → Supabase (local or prod env) -``` - -Prod: `supabase link` + `supabase db push`, then `db:seed` with cloud -`SUPABASE_*`. See [deploy.md](./deploy.md). - -### Next.js dev / build against local Supabase - -```bash -supabase start -pnpm run dev # fetch uses .env.local → local API -pnpm run build # verify static build with local data -``` - -Build-time fetch is identical — only `SUPABASE_URL` and key change. - -## Studio (local CMS preview) - -Open **Studio** (`http://127.0.0.1:54323`) to browse/edit tables before the CV -Editor UI exists. - -Useful for: - -- Verifying seed data structure -- Manual content edits during development -- Testing RLS policies - -## Deploy / rebuild - -| | Local self-hosted | Cloud | -| ------------------------ | ------------------------ | ----------------------------- | -| Auto deploy on DB change | ❌ | ❌ deferred (manual `v*` tag) | -| Rebuild after edit | `pnpm run build` locally | `db:seed` → `v*` tag → CI | - -Local content changes do **not** trigger GitHub deploy. - -## Linking local to cloud (optional) - -When a cloud project exists: - -```bash -supabase link --project-ref -supabase db push # push migrations to cloud -supabase db pull # pull remote schema (careful) -``` - -Use **migrations in git** as source of truth; avoid `db pull` overwriting -intentional schema. - -## Storage (local) - -`supabase start` includes local Storage. Bucket `cv-assets` defined in migration -or Studio. - -For dev, avatar paths can point to: - -- `http://127.0.0.1:54321/storage/v1/object/public/cv-assets/...`, or -- `public/` static files until Storage upload is wired - -## CI - -PR CI (`ci.yaml`) uses **local Supabase** in Docker via `prepare-static-site.sh` -(fast, no cloud secrets required). - -`publish.yaml` (on `v*` tag) uses **cloud Supabase secrets** for Pages build and -Docker image (`Dockerfile` with in-container build). - -## Troubleshooting - -| Issue | Fix | -| ---------------------- | --------------------------------------- | -| `supabase start` fails | Docker running? Port 54321–54323 free? | -| Stale schema | `supabase db reset` | -| Wrong API URL in build | Check `.env.local` vs `.env.production` | -| Types out of sync | `pnpm run db:types` after migration | - -## Related - -- [supabase-schema.md](./supabase-schema.md) — table design -- [deploy.md](./deploy.md) — tag release + prod seed -- [phases.md](./phases.md) — Phase 2 tasks diff --git a/docs/projects/next-shadcn-supabase-rewrite/phases.md b/docs/projects/next-shadcn-supabase-rewrite/phases.md index 69da712..370c49a 100644 --- a/docs/projects/next-shadcn-supabase-rewrite/phases.md +++ b/docs/projects/next-shadcn-supabase-rewrite/phases.md @@ -74,8 +74,7 @@ - [ ] Production Supabase project (`supabase link` + secrets in GitHub) - [ ] Prod seed: `pnpm run db:seed` with cloud `SUPABASE_*` env (before tag) -- [ ] Publish credentials — [github-secrets.md](./github-secrets.md) (1 secret + - 2 vars) +- [ ] Publish credentials — github-secrets.md (removed) (1 secret + 2 vars) - [ ] Merge `v2` → `main` - [ ] Remove remaining Nuxt artifacts from `main` - [ ] Tag release (`v*`) → live https://95gabor.me on Next build diff --git a/docs/projects/next-shadcn-supabase-rewrite/supabase-schema.md b/docs/projects/next-shadcn-supabase-rewrite/supabase-schema.md deleted file mode 100644 index 7799cfa..0000000 --- a/docs/projects/next-shadcn-supabase-rewrite/supabase-schema.md +++ /dev/null @@ -1,269 +0,0 @@ -# Supabase schema — CV content model - -Maps `lib/cv/types.ts` and `content/gabor-pichner.yaml` to Postgres. - -## Approach (locked) - -**Editor-first hybrid** — structured tables for humans and developers, **no -single JSON/YAML document**. - -| Audience | Experience | -| -------------- | ----------------------------------------------------------------------- | -| CV editor (UI) | Forms, lists, drag-reorder — never raw JSON/YAML | -| Developers | Readable SQL rows/columns in Supabase; typed fetch in `lib/cv/types.ts` | -| Public site | Build-time fetch → same domain model as today | - -### Why not a single JSONB blob? - -A one-column `content jsonb` is fast to migrate but **bad for both goals**: -editors end up in a JSON panel; developers stare at an opaque blob. - -### Why not fully normalized? - -Separate `localized_strings` / translation tables add complexity without benefit -for **one CV** and two locales. Use **`_en` / `_hu` column pairs** instead — -readable and form-friendly. - -### JSONB usage - -Use JSONB **only** where unavoidable (none required in v1). Prefer explicit -columns and child tables. - -## Entity diagram - -```mermaid -erDiagram - site_config ||--o{ cv_profiles : owns - cv_profiles ||--o{ personal_links : has - cv_profiles ||--o{ personal_contacts : has - cv_profiles ||--o{ work_experiences : has - cv_profiles ||--o{ educations : has - cv_profiles ||--o{ skills : has - cv_profiles ||--o{ hobbies : has - work_experiences ||--o{ work_experience_technologies : has - - cv_profiles { - uuid id PK - text slug UK - text name_en - text name_hu - text title_en - text title_hu - text picture_path - boolean is_active - timestamptz updated_at - } - - work_experiences { - uuid id PK - uuid cv_profile_id FK - int sort_order - text title_en - text title_hu - text company_name - text company_link - text location - int from_year - int from_month - int end_year - int end_month - text employment_type - text description_en - text description_hu - } -``` - -## Tables - -### `site_config` - -Single row (`id = 'default'`). - -| Column | Type | Editor UI | -| -------------- | ------ | --------------------- | -| `url` | text | Site URL input | -| `title` | text | SEO title | -| `description` | text | Textarea | -| `keywords` | text[] | Tag input | -| `favicon_path` | text | File picker → Storage | - -### `cv_profiles` - -| Column | Type | Editor UI | -| ---------------------- | ----------- | --------------------------------------------------- | -| `slug` | text UNIQUE | Read-only after create | -| `name_en`, `name_hu` | text | Bilingual name fields | -| `title_en`, `title_hu` | text | Bilingual job headline | -| `picture_path` | text | Avatar upload → Storage | -| `is_active` | boolean | Toggle (which profile the site loads) | -| `updated_at` | timestamptz | Auto-updated on child changes (future webhook hook) | - -### `personal_links` - -| Column | Type | Editor UI | -| ----------------- | ------- | ----------------------------------- | -| `cv_profile_id` | uuid FK | — | -| `sort_order` | int | Drag handle | -| `platform` | text | Select / text (GitHub, LinkedIn, …) | -| `url` | text | URL input | -| `icon_dark_path` | text | Icon upload | -| `icon_light_path` | text | Icon upload | - -### `personal_contacts` - -| Column | Type | Editor UI | -| --------------- | --------- | ------------------------------- | -| `cv_profile_id` | uuid FK | — | -| `sort_order` | int | Drag handle | -| `type` | text enum | location / phone / email / link | -| `value` | text | Text / URL input | - -### `work_experiences` - -| Column | Type | Editor UI | -| ---------------------------------- | ------------- | ---------------------------------- | -| `sort_order` | int | Reorder jobs | -| `title_en`, `title_hu` | text | Bilingual | -| `company_name` | text | Text | -| `company_link` | text nullable | URL | -| `location` | text | Text | -| `from_year`, `from_month` | int | Date pickers | -| `end_year`, `end_month` | int nullable | “Current role” checkbox clears end | -| `employment_type` | text nullable | Select (maps to i18n key) | -| `description_en`, `description_hu` | text | Rich textarea / markdown | - -### `work_experience_technologies` - -| Column | Type | Editor UI | -| -------------------- | ------- | --------- | -| `work_experience_id` | uuid FK | — | -| `sort_order` | int | Reorder | -| `name` | text | Text | -| `link` | text | URL | - -### `educations` - -Same pattern as jobs: `degree_en/hu`, `institution_name`, `institution_link`, -`location`, period columns, `note_en/hu` optional. - -### `skills` - -| Column | Type | Editor UI | -| ------------ | ------------- | --------- | -| `name` | text | Text | -| `link` | text nullable | URL | -| `sort_order` | int | Reorder | - -### `hobbies` - -| Column | Type | Editor UI | -| -------------------- | ------------- | --------- | -| `name_en`, `name_hu` | text | Bilingual | -| `link` | text nullable | URL | -| `sort_order` | int | Reorder | - -## UI editor → database mapping - -```mermaid -flowchart LR - subgraph editor [CV Editor UI] - Personal[Personal section] - Jobs[Jobs list] - JobForm[Job form EN/HU tabs] - Tech[Technologies sub-list] - end - - subgraph db [Supabase] - CP[cv_profiles] - PL[personal_links] - WE[work_experiences] - WET[work_experience_technologies] - end - - Personal --> CP - Personal --> PL - Jobs --> WE - JobForm --> WE - Tech --> WET -``` - -**Editor rules:** - -- Every user-visible field maps to **one column** (or one row in a child table). -- Bilingual content = **two inputs** (`_en`, `_hu`), not a JSON editor. -- Lists = **add / edit / delete / reorder** rows — never edit arrays as text. -- Save updates `cv_profiles.updated_at` (via trigger on child tables). - Auto-deploy webhook is **deferred** — use manual `v*` tag for now. - -## Developer readability - -Example row developers see in Supabase: - -``` -work_experiences: - title_en: "Full Stack Developer" - title_hu: "Full Stack Fejlesztő" - company_name: "it.hu" - from_year: 2026 - from_month: 6 -``` - -TypeScript layer maps flat columns → existing `CV` domain type -(`LocalizedString`, etc.) in `lib/cv/map-from-db.ts`. Public site and tests keep -the same shapes as `lib/cv/types.ts`. - -## Webhook / `updated_at` - -Trigger on child tables bumps parent profile timestamp: - -```sql --- pseudocode: after insert/update/delete on work_experiences, educations, … -update cv_profiles set updated_at = now() where id = ; -``` - -Single Supabase Database Webhook on `cv_profiles` UPDATE would suffice for -rebuild when implemented (deferred). - -## Storage - -| Bucket | Contents | -| ----------- | --------------------- | -| `cv-assets` | Avatars, social icons | - -Editor uploads file → Storage → saves path in `picture_path` / `icon_*_path`. - -## RLS - -| Role | Policy | -| --------------- | ----------------------------- | -| `anon` | SELECT published data | -| `authenticated` | CRUD for editor (owner/admin) | -| `service_role` | Build CI fetch only | - -## Seed migration - -1. Parse `content/gabor-pichner.yaml` via `scripts/seed-from-yaml.mts` -2. Insert into structured tables (not one JSON blob) -3. `lib/cv/map-from-db.ts` maps DB rows → `CV` TypeScript shape - -Run against **local self-hosted** stack (`supabase start`) during development; -push migrations to cloud for CI — see [local-supabase.md](./local-supabase.md). - -## UI strings - -Keep `messages/en.json` and `messages/hu.json` in git (section labels, buttons). -CV body content lives in Supabase. - -## Future: CV Editor UI - -Post–public-site-v1; schema is designed for it now. - -| Screen | CRUD target | -| ---------------- | ---------------------------------------------------- | -| Personal | `cv_profiles`, `personal_links`, `personal_contacts` | -| Experience | `work_experiences`, `work_experience_technologies` | -| Education | `educations` | -| Skills / Hobbies | `skills`, `hobbies` | -| Site SEO | `site_config` | - -Stack options: Next.js `/admin` route (auth via Supabase) or separate app — TBD. diff --git a/docs/references.md b/docs/references.md index 34d4b0b..9c9ec81 100644 --- a/docs/references.md +++ b/docs/references.md @@ -19,19 +19,12 @@ ## Secrets (GitHub) -| Name | Type | Usage | -| -------------------------- | ------------------ | --------------------------- | -| `SUPABASE_DB_URL` | **Secret** | Prod migrations on `v*` tag | -| `SUPABASE_URL` | Secret or variable | Prod static build | -| `SUPABASE_PUBLISHABLE_KEY` | Secret or variable | Prod static build | -| `PERCY_TOKEN` | Secret | Visual regression CI | -| `RELEASE_BOT_GITHUB_TOKEN` | Secret | Release workflow | +| Name | Type | Usage | +| -------------------------- | ------ | -------------------- | +| `PERCY_TOKEN` | Secret | Visual regression CI | +| `RELEASE_BOT_GITHUB_TOKEN` | Secret | Release workflow | -Setup guide: -[github-secrets.md](./projects/next-shadcn-supabase-rewrite/github-secrets.md) - -CI (`ci.yaml`) uses local Supabase. `publish.yaml` needs the three names above -(secrets or variables for URL + publishable key). +`publish.yaml` needs no CV data secrets — content is committed YAML. ## Documentation in the repo @@ -50,7 +43,6 @@ CI (`ci.yaml`) uses local Supabase. `publish.yaml` needs the three names above | Next.js | https://nextjs.org/docs | | React | https://react.dev | | shadcn/ui | https://ui.shadcn.com | -| Supabase | https://supabase.com/docs | | Playwright | https://playwright.dev | | Tailwind CSS v4 | https://tailwindcss.com/docs | | Conventional Commits | https://www.conventionalcommits.org | diff --git a/docs/setup.md b/docs/setup.md index d6a0a31..bf01497 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -7,9 +7,9 @@ | Tool | Version / notes | | ------- | ----------------------------------------- | -| Node.js | ≥ 24.18.0 (`.nvmrc`: `24.18.0`) | -| pnpm | 10.x (`packageManager` in `package.json`) | -| Docker | For local Supabase (`supabase start`) | +| Node.js | ≥ 24.21.0 (`.nvmrc`: `24.21.0`) | +| pnpm | 12.x (`packageManager` in `package.json`) | +| Docker | Optional, for the production image | ```bash nvm use # if nvm is installed @@ -24,25 +24,21 @@ git clone https://github.com/95gabor/cv.git cd cv pnpm install cp .env.example .env.local -pnpm exec supabase start -pnpm run db:seed pnpm run dev # → http://localhost:3000 ``` ## Common commands -| Command | Purpose | -| -------------------------------------------------------- | ----------------------------------- | -| `pnpm run dev` | Dev server (Turbopack) | -| `pnpm run build` | Static export → `out/` | -| `pnpm run generate` | Alias for `build` (CI) | -| `pnpm run lint` | ESLint | -| `pnpm run typecheck` | TypeScript | -| `pnpm run test:e2e` | Playwright (builds + serves `out/`) | -| `pnpm run test:e2e:visual` | Percy visual regression | -| `pnpm run db:start` / `db:stop` / `db:reset` / `db:seed` | Local Supabase | -| `pnpm run db:types` | Regenerate `lib/supabase/types.ts` | +| Command | Purpose | +| -------------------------- | ----------------------------------- | +| `pnpm run dev` | Dev server (Turbopack) | +| `pnpm run build` | Static export → `out/` | +| `pnpm run generate` | Alias for `build` (CI) | +| `pnpm run lint` | ESLint | +| `pnpm run typecheck` | TypeScript | +| `pnpm run test:e2e` | Playwright (builds + serves `out/`) | +| `pnpm run test:e2e:visual` | Percy visual regression | ## Quality gate (before PR) @@ -53,41 +49,36 @@ pnpm run typecheck pnpm run build ``` -Requires Supabase running locally or valid env vars in `.env.local`. - ## Editing CV content 1. Edit `content/gabor-pichner.yaml`. -2. Reseed: `pnpm run db:seed`. -3. Refresh dev server (or restart `pnpm run dev`). +2. Refresh the dev server (restart `pnpm run dev` if it does not pick up the + change). Details: [content.md](./content.md) ## Docker (optional) ```bash -bash scripts/prepare-supabase-for-build.sh docker compose up --build # → http://localhost:8000 ``` Uses the root `Dockerfile` (Next.js build inside Docker + nginx). Requires -`.env.local` with `SUPABASE_*` and Docker running. +Docker running. ## Common issues -| Issue | Fix | -| ---------------------- | -------------------------------------------------------- | -| Node version mismatch | `nvm use` or Node ≥ 24.18 | -| `Missing SUPABASE_URL` | Copy `.env.example` → `.env.local`; run `supabase start` | -| Empty CV / fetch error | `pnpm run db:seed` after `db:reset` | -| Port 3000 in use | Stop other `next dev` or use another port | -| Percy fails locally | Set `PERCY_TOKEN` | +| Issue | Fix | +| --------------------- | -------------------------------------------- | +| Node version mismatch | `nvm use` or Node ≥ 24.21 | +| `Invalid CV profile` | Check `content/.yaml` has all sections | +| Port 3000 in use | Stop other `next dev` or use another port | +| Percy fails locally | Set `PERCY_TOKEN` | ## Setup checklist -- [ ] `node -v` ≥ 24.18.0 +- [ ] `node -v` ≥ 24.21.0 - [ ] `pnpm install` succeeds -- [ ] `supabase start` + `pnpm run db:seed` - [ ] `pnpm run dev` → CV loads at `/` and `/hu` - [ ] `pnpm run lint && pnpm run typecheck && pnpm run build` passes diff --git a/docs/templates/task-brief.md b/docs/templates/task-brief.md index 21f80ff..da582e4 100644 --- a/docs/templates/task-brief.md +++ b/docs/templates/task-brief.md @@ -10,11 +10,11 @@ Copy to the start of a new chat or into `local/` for larger tasks. **Affected areas:** -- [ ] `content/*.yaml` — CV content (seed via `pnpm run db:seed`) +- [ ] `content/*.yaml` — CV content - [ ] `components/` — UI - [ ] `app/` — routes, layout, metadata - [ ] `messages/` + `i18n/` — UI translations (`next-intl`) -- [ ] `lib/cv/` — types, fetch, mapping +- [ ] `lib/cv/` — types, YAML loader - [ ] `.github/workflows/` — CI - [ ] `docs/` — documentation @@ -31,7 +31,7 @@ Copy to the start of a new chat or into `local/` for larger tasks. - Do not change: ... - Quality gate: `pnpm run lint && pnpm run typecheck && pnpm run build` -- Build-time Supabase fetch only on public CV pages +- CV data read from YAML at build time only (no client fetch) ## Relevant files diff --git a/lib/cv/fetch.ts b/lib/cv/fetch.ts index 8f1ba4c..424eace 100644 --- a/lib/cv/fetch.ts +++ b/lib/cv/fetch.ts @@ -1,42 +1,69 @@ -import { - mapToCvModel, - type CvProfileWithRelations, -} from '@/lib/cv/map-from-db'; -import type { CV, Locale } from '@/lib/cv/types'; -import { createBuildClient } from '@/lib/supabase/server'; - -const CV_PROFILE_SELECT = ` - *, - personal_links (*), - personal_contacts (*), - work_experiences ( - *, - work_experience_technologies (*) - ), - educations (*), - skills (*), - hobbies (*) -`; +import { readFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; + +import { parse } from 'yaml'; + +import type { CV, Locale, WorkExperience } from '@/lib/cv/types'; + +const CONTENT_DIR = resolve(process.cwd(), 'content'); +const SLUG_PATTERN = /^[a-z0-9-]+$/; +const REQUIRED_KEYS = [ + 'personal', + 'workExperience', + 'educations', + 'skills', + 'hobbies', +] as const; + +function normalize(cv: CV): CV { + return { + ...cv, + workExperience: cv.workExperience.map( + (job): WorkExperience => ({ + ...job, + description: { + en: job.description.en.trim(), + hu: job.description.hu.trim(), + }, + technologies: job.technologies.map((tech) => ({ + ...tech, + link: tech.link ?? '', + })), + }), + ), + }; +} export async function getCvProfile(slug: string, locale: Locale): Promise { - const supabase = createBuildClient(); + if (!SLUG_PATTERN.test(slug)) { + throw new Error(`Invalid CV slug "${slug}"`); + } - const { data, error } = await supabase - .from('cv_profiles') - .select(CV_PROFILE_SELECT) - .eq('slug', slug) - .eq('is_active', true) - .single(); + const filePath = resolve(CONTENT_DIR, `${slug}.yaml`); + let raw: string; + try { + raw = await readFile(filePath, 'utf8'); + } catch (error) { + throw new Error(`Failed to read CV profile "${slug}" at ${filePath}`, { + cause: error, + }); + } - if (error) { - throw new Error(`Failed to fetch CV profile "${slug}": ${error.message}`); + const data = parse(raw) as Partial | null; + const missing = REQUIRED_KEYS.filter((key) => data?.[key] == null); + if (!data || missing.length > 0) { + throw new Error( + `Invalid CV profile "${slug}": missing ${missing.join(', ') || 'content'}`, + ); } + const cv = normalize(data as CV); + if (process.env.NODE_ENV === 'development') { console.info( - `[cv] loaded "${slug}" (${locale}) — ${data.work_experiences.length} jobs, ${data.skills.length} skills`, + `[cv] loaded "${slug}" (${locale}) — ${cv.workExperience.length} jobs, ${cv.skills.length} skills`, ); } - return mapToCvModel(data as CvProfileWithRelations, locale); + return cv; } diff --git a/lib/cv/map-from-db.ts b/lib/cv/map-from-db.ts deleted file mode 100644 index 6a80e4d..0000000 --- a/lib/cv/map-from-db.ts +++ /dev/null @@ -1,149 +0,0 @@ -import type { Database } from '@/lib/supabase/types'; -import type { - Contact, - CV, - Education, - Hobby, - Locale, - PeriodDate, - Skill, - WorkExperience, -} from '@/lib/cv/types'; - -type CvProfileRow = Database['public']['Tables']['cv_profiles']['Row']; -type PersonalLinkRow = Database['public']['Tables']['personal_links']['Row']; -type PersonalContactRow = - Database['public']['Tables']['personal_contacts']['Row']; -type WorkExperienceRow = Database['public']['Tables']['work_experiences']['Row']; -type WorkExperienceTechnologyRow = - Database['public']['Tables']['work_experience_technologies']['Row']; -type EducationRow = Database['public']['Tables']['educations']['Row']; -type SkillRow = Database['public']['Tables']['skills']['Row']; -type HobbyRow = Database['public']['Tables']['hobbies']['Row']; - -export type CvProfileWithRelations = CvProfileRow & { - personal_links: PersonalLinkRow[]; - personal_contacts: PersonalContactRow[]; - work_experiences: (WorkExperienceRow & { - work_experience_technologies: WorkExperienceTechnologyRow[]; - })[]; - educations: EducationRow[]; - skills: SkillRow[]; - hobbies: HobbyRow[]; -}; - -function bySortOrder(a: T, b: T) { - return a.sort_order - b.sort_order; -} - -function toPeriod( - year: number, - month: number | null, -): PeriodDate { - return { - year, - ...(month != null ? { month } : {}), - }; -} - -function toOptionalPeriod( - year: number | null, - month: number | null, -): PeriodDate | undefined { - if (year == null) { - return undefined; - } - return toPeriod(year, month); -} - -function mapWorkExperience( - row: WorkExperienceRow & { - work_experience_technologies: WorkExperienceTechnologyRow[]; - }, -): WorkExperience { - return { - title: { en: row.title_en, hu: row.title_hu }, - company: { - name: row.company_name, - ...(row.company_link ? { link: row.company_link } : {}), - }, - ...(row.employment_type ? { employmentType: row.employment_type } : {}), - location: row.location, - from: toPeriod(row.from_year, row.from_month), - end: toOptionalPeriod(row.end_year, row.end_month), - description: { en: row.description_en, hu: row.description_hu }, - technologies: [...row.work_experience_technologies] - .sort(bySortOrder) - .map((tech) => ({ - name: tech.name, - link: tech.link ?? '', - })), - }; -} - -function mapEducation(row: EducationRow): Education { - return { - degree: { en: row.degree_en, hu: row.degree_hu }, - institution: { - name: { - en: row.institution_name_en, - hu: row.institution_name_hu, - }, - ...(row.institution_link ? { link: row.institution_link } : {}), - }, - location: row.location, - from: toPeriod(row.from_year, row.from_month), - end: toOptionalPeriod(row.end_year, row.end_month), - ...(row.note_en && row.note_hu - ? { note: { en: row.note_en, hu: row.note_hu } } - : {}), - }; -} - -function mapSkill(row: SkillRow): Skill { - return { - name: row.name, - ...(row.link ? { link: row.link } : {}), - }; -} - -function mapHobby(row: HobbyRow): Hobby { - return { - name: { en: row.name_en, hu: row.name_hu }, - ...(row.link ? { link: row.link } : {}), - }; -} - -export function mapToCvModel(data: CvProfileWithRelations, locale: Locale): CV { - void locale; - - return { - personal: { - name: { en: data.name_en, hu: data.name_hu }, - title: { en: data.title_en, hu: data.title_hu }, - picture: data.picture_path, - links: [...data.personal_links].sort(bySortOrder).map((link) => ({ - platform: link.platform, - url: link.url, - icon: { - dark: link.icon_dark_path, - light: link.icon_light_path, - }, - })), - contact: [...data.personal_contacts] - .sort(bySortOrder) - .map( - (contact): Contact => ({ - type: contact.type, - value: contact.value, - }), - ), - }, - workExperience: [...data.work_experiences] - .sort(bySortOrder) - .map(mapWorkExperience), - educations: [...data.educations].sort(bySortOrder).map(mapEducation), - skills: [...data.skills].sort(bySortOrder).map(mapSkill), - hobbies: [...data.hobbies].sort(bySortOrder).map(mapHobby), - }; -} diff --git a/lib/get-site-config.ts b/lib/get-site-config.ts deleted file mode 100644 index 1da141c..0000000 --- a/lib/get-site-config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createBuildClient } from '@/lib/supabase/server'; -import type { SiteConfig } from '@/lib/site-config.types'; - -import { siteConfig as fallbackSiteConfig } from './site-config'; - -export async function getSiteConfig(): Promise { - try { - const supabase = createBuildClient(); - const { data, error } = await supabase - .from('site_config') - .select('*') - .eq('id', 'default') - .maybeSingle(); - - if (error || !data) { - return fallbackSiteConfig; - } - - return { - url: data.url, - title: data.title, - description: data.description, - keywords: data.keywords, - ...(data.favicon_path ? { favicon: data.favicon_path } : {}), - cv: fallbackSiteConfig.cv, - }; - } catch { - return fallbackSiteConfig; - } -} diff --git a/lib/supabase/server.ts b/lib/supabase/server.ts deleted file mode 100644 index 16efd59..0000000 --- a/lib/supabase/server.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { createClient } from '@supabase/supabase-js'; - -import type { Database } from '@/lib/supabase/types'; - -function requireEnv(name: string): string { - const value = process.env[name]; - if (!value) { - throw new Error(`Missing environment variable: ${name}`); - } - return value; -} - -function requireAnyEnv(...names: string[]): string { - for (const name of names) { - const value = process.env[name]; - if (value) { - return value; - } - } - throw new Error(`Missing environment variable: one of ${names.join(', ')}`); -} - -export function createBuildClient() { - return createClient( - requireEnv('SUPABASE_URL'), - requireAnyEnv('SUPABASE_PUBLISHABLE_KEY', 'SUPABASE_ANON_KEY'), - { - auth: { - persistSession: false, - autoRefreshToken: false, - }, - }, - ); -} diff --git a/lib/supabase/types.ts b/lib/supabase/types.ts deleted file mode 100644 index abc82f9..0000000 --- a/lib/supabase/types.ts +++ /dev/null @@ -1,374 +0,0 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[]; - -export interface Database { - public: { - Tables: { - site_config: { - Row: { - id: string; - url: string; - title: string; - description: string; - keywords: string[]; - favicon_path: string | null; - }; - Insert: { - id?: string; - url: string; - title: string; - description: string; - keywords?: string[]; - favicon_path?: string | null; - }; - Update: { - id?: string; - url?: string; - title?: string; - description?: string; - keywords?: string[]; - favicon_path?: string | null; - }; - Relationships: []; - }; - cv_profiles: { - Row: { - id: string; - slug: string; - name_en: string; - name_hu: string; - title_en: string; - title_hu: string; - picture_path: string; - is_active: boolean; - updated_at: string; - }; - Insert: { - id?: string; - slug: string; - name_en: string; - name_hu: string; - title_en: string; - title_hu: string; - picture_path: string; - is_active?: boolean; - updated_at?: string; - }; - Update: { - id?: string; - slug?: string; - name_en?: string; - name_hu?: string; - title_en?: string; - title_hu?: string; - picture_path?: string; - is_active?: boolean; - updated_at?: string; - }; - Relationships: []; - }; - personal_links: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - platform: string; - url: string; - icon_dark_path: string; - icon_light_path: string; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - platform: string; - url: string; - icon_dark_path: string; - icon_light_path: string; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - platform?: string; - url?: string; - icon_dark_path?: string; - icon_light_path?: string; - }; - Relationships: [ - { - foreignKeyName: 'personal_links_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - personal_contacts: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - type: 'location' | 'phone' | 'email' | 'link'; - value: string; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - type: 'location' | 'phone' | 'email' | 'link'; - value: string; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - type?: 'location' | 'phone' | 'email' | 'link'; - value?: string; - }; - Relationships: [ - { - foreignKeyName: 'personal_contacts_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - work_experiences: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - title_en: string; - title_hu: string; - company_name: string; - company_link: string | null; - location: string; - from_year: number; - from_month: number | null; - end_year: number | null; - end_month: number | null; - employment_type: string | null; - description_en: string; - description_hu: string; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - title_en: string; - title_hu: string; - company_name: string; - company_link?: string | null; - location: string; - from_year: number; - from_month?: number | null; - end_year?: number | null; - end_month?: number | null; - employment_type?: string | null; - description_en: string; - description_hu: string; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - title_en?: string; - title_hu?: string; - company_name?: string; - company_link?: string | null; - location?: string; - from_year?: number; - from_month?: number | null; - end_year?: number | null; - end_month?: number | null; - employment_type?: string | null; - description_en?: string; - description_hu?: string; - }; - Relationships: [ - { - foreignKeyName: 'work_experiences_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - work_experience_technologies: { - Row: { - id: string; - work_experience_id: string; - sort_order: number; - name: string; - link: string | null; - }; - Insert: { - id?: string; - work_experience_id: string; - sort_order: number; - name: string; - link?: string | null; - }; - Update: { - id?: string; - work_experience_id?: string; - sort_order?: number; - name?: string; - link?: string | null; - }; - Relationships: [ - { - foreignKeyName: 'work_experience_technologies_work_experience_id_fkey'; - columns: ['work_experience_id']; - isOneToOne: false; - referencedRelation: 'work_experiences'; - referencedColumns: ['id']; - }, - ]; - }; - educations: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - degree_en: string; - degree_hu: string; - institution_name_en: string; - institution_name_hu: string; - institution_link: string | null; - location: string; - from_year: number; - from_month: number | null; - end_year: number | null; - end_month: number | null; - note_en: string | null; - note_hu: string | null; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - degree_en: string; - degree_hu: string; - institution_name_en: string; - institution_name_hu: string; - institution_link?: string | null; - location: string; - from_year: number; - from_month?: number | null; - end_year?: number | null; - end_month?: number | null; - note_en?: string | null; - note_hu?: string | null; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - degree_en?: string; - degree_hu?: string; - institution_name_en?: string; - institution_name_hu?: string; - institution_link?: string | null; - location?: string; - from_year?: number; - from_month?: number | null; - end_year?: number | null; - end_month?: number | null; - note_en?: string | null; - note_hu?: string | null; - }; - Relationships: [ - { - foreignKeyName: 'educations_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - skills: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - name: string; - link: string | null; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - name: string; - link?: string | null; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - name?: string; - link?: string | null; - }; - Relationships: [ - { - foreignKeyName: 'skills_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - hobbies: { - Row: { - id: string; - cv_profile_id: string; - sort_order: number; - name_en: string; - name_hu: string; - link: string | null; - }; - Insert: { - id?: string; - cv_profile_id: string; - sort_order: number; - name_en: string; - name_hu: string; - link?: string | null; - }; - Update: { - id?: string; - cv_profile_id?: string; - sort_order?: number; - name_en?: string; - name_hu?: string; - link?: string | null; - }; - Relationships: [ - { - foreignKeyName: 'hobbies_cv_profile_id_fkey'; - columns: ['cv_profile_id']; - isOneToOne: false; - referencedRelation: 'cv_profiles'; - referencedColumns: ['id']; - }, - ]; - }; - }; - Views: Record; - Functions: Record; - Enums: Record; - CompositeTypes: Record; - }; -} diff --git a/package.json b/package.json index dc621d6..4769711 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,6 @@ "test:e2e:visual": "playwright test --config=playwright.visual.config.ts", "test:e2e:visual:ci": "percy exec -- pnpm run test:e2e:visual", "release": "semantic-release", - "db:start": "supabase start", - "db:stop": "supabase stop", - "db:reset": "supabase db reset", - "db:status": "supabase status", - "db:seed": "tsx scripts/seed-from-yaml.mts", - "db:push": "supabase db push --linked", - "db:types": "supabase gen types typescript --local > lib/supabase/types.ts", "prepare": "husky" }, "engines": { @@ -29,7 +22,6 @@ }, "dependencies": { "@radix-ui/react-slot": "^1.4.0", - "@supabase/supabase-js": "^2.117.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^1.52.0", @@ -38,7 +30,8 @@ "next-themes": "^0.4.6", "react": "19.3.0", "react-dom": "19.3.0", - "tailwind-merge": "^3.7.0" + "tailwind-merge": "^3.7.0", + "yaml": "^2.9.1" }, "devDependencies": { "@commitlint/cli": "^21.2.3", @@ -62,10 +55,8 @@ "lint-staged": "^17.6.0", "prettier": "^3.9.9", "semantic-release": "^25.0.9", - "supabase": "^2.120.0", "tailwindcss": "^4.3.3", "tsx": "^4.23.15", - "typescript": "^6.0.3", - "yaml": "^2.9.1" + "typescript": "^6.0.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fef8066..443c3af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -175,9 +175,6 @@ importers: '@radix-ui/react-slot': specifier: ^1.4.0 version: 1.4.0(@types/react@19.3.0)(react@19.3.0) - '@supabase/supabase-js': - specifier: ^2.117.2 - version: 2.117.2 class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -205,6 +202,9 @@ importers: tailwind-merge: specifier: ^3.7.0 version: 3.7.0 + yaml: + specifier: ^2.9.1 + version: 2.9.1 devDependencies: '@commitlint/cli': specifier: ^21.2.3 @@ -269,9 +269,6 @@ importers: semantic-release: specifier: ^25.0.9 version: 25.0.9(supports-color@7.2.0)(typescript@6.0.3) - supabase: - specifier: ^2.120.0 - version: 2.120.0 tailwindcss: specifier: ^4.3.3 version: 4.3.3 @@ -281,9 +278,6 @@ importers: typescript: specifier: ^6.0.3 version: 6.0.3 - yaml: - specifier: ^2.9.1 - version: 2.9.1 packages: @@ -459,12 +453,6 @@ packages: resolution: {integrity: sha512-aalGyl7dbB5PArRebDIX43ZvBlXrYm9uWzGJ26t+4SzJVPsOuvfILGGbw5X4yX7i50YEmJ8zvbiWnqH/AAnZqg==} engines: {node: '>=22'} - '@ecies/ciphers@0.2.6': - resolution: {integrity: sha512-patgsRPKGkhhoBjETV4XxD0En4ui5fbX0hzayqI3M8tvNMGUoUvmyYAIWwlxBc1KX5cturfqByYdj5bYGRpN9g==} - engines: {bun: '>=1', deno: '>=2.7.10', node: '>=16'} - peerDependencies: - '@noble/ciphers': ^1.0.0 - '@eloqnt/config@0.1.1': resolution: {integrity: sha512-YRDigSaiJEzKDfzTth5kG+L/PKfB3mo8h7yNzpXExPfvQmcD05WoZT57PdhJE0jI+Vva6eb0OCU8hnHHgdME3g==} @@ -1054,18 +1042,6 @@ packages: cpu: [x64] os: [win32] - '@noble/ciphers@1.3.0': - resolution: {integrity: sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==} - engines: {node: ^14.21.3 || >=16} - - '@noble/curves@1.9.7': - resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} - engines: {node: ^14.21.3 || >=16} - - '@noble/hashes@1.8.0': - resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} - engines: {node: ^14.21.3 || >=16} - '@nodable/entities@3.1.0': resolution: {integrity: sha512-LsS/DjHr+uDM647Gru/cA8+J3a3HfhttwCKLyuoyN7yXTFCxKBtSgMQBvrW9yNPa2/zDRUNuGPaH5QUFoa4arQ==} @@ -1461,82 +1437,6 @@ packages: '@snyk/graphlib@2.1.9-patch.3': resolution: {integrity: sha512-bBY9b9ulfLj0v2Eer0yFYa3syVeIxVKl2EpxSrsVeT4mjA0CltZyHsF0JjoaGXP27nItTdJS5uVsj1NA+3aE+Q==} - '@supabase/auth-js@2.117.2': - resolution: {integrity: sha512-Z3WnGwrphYZubrLbxp5Iv0tLA9A5GhvKzJ/ZXglxqwd2QEH2R4dXRltjVJ8sIn4xEW2BSFIGT0yALVJIgZeDYw==} - engines: {node: '>=22.0.0'} - - '@supabase/cli-darwin-arm64@2.120.0': - resolution: {integrity: sha512-GXjW2+J4dGYjbZW0oeDs9y8+Eo/AloRYkbc7LpZmKagc1NYVPzQyviSHZ8LzidCXGlNF3Gds3k8UetjTQQmXbQ==} - cpu: [arm64] - os: [darwin] - - '@supabase/cli-darwin-x64@2.120.0': - resolution: {integrity: sha512-o6ISS9smQnNfpws2nqs3e9lxA0UTsWGI9LAvz2zMymRm11Iy8vZIeOXHV8BbGQWtqxLgfiHHCVvBLE9/41AKQA==} - cpu: [x64] - os: [darwin] - - '@supabase/cli-linux-arm64-musl@2.120.0': - resolution: {integrity: sha512-+4IwiBpGOQgLFeEG6RImxSUrMHo+LDsFNGJ4WLoLBOozFaippoz5J6CnNpVSTeJj9QaOX3G9iVsL/wYF6P1Cxw==} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@supabase/cli-linux-arm64@2.120.0': - resolution: {integrity: sha512-pmR61xpBmzUc79gkh3sE42KtBkludBXex1TIQTVY6jkTjs2+JhJYNKxR7udeaFgxFpiV+zTeAyqJBYXLibxQJw==} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@supabase/cli-linux-x64-musl@2.120.0': - resolution: {integrity: sha512-YIrqu1+hBiLwYIk1HKesrfIm2ycQIsOfN5VGV3r/okQx8JyWl9Jrw7emKVS/F+1afe+1MqKEBP70B0PbuvX+jQ==} - cpu: [x64] - os: [linux] - libc: [musl] - - '@supabase/cli-linux-x64@2.120.0': - resolution: {integrity: sha512-IWJ0yFefhX/69ofcgJfN8MyOC9TtCG4SLrlMCvXjH3vZXxnRkiVNggxQqUCIhshS9Afa+q17DRbQen7/IZTL4A==} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@supabase/cli-windows-arm64@2.120.0': - resolution: {integrity: sha512-U+IDegKWC4xXxk7aCRUUy2ZTJ4bwwrcVlnzG1VJqC7nB7SLgMiyUMyvuo1tB+Xt8hHf0hkuViNtohnXPdZHCIQ==} - cpu: [arm64] - os: [win32] - - '@supabase/cli-windows-x64@2.120.0': - resolution: {integrity: sha512-y96p4JdUuKygzUDCRo1T8yEiLbyWIiL/4Qdnmgu/X84WJOZmji/TlW5ThqDllsQuGWbkgovy+6LLqWKHk330XQ==} - cpu: [x64] - os: [win32] - - '@supabase/functions-js@2.117.2': - resolution: {integrity: sha512-6DT4ZIjmZxa9ANKaBIrjc86AyKrX8M376ynvNeOBBVad3eP7x3UHqWfDR2ynFkHGzCuOpr1A+kObmnahxuwuog==} - engines: {node: '>=22.0.0'} - - '@supabase/phoenix@0.4.5': - resolution: {integrity: sha512-aAn9H9ovVyeApKy11OWOrrOGq8DV68yWeH4ud2lN9fzn4aO8Zb5GLL9m1pUg9nLqIcT+ZDfAcsZe0E/nqdv2lw==} - - '@supabase/postgrest-js@2.117.2': - resolution: {integrity: sha512-V1Qhn+M8xzJqCasOxHZ2KG19Fj39PxU7weEAmOK65/KTsWCRXboB4hcQwFvxRvM7ZikeP9IZWNvQkfjvSxzYFw==} - engines: {node: '>=22.0.0'} - - '@supabase/realtime-js@2.117.2': - resolution: {integrity: sha512-lYXSAIg3eAKA58riUED6Vb+TCzF8jtx18uOoiCaVJ7ZMre6FWBpwB1MPeW+B6vykJT/hPdiuqwcSB7ILMS21ew==} - engines: {node: '>=22.0.0'} - - '@supabase/storage-js@2.117.2': - resolution: {integrity: sha512-8gAJoVaxZa/War2kFRfJMxGk4M190Q7lJ70BofwGlRxU/u9pIodd6XyTvmXkxOKXWuIYtkDaYPZrIAUt1T/7FQ==} - engines: {node: '>=22.0.0'} - - '@supabase/supabase-js@2.117.2': - resolution: {integrity: sha512-eSG2VKnHR+Clp1PmidZ1/weJ8PJwoybjva3L2GgKqFG4YDS1Iqmc61psKGZP5xw6OMT2O7ZorPR42PY6q1BOXg==} - engines: {node: '>=22.0.0'} - peerDependencies: - '@opentelemetry/api': '>=1.0.0' - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - '@swc/core-darwin-arm64@1.16.13': resolution: {integrity: sha512-JrMH2h7ohd4mOIneNRx/diqTmCDSdWfp9uOdQ8VJ2V2CA7jOJ1jWb+qp8RoZLqgiVmwDDC7eySKB1kbvZ+jVXQ==} engines: {node: '>=10'} @@ -2397,10 +2297,6 @@ packages: duplexer2@0.1.4: resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} - eciesjs@0.5.0: - resolution: {integrity: sha512-s0J9SEVYAEPg7J63GFMApLYzPH9VNIQIyC6s15JpnqVc0TqcKWdbgFlnAweEBRyMmko2dcs2sfC83Hj4J43tuA==} - engines: {bun: '>=1', deno: '>=2.7.10', node: '>=16'} - electron-to-chromium@1.5.443: resolution: {integrity: sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==} @@ -2931,10 +2827,6 @@ packages: engines: {node: '>=18'} hasBin: true - iceberg-js@0.8.1: - resolution: {integrity: sha512-1dhVQZXhcHje7798IVM+xoo/1ZdVfzOMIc8/rgVSijRK38EDqOJoGula9N/8ZI5RD8QTxNQtK/Gozpr+qUqRRA==} - engines: {node: '>=20.0.0'} - iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -3168,9 +3060,6 @@ packages: resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} hasBin: true - jose@6.2.12: - resolution: {integrity: sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -4319,10 +4208,6 @@ packages: babel-plugin-macros: optional: true - supabase@2.120.0: - resolution: {integrity: sha512-NF8ueHsOZMbyiFJARKbiZy9AhNtj5E5R49P+cVqlv2u/T2JpMtsvp29YgPgrIWkVUjsfhJseTmKEdckatSeWZQ==} - hasBin: true - super-regex@1.1.0: resolution: {integrity: sha512-WHkws2ZflZe41zj6AolvvmaTrWds/VuyeYr9iPVv/oQeaIoVxMKaushfFWpOGDT+GuBrM/sVqF8KUCYQlSSTdQ==} engines: {node: '>=18'} @@ -4917,10 +4802,6 @@ snapshots: '@conventional-changelog/template@1.4.0': {} - '@ecies/ciphers@0.2.6(@noble/ciphers@1.3.0)': - dependencies: - '@noble/ciphers': 1.3.0 - '@eloqnt/config@0.1.1': {} '@eloqnt/format-json@0.1.0': @@ -5344,14 +5225,6 @@ snapshots: '@next/swc-win32-x64-msvc@16.4.0': optional: true - '@noble/ciphers@1.3.0': {} - - '@noble/curves@1.9.7': - dependencies: - '@noble/hashes': 1.8.0 - - '@noble/hashes@1.8.0': {} - '@nodable/entities@3.1.0': {} '@nodelib/fs.scandir@2.1.5': @@ -5917,62 +5790,6 @@ snapshots: lodash.values: 4.3.0 optional: true - '@supabase/auth-js@2.117.2': - dependencies: - tslib: 2.8.1 - - '@supabase/cli-darwin-arm64@2.120.0': - optional: true - - '@supabase/cli-darwin-x64@2.120.0': - optional: true - - '@supabase/cli-linux-arm64-musl@2.120.0': - optional: true - - '@supabase/cli-linux-arm64@2.120.0': - optional: true - - '@supabase/cli-linux-x64-musl@2.120.0': - optional: true - - '@supabase/cli-linux-x64@2.120.0': - optional: true - - '@supabase/cli-windows-arm64@2.120.0': - optional: true - - '@supabase/cli-windows-x64@2.120.0': - optional: true - - '@supabase/functions-js@2.117.2': - dependencies: - tslib: 2.8.1 - - '@supabase/phoenix@0.4.5': {} - - '@supabase/postgrest-js@2.117.2': - dependencies: - tslib: 2.8.1 - - '@supabase/realtime-js@2.117.2': - dependencies: - '@supabase/phoenix': 0.4.5 - tslib: 2.8.1 - - '@supabase/storage-js@2.117.2': - dependencies: - iceberg-js: 0.8.1 - tslib: 2.8.1 - - '@supabase/supabase-js@2.117.2': - dependencies: - '@supabase/auth-js': 2.117.2 - '@supabase/functions-js': 2.117.2 - '@supabase/postgrest-js': 2.117.2 - '@supabase/realtime-js': 2.117.2 - '@supabase/storage-js': 2.117.2 - '@swc/core-darwin-arm64@1.16.13': optional: true @@ -6779,13 +6596,6 @@ snapshots: dependencies: readable-stream: 2.3.8 - eciesjs@0.5.0: - dependencies: - '@ecies/ciphers': 0.2.6(@noble/ciphers@1.3.0) - '@noble/ciphers': 1.3.0 - '@noble/curves': 1.9.7 - '@noble/hashes': 1.8.0 - electron-to-chromium@1.5.443: {} emoji-regex@10.6.0: {} @@ -7538,8 +7348,6 @@ snapshots: husky@9.1.7: {} - iceberg-js@0.8.1: {} - iconv-lite@0.4.24: dependencies: safer-buffer: 2.1.2 @@ -7760,8 +7568,6 @@ snapshots: jiti@2.7.0: {} - jose@6.2.12: {} - js-tokens@4.0.0: {} js-yaml@4.3.2: @@ -8942,20 +8748,6 @@ snapshots: optionalDependencies: '@babel/core': 7.29.7(supports-color@7.2.0) - supabase@2.120.0: - dependencies: - eciesjs: 0.5.0 - jose: 6.2.12 - optionalDependencies: - '@supabase/cli-darwin-arm64': 2.120.0 - '@supabase/cli-darwin-x64': 2.120.0 - '@supabase/cli-linux-arm64': 2.120.0 - '@supabase/cli-linux-arm64-musl': 2.120.0 - '@supabase/cli-linux-x64': 2.120.0 - '@supabase/cli-linux-x64-musl': 2.120.0 - '@supabase/cli-windows-arm64': 2.120.0 - '@supabase/cli-windows-x64': 2.120.0 - super-regex@1.1.0: dependencies: function-timeout: 1.0.2 diff --git a/scripts/export-supabase-env.sh b/scripts/export-supabase-env.sh deleted file mode 100755 index 410133d..0000000 --- a/scripts/export-supabase-env.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# Map `supabase status -o env` names to app env vars. -# Prefers new publishable/secret keys; falls back to legacy anon/service_role JWTs. -set -euo pipefail - -eval "$(pnpm exec supabase status -o env)" - -export SUPABASE_URL="${API_URL:?API_URL missing from supabase status}" -export SUPABASE_PUBLISHABLE_KEY="${PUBLISHABLE_KEY:-${ANON_KEY:-}}" -export SUPABASE_SECRET_KEY="${SECRET_KEY:-${SERVICE_ROLE_KEY:-}}" - -if [[ -z "$SUPABASE_PUBLISHABLE_KEY" ]]; then - echo "PUBLISHABLE_KEY or ANON_KEY missing from supabase status" >&2 - exit 1 -fi - -if [[ -z "$SUPABASE_SECRET_KEY" ]]; then - echo "SECRET_KEY or SERVICE_ROLE_KEY missing from supabase status" >&2 - exit 1 -fi - -# Legacy aliases (seed/build fallbacks) -export SUPABASE_ANON_KEY="${ANON_KEY:-$SUPABASE_PUBLISHABLE_KEY}" -export SUPABASE_SERVICE_ROLE_KEY="${SERVICE_ROLE_KEY:-$SUPABASE_SECRET_KEY}" - -if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then - echo "::add-mask::${SUPABASE_PUBLISHABLE_KEY}" - echo "::add-mask::${SUPABASE_SECRET_KEY}" -fi diff --git a/scripts/prepare-static-site-prod.sh b/scripts/prepare-static-site-prod.sh deleted file mode 100755 index 21c8af6..0000000 --- a/scripts/prepare-static-site-prod.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -: "${SUPABASE_URL:?SUPABASE_URL is required (set vars.SUPABASE_URL or export SUPABASE_URL)}" - -SUPABASE_PUBLISHABLE_KEY="${SUPABASE_PUBLISHABLE_KEY:-${SUPABASE_ANON_KEY:-}}" -: "${SUPABASE_PUBLISHABLE_KEY:?SUPABASE_PUBLISHABLE_KEY is required (production)}" - -export SUPABASE_PUBLISHABLE_KEY - -pnpm run generate diff --git a/scripts/prepare-static-site.sh b/scripts/prepare-static-site.sh index 1d9c2cf..9cd147e 100755 --- a/scripts/prepare-static-site.sh +++ b/scripts/prepare-static-site.sh @@ -1,15 +1,4 @@ #!/usr/bin/env bash -# CI (ci.yaml): start local Supabase, seed, then generate. -# Publish (publish.yaml): use scripts/prepare-static-site-prod.sh with prod secrets. set -euo pipefail -if [[ "${CI:-}" == "true" ]]; then - bash scripts/supabase-start-quiet.sh - - # shellcheck source=/dev/null - source scripts/export-supabase-env.sh - - pnpm run db:seed -fi - pnpm run generate diff --git a/scripts/prepare-supabase-for-build.sh b/scripts/prepare-supabase-for-build.sh deleted file mode 100755 index e4fef5b..0000000 --- a/scripts/prepare-supabase-for-build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -bash scripts/supabase-start-quiet.sh - -# shellcheck source=/dev/null -source scripts/export-supabase-env.sh - -pnpm run db:seed diff --git a/scripts/seed-from-yaml.mts b/scripts/seed-from-yaml.mts deleted file mode 100644 index 6090def..0000000 --- a/scripts/seed-from-yaml.mts +++ /dev/null @@ -1,282 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { resolve } from 'node:path'; - -import { createClient } from '@supabase/supabase-js'; -import { parse } from 'yaml'; - -import type { Database } from '../lib/supabase/types'; - -type Localized = { en: string; hu: string }; -type Period = { year?: number; month?: number }; - -interface YamlCv { - personal: { - name: Localized; - title: Localized; - picture: string; - links: Array<{ - platform: string; - url: string; - icon: { dark: string; light: string }; - }>; - contact: Array<{ type: string; value: string }>; - }; - workExperience: Array<{ - title: Localized; - company: { name: string; link?: string }; - employmentType?: string; - location: string; - from: Period; - end?: Period; - description: Localized; - technologies: Array<{ name: string; link?: string }>; - }>; - educations: Array<{ - degree: Localized; - institution: { name: Localized; link?: string }; - location: string; - from: Period; - end?: Period; - note?: Localized; - }>; - skills: Array<{ name: string; link?: string }>; - hobbies: Array<{ name: Localized; link?: string }>; -} - -const SITE = { - url: 'https://95gabor.me', - title: 'Gábor Pichner | Senior TypeScript Full-Stack Developer', - description: - 'Gábor Pichner - TypeScript Full-Stack Developer specializing in modern web technologies, cloud architecture, and DevOps.', - keywords: [ - 'Full-Stack', - 'Developer', - 'SRE', - 'DevOps', - 'Cloud', - 'TypeScript', - 'React', - 'Next.js', - ], - favicon_path: 'icons/favicons/gabor-pichner.ico', -}; - -const SLUG = 'gabor-pichner'; - -function requireEnv(name: string): string { - const value = process.env[name]; - if (!value) { - throw new Error(`Missing environment variable: ${name}`); - } - return value; -} - -function trimLocalized(value: Localized): Localized { - return { en: value.en.trim(), hu: value.hu.trim() }; -} - -function periodYear(period: Period): number { - if (period.year == null) { - throw new Error('Period year is required'); - } - return period.year; -} - -function requireAnyEnv(...names: string[]): string { - for (const name of names) { - const value = process.env[name]; - if (value) { - return value; - } - } - throw new Error(`Missing environment variable: one of ${names.join(', ')}`); -} - -async function main() { - const supabase = createClient( - requireEnv('SUPABASE_URL'), - requireAnyEnv('SUPABASE_SECRET_KEY', 'SUPABASE_SERVICE_ROLE_KEY'), - { auth: { persistSession: false, autoRefreshToken: false } }, - ); - - const yamlPath = resolve(process.cwd(), 'content/gabor-pichner.yaml'); - const cv = parse(readFileSync(yamlPath, 'utf8')) as YamlCv; - - const { error: siteError } = await supabase.from('site_config').upsert({ - id: 'default', - url: SITE.url, - title: SITE.title, - description: SITE.description, - keywords: SITE.keywords, - favicon_path: SITE.favicon_path, - }); - - if (siteError) { - throw siteError; - } - - const { data: existing } = await supabase - .from('cv_profiles') - .select('id') - .eq('slug', SLUG) - .maybeSingle(); - - if (existing) { - const { error: deleteError } = await supabase - .from('cv_profiles') - .delete() - .eq('id', existing.id); - if (deleteError) { - throw deleteError; - } - } - - const { data: profile, error: profileError } = await supabase - .from('cv_profiles') - .insert({ - slug: SLUG, - name_en: cv.personal.name.en, - name_hu: cv.personal.name.hu, - title_en: cv.personal.title.en, - title_hu: cv.personal.title.hu, - picture_path: cv.personal.picture, - is_active: true, - }) - .select('id') - .single(); - - if (profileError || !profile) { - throw profileError ?? new Error('Failed to insert cv_profile'); - } - - const profileId = profile.id; - - const { error: linksError } = await supabase.from('personal_links').insert( - cv.personal.links.map((link, index) => ({ - cv_profile_id: profileId, - sort_order: index, - platform: link.platform, - url: link.url, - icon_dark_path: link.icon.dark, - icon_light_path: link.icon.light, - })), - ); - if (linksError) { - throw linksError; - } - - const { error: contactsError } = await supabase - .from('personal_contacts') - .insert( - cv.personal.contact.map((contact, index) => ({ - cv_profile_id: profileId, - sort_order: index, - type: contact.type as 'location' | 'phone' | 'email' | 'link', - value: contact.value, - })), - ); - if (contactsError) { - throw contactsError; - } - - for (const [jobIndex, job] of cv.workExperience.entries()) { - const description = trimLocalized(job.description); - - const { data: workRow, error: workError } = await supabase - .from('work_experiences') - .insert({ - cv_profile_id: profileId, - sort_order: jobIndex, - title_en: job.title.en, - title_hu: job.title.hu, - company_name: job.company.name, - company_link: job.company.link ?? null, - location: job.location, - from_year: periodYear(job.from), - from_month: job.from.month ?? null, - end_year: job.end?.year ?? null, - end_month: job.end?.month ?? null, - employment_type: job.employmentType ?? null, - description_en: description.en, - description_hu: description.hu, - }) - .select('id') - .single(); - - if (workError || !workRow) { - throw workError ?? new Error('Failed to insert work_experience'); - } - - if (job.technologies.length > 0) { - const { error: techError } = await supabase - .from('work_experience_technologies') - .insert( - job.technologies.map((tech, techIndex) => ({ - work_experience_id: workRow.id, - sort_order: techIndex, - name: tech.name, - link: tech.link ?? null, - })), - ); - if (techError) { - throw techError; - } - } - } - - const { error: educationsError } = await supabase.from('educations').insert( - cv.educations.map((education, index) => ({ - cv_profile_id: profileId, - sort_order: index, - degree_en: education.degree.en, - degree_hu: education.degree.hu, - institution_name_en: education.institution.name.en, - institution_name_hu: education.institution.name.hu, - institution_link: education.institution.link ?? null, - location: education.location, - from_year: periodYear(education.from), - from_month: education.from.month ?? null, - end_year: education.end?.year ?? null, - end_month: education.end?.month ?? null, - note_en: education.note?.en ?? null, - note_hu: education.note?.hu ?? null, - })), - ); - if (educationsError) { - throw educationsError; - } - - const { error: skillsError } = await supabase.from('skills').insert( - cv.skills.map((skill, index) => ({ - cv_profile_id: profileId, - sort_order: index, - name: skill.name, - link: skill.link ?? null, - })), - ); - if (skillsError) { - throw skillsError; - } - - const { error: hobbiesError } = await supabase.from('hobbies').insert( - cv.hobbies.map((hobby, index) => ({ - cv_profile_id: profileId, - sort_order: index, - name_en: hobby.name.en, - name_hu: hobby.name.hu, - link: hobby.link ?? null, - })), - ); - if (hobbiesError) { - throw hobbiesError; - } - - console.info( - `Seeded CV "${SLUG}": ${cv.workExperience.length} jobs, ${cv.educations.length} educations, ${cv.skills.length} skills, ${cv.hobbies.length} hobbies`, - ); -} - -main().catch((error: unknown) => { - console.error(error); - process.exit(1); -}); diff --git a/scripts/supabase-push-prod.sh b/scripts/supabase-push-prod.sh deleted file mode 100755 index 3b8f474..0000000 --- a/scripts/supabase-push-prod.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# Push migrations to production. -# Preferred (CI): SUPABASE_DB_URL — single direct Postgres URI, no CLI account token. -# Fallback (local): SUPABASE_ACCESS_TOKEN + SUPABASE_PROJECT_REF + SUPABASE_DB_PASSWORD -set -euo pipefail - -if [[ -n "${SUPABASE_DB_URL:-}" ]]; then - pnpm exec supabase db push --db-url "$SUPABASE_DB_URL" --yes - exit 0 -fi - -: "${SUPABASE_ACCESS_TOKEN:?Set SUPABASE_DB_URL or SUPABASE_ACCESS_TOKEN}" -: "${SUPABASE_PROJECT_REF:?Set SUPABASE_DB_URL or SUPABASE_PROJECT_REF}" -: "${SUPABASE_DB_PASSWORD:?Set SUPABASE_DB_URL or SUPABASE_DB_PASSWORD}" - -export SUPABASE_ACCESS_TOKEN - -pnpm exec supabase link \ - --project-ref "$SUPABASE_PROJECT_REF" \ - --password "$SUPABASE_DB_PASSWORD" \ - --yes - -pnpm exec supabase db push --linked --yes diff --git a/scripts/supabase-start-quiet.sh b/scripts/supabase-start-quiet.sh deleted file mode 100755 index 5ba0c69..0000000 --- a/scripts/supabase-start-quiet.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# Start local Supabase without printing keys to stdout (CI log hygiene). -set -euo pipefail - -log="$(mktemp)" -trap 'rm -f "$log"' EXIT - -if ! pnpm exec supabase start -x imgproxy,logflare,vector,edge-runtime >"$log" 2>&1; then - echo "supabase start failed" >&2 - sed -E 's/(sb_publishable_|sb_secret_)[^ |│]*/\1***/g' "$log" >&2 - exit 1 -fi diff --git a/scripts/write-docker-build-secrets.sh b/scripts/write-docker-build-secrets.sh deleted file mode 100755 index 02dc312..0000000 --- a/scripts/write-docker-build-secrets.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# Write Supabase credentials to temp files for BuildKit secret mounts (no log leakage). -set -euo pipefail - -if [[ -z "${SUPABASE_PUBLISHABLE_KEY:-}" ]]; then - # shellcheck source=/dev/null - source scripts/export-supabase-env.sh -fi - -if [[ -n "${DOCKER_SUPABASE_URL:-}" ]]; then - SUPABASE_URL="$DOCKER_SUPABASE_URL" -fi - -: "${SUPABASE_URL:?SUPABASE_URL is required}" -: "${SUPABASE_PUBLISHABLE_KEY:?SUPABASE_PUBLISHABLE_KEY is required}" - -if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then - echo "::add-mask::${SUPABASE_PUBLISHABLE_KEY}" - if [[ -n "${SUPABASE_SECRET_KEY:-}" ]]; then - echo "::add-mask::${SUPABASE_SECRET_KEY}" - fi -fi - -secrets_dir="${RUNNER_TEMP:?RUNNER_TEMP is required}/docker-build-secrets" -mkdir -p "$secrets_dir" -chmod 700 "$secrets_dir" - -printf '%s' "$SUPABASE_URL" >"$secrets_dir/supabase_url" -printf '%s' "$SUPABASE_PUBLISHABLE_KEY" >"$secrets_dir/supabase_publishable_key" -chmod 600 "$secrets_dir"/* - -{ - echo "supabase_url_file=$secrets_dir/supabase_url" - echo "supabase_publishable_key_file=$secrets_dir/supabase_publishable_key" -} >>"${GITHUB_OUTPUT:?GITHUB_OUTPUT is required}" diff --git a/supabase/.gitignore b/supabase/.gitignore deleted file mode 100644 index ad9264f..0000000 --- a/supabase/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Supabase -.branches -.temp - -# dotenvx -.env.keys -.env.local -.env.*.local diff --git a/supabase/config.toml b/supabase/config.toml deleted file mode 100644 index b5b8454..0000000 --- a/supabase/config.toml +++ /dev/null @@ -1,412 +0,0 @@ -# For detailed configuration reference documentation, visit: -# https://supabase.com/docs/guides/local-development/cli/config -# A string used to distinguish different Supabase projects on the same host. Defaults to the -# working directory name when running `supabase init`. -project_id = "cv" - -[api] -enabled = true -# Port to use for the API URL. -port = 54321 -# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. `public` and `graphql_public` schemas are included by default. -schemas = ["public", "graphql_public"] -# Extra schemas to add to the search_path of every request. -extra_search_path = ["public", "extensions"] -# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size -# for accidental or malicious requests. -max_rows = 1000 -# Controls whether new tables, views, sequences and functions created in the `public` schema by -# `postgres` are reachable through the Data API roles (`anon`, `authenticated`, `service_role`) -# without explicit GRANTs. When unset, new entities are NOT auto-exposed, matching the new cloud -# default. Set to `true` to keep the legacy behaviour of auto-exposing new entities; this is -# deprecated and the field is removed on 2026-10-30 once the always-revoked behaviour is permanent. -# auto_expose_new_tables = true - -[api.tls] -# Enable HTTPS endpoints locally using a self-signed certificate. -enabled = false -# Paths to self-signed certificate pair. -# cert_path = "../certs/my-cert.pem" -# key_path = "../certs/my-key.pem" - -[db] -# Port to use for the local database URL. -port = 54322 -# Port used by db diff command to initialize the shadow database. -shadow_port = 54320 -# Maximum amount of time to wait for health check when starting the local database. -health_timeout = "2m" -# The database major version to use. This has to be the same as your remote database's. Run `SHOW -# server_version;` on the remote database to check. -major_version = 17 - -[db.pooler] -enabled = false -# Port to use for the local connection pooler. -port = 54329 -# Specifies when a server connection can be reused by other clients. -# Configure one of the supported pooler modes: `transaction`, `session`. -pool_mode = "transaction" -# How many server connections to allow per user/database pair. -default_pool_size = 20 -# Maximum number of client connections allowed. -max_client_conn = 100 - -# [db.vault] -# secret_key = "env(SECRET_VALUE)" - -[db.migrations] -# If disabled, migrations will be skipped during a db push or reset. -enabled = true -# Specifies an ordered list of schema files that describe your database. -# Supports glob patterns relative to supabase directory: "./schemas/*.sql" -schema_paths = [] - -[db.seed] -# CV data is seeded from YAML via `pnpm run db:seed` (scripts/seed-from-yaml.mts). -enabled = false -sql_paths = [] - -[db.network_restrictions] -# Enable management of network restrictions. -enabled = false -# List of IPv4 CIDR blocks allowed to connect to the database. -# Defaults to allow all IPv4 connections. Set empty array to block all IPs. -allowed_cidrs = ["0.0.0.0/0"] -# List of IPv6 CIDR blocks allowed to connect to the database. -# Defaults to allow all IPv6 connections. Set empty array to block all IPs. -allowed_cidrs_v6 = ["::/0"] - -# Uncomment to reject non-secure connections to the database. -# [db.ssl_enforcement] -# enabled = true - -[realtime] -enabled = true -# Bind realtime via either IPv4 or IPv6. (default: IPv4) -# ip_version = "IPv6" -# The maximum length in bytes of HTTP request headers. (default: 4096) -# max_header_length = 4096 - -[studio] -enabled = true -# Port to use for Supabase Studio. -port = 54323 -# External URL of the API server that frontend connects to. -api_url = "http://127.0.0.1" -# OpenAI API Key to use for Supabase AI in the Supabase Studio. -openai_api_key = "env(OPENAI_API_KEY)" - -# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they -# are monitored, and you can view the emails that would have been sent from the web interface. -[local_smtp] -enabled = true -# Port to use for the email testing server web interface. -port = 54324 -# Uncomment to expose additional ports for testing user applications that send emails. -# smtp_port = 54325 -# pop3_port = 54326 -# admin_email = "admin@email.com" -# sender_name = "Admin" - -[storage] -enabled = true -# The maximum file size allowed (e.g. "5MB", "500KB"). -file_size_limit = "50MiB" - -# Uncomment to configure local storage buckets -# [storage.buckets.images] -# public = false -# file_size_limit = "50MiB" -# allowed_mime_types = ["image/png", "image/jpeg"] -# objects_path = "./images" - -# Allow connections via S3 compatible clients -[storage.s3_protocol] -enabled = true - -# Image transformation API is available to Supabase Pro plan. -# [storage.image_transformation] -# enabled = true - -# Store analytical data in S3 for running ETL jobs over Iceberg Catalog -# This feature is only available on the hosted platform. -[storage.analytics] -enabled = false -max_namespaces = 5 -max_tables = 10 -max_catalogs = 2 - -# Analytics Buckets is available to Supabase Pro plan. -# [storage.analytics.buckets.my-warehouse] - -# Store vector embeddings in S3 for large and durable datasets -[storage.vector] -enabled = true -max_buckets = 10 -max_indexes = 5 - -# Vector Buckets is available to Supabase Pro plan. -# [storage.vector.buckets.documents-openai] - -[auth] -enabled = true -# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used -# in emails. -site_url = "http://127.0.0.1:3000" -# The public URL that Auth serves on. Defaults to the API external URL with `/auth/v1` appended. -# external_url = "" -# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. -additional_redirect_urls = ["https://127.0.0.1:3000"] -# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). -jwt_expiry = 3600 -# JWT issuer URL. If not set, defaults to auth.external_url. -# jwt_issuer = "" -# Path to JWT signing key. DO NOT commit your signing keys file to git. -# signing_keys_path = "./signing_keys.json" -# If disabled, the refresh token will never expire. -enable_refresh_token_rotation = true -# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. -# Requires enable_refresh_token_rotation = true. -refresh_token_reuse_interval = 10 -# Allow/disallow new user signups to your project. -enable_signup = true -# Allow/disallow anonymous sign-ins to your project. -enable_anonymous_sign_ins = false -# Allow/disallow testing manual linking of accounts -enable_manual_linking = false -# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. -minimum_password_length = 6 -# Passwords that do not meet the following requirements will be rejected as weak. Supported values -# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols` -password_requirements = "" - -# Configure passkey sign-ins. -# [auth.passkey] -# enabled = false - -# Configure WebAuthn relying party settings (required when passkey is enabled). -# [auth.webauthn] -# rp_display_name = "Supabase" -# rp_id = "localhost" -# rp_origins = ["http://127.0.0.1:3000"] - -[auth.rate_limit] -# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled. -email_sent = 2 -# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled. -sms_sent = 30 -# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true. -anonymous_users = 30 -# Number of sessions that can be refreshed in a 5 minute interval per IP address. -token_refresh = 150 -# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users). -sign_in_sign_ups = 30 -# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. -token_verifications = 30 -# Number of Web3 logins that can be made in a 5 minute interval per IP address. -web3 = 30 - -# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. -# [auth.captcha] -# enabled = true -# provider = "hcaptcha" -# secret = "" - -[auth.email] -# Allow/disallow new user signups via email to your project. -enable_signup = true -# If enabled, a user will be required to confirm any email change on both the old, and new email -# addresses. If disabled, only the new email is required to confirm. -double_confirm_changes = true -# If enabled, users need to confirm their email address before signing in. -enable_confirmations = false -# If enabled, users will need to reauthenticate or have logged in recently to change their password. -secure_password_change = false -# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. -max_frequency = "1s" -# Number of characters used in the email OTP. -otp_length = 6 -# Number of seconds before the email OTP expires (defaults to 1 hour). -otp_expiry = 3600 - -# Use a production-ready SMTP server -# [auth.email.smtp] -# enabled = true -# host = "smtp.sendgrid.net" -# port = 587 -# user = "apikey" -# pass = "env(SENDGRID_API_KEY)" -# admin_email = "admin@email.com" -# sender_name = "Admin" - -# Uncomment to customize email template -# [auth.email.template.invite] -# subject = "You have been invited" -# content_path = "./supabase/templates/invite.html" - -# Uncomment to customize notification email template -# [auth.email.notification.password_changed] -# enabled = true -# subject = "Your password has been changed" -# content_path = "./templates/password_changed_notification.html" - -[auth.sms] -# Allow/disallow new user signups via SMS to your project. -enable_signup = false -# If enabled, users need to confirm their phone number before signing in. -enable_confirmations = false -# Template for sending OTP to users -template = "Your code is {{ `{{ .Code }}` }}" -# Controls the minimum amount of time that must pass before sending another sms otp. -max_frequency = "5s" - -# Use pre-defined map of phone number to OTP for testing. -# [auth.sms.test_otp] -# 4152127777 = "123456" - -# Configure logged in session timeouts. -# [auth.sessions] -# Force log out after the specified duration. -# timebox = "24h" -# Force log out if the user has been inactive longer than the specified duration. -# inactivity_timeout = "8h" - -# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object. -# [auth.hook.before_user_created] -# enabled = true -# uri = "pg-functions://postgres/auth/before-user-created-hook" - -# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. -# [auth.hook.custom_access_token] -# enabled = true -# uri = "pg-functions:////" - -# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. -[auth.sms.twilio] -enabled = false -account_sid = "" -message_service_sid = "" -# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: -auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" - -# Multi-factor-authentication is available to Supabase Pro plan. -[auth.mfa] -# Control how many MFA factors can be enrolled at once per user. -max_enrolled_factors = 10 - -# Control MFA via App Authenticator (TOTP) -[auth.mfa.totp] -enroll_enabled = false -verify_enabled = false - -# Configure MFA via Phone Messaging -[auth.mfa.phone] -enroll_enabled = false -verify_enabled = false -otp_length = 6 -template = "Your code is {{ `{{ .Code }}` }}" -max_frequency = "5s" - -# Configure MFA via WebAuthn -# [auth.mfa.web_authn] -# enroll_enabled = true -# verify_enabled = true - -# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, -# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, -# `twitter`, `x`, `slack`, `spotify`, `workos`, `zoom`. -[auth.external.apple] -enabled = false -client_id = "" -# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: -secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" -# Overrides the default auth callback URL derived from auth.external_url. -redirect_uri = "" -# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, -# or any other third-party OIDC providers. -url = "" -# If enabled, the nonce check will be skipped. Required for local sign in with Google auth. -skip_nonce_check = false -# If enabled, it will allow the user to successfully authenticate when the provider does not return an email address. -email_optional = false - -# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard. -# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting. -[auth.web3.solana] -enabled = false - -# Use Firebase Auth as a third-party provider alongside Supabase Auth. -[auth.third_party.firebase] -enabled = false -# project_id = "my-firebase-project" - -# Use Auth0 as a third-party provider alongside Supabase Auth. -[auth.third_party.auth0] -enabled = false -# tenant = "my-auth0-tenant" -# tenant_region = "us" - -# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth. -[auth.third_party.aws_cognito] -enabled = false -# user_pool_id = "my-user-pool-id" -# user_pool_region = "us-east-1" - -# Use Clerk as a third-party provider alongside Supabase Auth. -[auth.third_party.clerk] -enabled = false -# Obtain from https://clerk.com/setup/supabase -# domain = "example.clerk.accounts.dev" - -# OAuth server configuration -[auth.oauth_server] -# Enable OAuth server functionality -enabled = false -# Path for OAuth consent flow UI -authorization_url_path = "/oauth/consent" -# Allow dynamic client registration -allow_dynamic_registration = false - -[edge_runtime] -enabled = true -# Supported request policies: `oneshot`, `per_worker`. -# `per_worker` (default) — enables hot reload during local development. -# `oneshot` — fallback mode if hot reload causes issues (e.g. in large repos or with symlinks). -policy = "per_worker" -# Port to attach the Chrome inspector for debugging edge functions. -inspector_port = 8083 -# The Deno major version to use. -deno_version = 2 - -# [edge_runtime.secrets] -# secret_key = "env(SECRET_VALUE)" - -[analytics] -enabled = true -port = 54327 -# Configure one of the supported backends: `postgres`, `bigquery`. -backend = "postgres" - -# Experimental features may be deprecated any time -[experimental] -# Configures Postgres storage engine to use OrioleDB (S3) -orioledb_version = "" -# Configures S3 bucket URL, eg. .s3-.amazonaws.com -s3_host = "env(S3_HOST)" -# Configures S3 bucket region, eg. us-east-1 -s3_region = "env(S3_REGION)" -# Configures AWS_ACCESS_KEY_ID for S3 bucket -s3_access_key = "env(S3_ACCESS_KEY)" -# Configures AWS_SECRET_ACCESS_KEY for S3 bucket -s3_secret_key = "env(S3_SECRET_KEY)" - -# pg-delta is the schema diff engine for db diff / db pull / db remote commit. -# Set enabled = false to fall back to the legacy migra engine. -[experimental.pgdelta] -enabled = true -# Directory under `supabase/` where declarative files are written. -# declarative_schema_path = "./database" -# JSON string passed through to pg-delta SQL formatting. -# format_options = "{\"keywordCase\":\"upper\",\"indent\":2,\"maxWidth\":80,\"commaStyle\":\"trailing\"}" diff --git a/supabase/migrations/20260706095641_create_cv_tables.sql b/supabase/migrations/20260706095641_create_cv_tables.sql deleted file mode 100644 index c635d8f..0000000 --- a/supabase/migrations/20260706095641_create_cv_tables.sql +++ /dev/null @@ -1,264 +0,0 @@ --- CV content schema (editor-first hybrid) - -create extension if not exists pgcrypto; - --- --------------------------------------------------------------------------- --- Tables --- --------------------------------------------------------------------------- - -create table public.site_config ( - id text primary key default 'default', - url text not null, - title text not null, - description text not null, - keywords text[] not null default '{}', - favicon_path text -); - -create table public.cv_profiles ( - id uuid primary key default gen_random_uuid(), - slug text unique not null, - name_en text not null, - name_hu text not null, - title_en text not null, - title_hu text not null, - picture_path text not null, - is_active boolean not null default true, - updated_at timestamptz not null default now() -); - -create table public.personal_links ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - platform text not null, - url text not null, - icon_dark_path text not null, - icon_light_path text not null -); - -create table public.personal_contacts ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - type text not null check (type in ('location', 'phone', 'email', 'link')), - value text not null -); - -create table public.work_experiences ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - title_en text not null, - title_hu text not null, - company_name text not null, - company_link text, - location text not null, - from_year int not null, - from_month int check (from_month between 1 and 12), - end_year int, - end_month int check (end_month between 1 and 12), - employment_type text, - description_en text not null, - description_hu text not null -); - -create table public.work_experience_technologies ( - id uuid primary key default gen_random_uuid(), - work_experience_id uuid not null references public.work_experiences (id) on delete cascade, - sort_order int not null, - name text not null, - link text -); - -create table public.educations ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - degree_en text not null, - degree_hu text not null, - institution_name_en text not null, - institution_name_hu text not null, - institution_link text, - location text not null, - from_year int not null, - from_month int check (from_month between 1 and 12), - end_year int, - end_month int check (end_month between 1 and 12), - note_en text, - note_hu text -); - -create table public.skills ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - name text not null, - link text -); - -create table public.hobbies ( - id uuid primary key default gen_random_uuid(), - cv_profile_id uuid not null references public.cv_profiles (id) on delete cascade, - sort_order int not null, - name_en text not null, - name_hu text not null, - link text -); - --- --------------------------------------------------------------------------- --- Indexes --- --------------------------------------------------------------------------- - -create index personal_links_cv_profile_id_idx on public.personal_links (cv_profile_id); -create index personal_contacts_cv_profile_id_idx on public.personal_contacts (cv_profile_id); -create index work_experiences_cv_profile_id_idx on public.work_experiences (cv_profile_id); -create index work_experience_technologies_work_experience_id_idx - on public.work_experience_technologies (work_experience_id); -create index educations_cv_profile_id_idx on public.educations (cv_profile_id); -create index skills_cv_profile_id_idx on public.skills (cv_profile_id); -create index hobbies_cv_profile_id_idx on public.hobbies (cv_profile_id); - --- --------------------------------------------------------------------------- --- updated_at bump triggers (webhook source: cv_profiles.updated_at) --- --------------------------------------------------------------------------- - -create or replace function public.bump_cv_profile_updated_at() -returns trigger -language plpgsql -as $$ -begin - update public.cv_profiles - set updated_at = now() - where id = coalesce(new.cv_profile_id, old.cv_profile_id); - return coalesce(new, old); -end; -$$; - -create or replace function public.bump_cv_profile_from_technology() -returns trigger -language plpgsql -as $$ -declare - profile_id uuid; -begin - select we.cv_profile_id - into profile_id - from public.work_experiences we - where we.id = coalesce(new.work_experience_id, old.work_experience_id); - - if profile_id is not null then - update public.cv_profiles - set updated_at = now() - where id = profile_id; - end if; - - return coalesce(new, old); -end; -$$; - -create trigger personal_links_bump_cv_profile -after insert or update or delete on public.personal_links -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger personal_contacts_bump_cv_profile -after insert or update or delete on public.personal_contacts -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger work_experiences_bump_cv_profile -after insert or update or delete on public.work_experiences -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger educations_bump_cv_profile -after insert or update or delete on public.educations -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger skills_bump_cv_profile -after insert or update or delete on public.skills -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger hobbies_bump_cv_profile -after insert or update or delete on public.hobbies -for each row execute function public.bump_cv_profile_updated_at(); - -create trigger work_experience_technologies_bump_cv_profile -after insert or update or delete on public.work_experience_technologies -for each row execute function public.bump_cv_profile_from_technology(); - --- --------------------------------------------------------------------------- --- Row level security (public read for static build via anon key) --- --------------------------------------------------------------------------- - -alter table public.site_config enable row level security; -alter table public.cv_profiles enable row level security; -alter table public.personal_links enable row level security; -alter table public.personal_contacts enable row level security; -alter table public.work_experiences enable row level security; -alter table public.work_experience_technologies enable row level security; -alter table public.educations enable row level security; -alter table public.skills enable row level security; -alter table public.hobbies enable row level security; - -create policy "Public read site_config" - on public.site_config for select - to anon, authenticated - using (true); - -create policy "Public read active cv_profiles" - on public.cv_profiles for select - to anon, authenticated - using (is_active = true); - -create policy "Public read personal_links" - on public.personal_links for select - to anon, authenticated - using (true); - -create policy "Public read personal_contacts" - on public.personal_contacts for select - to anon, authenticated - using (true); - -create policy "Public read work_experiences" - on public.work_experiences for select - to anon, authenticated - using (true); - -create policy "Public read work_experience_technologies" - on public.work_experience_technologies for select - to anon, authenticated - using (true); - -create policy "Public read educations" - on public.educations for select - to anon, authenticated - using (true); - -create policy "Public read skills" - on public.skills for select - to anon, authenticated - using (true); - -create policy "Public read hobbies" - on public.hobbies for select - to anon, authenticated - using (true); - --- --------------------------------------------------------------------------- --- Grants (anon read for static build) --- --------------------------------------------------------------------------- - -grant usage on schema public to anon, authenticated, service_role; -grant select on all tables in schema public to anon, authenticated; -grant all on all tables in schema public to service_role; -grant usage, select on all sequences in schema public to service_role; - - -insert into storage.buckets (id, name, public) -values ('cv-assets', 'cv-assets', true) -on conflict (id) do nothing; - -create policy "Public read cv-assets" - on storage.objects for select - to anon, authenticated - using (bucket_id = 'cv-assets');