Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/production-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Production gate

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: npm ci --ignore-scripts
- run: pip install playwright==1.64.1
- run: python -m playwright install --with-deps chromium
- run: npm run qa
- run: npm run qa:studio:browser
- run: npm run qa:ssr:browser
- run: npm run build
env:
SUPABASE_URL: https://ci-placeholder.supabase.co
SUPABASE_PUBLISHABLE_KEY: sb_publishable_ci_placeholder_not_a_secret
SITE_URL: https://example.invalid
- run: npm run verify:dist
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
node_modules/
dist/
.vercel/
.env
.env.*
!.env.example
dist/
.vercel/
.DS_Store
*.log
*.bak
playwright-report/
test-results/
41 changes: 41 additions & 0 deletions DEPLOY-PREVIEW-WINDOWS.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@echo off
setlocal
cd /d "%~dp0"

echo =========================================
echo German Library v3.2.1 - Vercel PREVIEW
echo =========================================
echo This deploys a PREVIEW only, not production.
echo No Supabase database migrations are executed.
echo.

where node >nul 2>&1
if errorlevel 1 (
echo ERROR: Node.js 20+ is required. Install it from nodejs.org first.
pause
exit /b 1
)

echo Linking to your existing Vercel project german-library...
call npx --yes vercel@latest link --yes --project german-library --scope iktx420cyber-9788
if errorlevel 1 (
echo.
echo If you are not signed in, run: npx vercel@latest login
echo Then run this script again.
pause
exit /b 1
)

echo Deploying this extracted v3.2.1 folder to Preview...
call npx --yes vercel@latest deploy --yes
if errorlevel 1 (
echo.
echo Deployment failed. Check the error above. Existing production remains unchanged.
pause
exit /b 1
)

echo.
echo Deployment command succeeded. Check the deployment URL and test it.
echo Do NOT promote until required Supabase migrations and live security checks pass.
pause
32 changes: 32 additions & 0 deletions DEPLOY-STATUS-FA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# German Library v3.2.1 — راهنمای انتشار امن

## وضعیت در تاریخ ۱۸ اکتبر ۲۰۲۶

- سورس این بسته: **v3.2.1-p0-preview**.
- QA محلی: تمامی تست‌های `npm run qa` موفق شدند.
- Build و `verify:dist`: با کلید **ساختگی مخصوص تست** موفق شدند. **هیچ کلید واقعی داخل ZIP قرار ندارد.**
- GitHub `cianium/German-Library` در زمان بررسی روی نسخه **7.1.1** بود، نه v3.2.1. انتشار GitHub main بدون آپدیت سورس، نسخه جدید را منتشر نمی‌کند.
- پروژه موجود در Vercel: `german-library` با آدرس `https://german-library.vercel.app` و متغیرهای `SUPABASE_URL`, `SUPABASE_PUBLISHABLE_KEY` و `SITE_URL`.
- Supabase `German Library`: چهار Migration نسخه 7.1.1 ثبت شده بودند، و در public جدول‌های `profiles`, `levels`, `courses`, `resources` وجود داشتند. **Migrationهای v3/vNext/P0 هنوز ثبت نشده‌اند.**
- اتصال‌های مستقیم ابزار از این محیط نمی‌توانند پوشه آپلودی روی دیسک محلی را به Vercel منتقل کنند؛ از این رو هیچ Deploy جدیدی در این بررسی ثبت نشده است.

## نصب و انتشار Preview با لپ‌تاپ Windows

1. این ZIP را **Extract All** کنید؛ از اجرای مستقیم فایل CMD داخل ZIP خودداری کنید.
2. Node.js نسخه 20 یا جدیدتر را نصب داشته باشید.
3. `DEPLOY-PREVIEW-WINDOWS.cmd` را اجرا کنید. درصورت درخواست ورود، در Terminal دستور `npx vercel@latest login` را اجرا کنید و دوباره روی فایل کلیک کنید.
4. اسکریپت به پروژه موجود `german-library` لینک می‌شود و نسخه جاری را به **Preview** می‌فرستد؛ نسخه Production و آدرس اصلی سایت را تغییر نمی‌دهد.
5. URL چاپ‌شده در Terminal را باز کنید. صفحات عمومی و منوی موبایل را تست کنید. **صفحات SSR مقالات ممکن است تا تکمیل Schema دیتابیس 503 شوند.**
6. برای تکمیل Article Studio باید طبق README و `docs/P0_SECURITY_AND_NAV_REPORT_FA.md` ابتدا محیط Development/Staging دیتابیس را آماده کنید: Migrationهای قبلی، `20261014_vnext_articles.sql` و سپس `20261015_p0_article_source_read_access.sql`؛ سپس Validation و تست واقعی نقش‌ها انجام شود.
7. **فقط بعد از تأیید کامل Staging**، تغییرات و Migrationها را با پشتیبان و برنامه بازگشت به Production ببرید و سپس همان پوشه تأییدشده را با `npx vercel@latest deploy --prod` منتشر کنید.

## بررسی‌های امنیتی قبل از Production

- اجرای `backend/validation/vnext_articles_check.sql` و `backend/validation/p0_article_access_check.sql`.
- تست واقعی دسترسی مقاله با Guest، Learner، Author صاحب/غیرصاحب و Editor.
- بازبینی دسترسی گسترده Author به منابع مشترک و فایل‌های `resource-files`.
- بازبینی Supabase Security Advisor و سیاست‌های Storage.
- بررسی `SUPABASE_URL` و `SUPABASE_PUBLISHABLE_KEY` واقعی در پروژه Vercel (هرگز Service Role یا Secret Key را در Frontend قرار ندهید).
- تست Autosave، ارسال برای بازبینی، انتشار، خواندن SSR، Sitemap و مسیرهای ناوبری.

این فایل گزارش وضعیت است، نه ادعای انجام انتشار آنلاین.
14 changes: 14 additions & 0 deletions MOBILE_V3_3_CHANGELOG_FA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Lexipfad v3.3 — Mobile Navigation Preview

- Floating Glass Bottom Navigation: پنج مقصد خانه، سطوح، کتابخانه، رسانه، مقالات.
- هماهنگی ناوبری HTML و مقالات SSR بدون تغییر در سیاست‌های Supabase.
- رعایت Safe Area، حالت روشن/تاریک، Reduced Transparency، Focus و اندازه لمس.
- حفظ رفتار موجود پنل مدیریت؛ نوار مدیریت استایل یکسان می‌گیرد.
- حالت نوشتن مقاله: هنگام تمرکز روی ادیتور، نوار پایین پنهان می‌شود.
- رفع لینک تکراری مقالات در منوی SSR و حذف قانون قدیمی چهارستونی.
- Header عمومی یکدست برای Search و Account، همراه با رفتار Keyboard در موبایل.
- Author Studio: ناوبری اختصاصی، Focus Mode، Save/Preview dock و Visual Viewport handling.
- Admin Studio: دسترسی مستقیم به مقاله‌ها، شمار واقعی صف بررسی و focus isolation در editor.
- Browser QA واقعی در عرض‌های 320/390/768/1024 برای Article Studio و SSR Navigation پاس شد.

این نسخه فقط پیش‌نمایش است؛ هیچ migration یا تغییر Production اعمال نشده است. تایید RLS و E2E زنده پیش از انتشار ضروری است.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
**Lexipfad — a mobile-first German learning path and resource library for CEFR A1–C2.**

[![Source QA and Build](https://github.com/cianium/German-Library/actions/workflows/ci.yml/badge.svg)](https://github.com/cianium/German-Library/actions/workflows/ci.yml)
![Status](https://img.shields.io/badge/Status-Development%20Preview-E5A50A)
![Version](https://img.shields.io/badge/Source-3.2.1--p0--preview-147D8B)
![Status](https://img.shields.io/badge/Status-Production%20Candidate-E5A50A)
![Version](https://img.shields.io/badge/Source-3.3.0--production--candidate-147D8B)

**Books & learning resources · Articles · Content management · Multi-device experience**

</div>

> **Release status:** This repository is currently a **source/preview build**, not a verified production release. The P0 article-access SQL patch exists in source, but its application to any real Supabase database and live role-based access verification are **not confirmed**. Do not use a passing CI run as evidence that deployed database permissions are secure.
> **Release status:** v3.3 is a tested **production candidate**. Source QA, security regression tests, build/dist checks, and Chromium suites pass locally. Live Supabase migration validation and Vercel preview/production verification remain separate release gates and are recorded during rollout.

## What this project does

German Library helps German learners find curated learning materials by **CEFR level (A1–C2)**, book category, and learning objective. The codebase includes a browser-first catalog, content-management interfaces, an article authoring workflow, and Vercel server-rendered article endpoints.
Lexipfad helps German learners find curated learning materials by **CEFR level (A1–C2)**, book category, and learning objective. The codebase includes a browser-first catalog, content-management interfaces, an article authoring workflow, and Vercel server-rendered article endpoints.

| Area | Included in source | Important boundary |
| :--- | :--- | :--- |
Expand All @@ -33,12 +33,12 @@ German Library helps German learners find curated learning materials by **CEFR l
- **Frontend:** HTML, CSS and JavaScript (mobile-first).
- **Server-rendered articles:** Vercel Functions and server-side navigation.
- **Backend services (when configured):** Supabase Auth, PostgreSQL/RLS and private Storage.
- **Build and QA:** Node.js (20+) and Python 3.
- **Build and QA:** Node.js 22+ and Python 3.
- **Deployment configuration:** `vercel.json`, with a separate static GitHub Pages deployment history.

## Run locally (source preview)

Requirements: Node.js 20+ and Python 3.
Requirements: Node.js 22+ and Python 3.

```bash
git clone https://github.com/cianium/German-Library.git
Expand Down Expand Up @@ -112,7 +112,7 @@ Do not apply a patch blindly to Production. Back up data, check migration histor

## Versioning and historical releases

The current `package.json` source version is **`3.2.1-p0-preview`**. GitHub also contains an older release **titled `v7.1.1` with tag `v1.1.1`**. Those identifiers refer to different versioning contexts; the old tag must not be silently moved or rewritten.
The current `package.json` source version is **`3.3.0-production-candidate`**. The immediate pre-v3.3 snapshot is preserved as GitHub release/tag **`v3.2.1-p0-preview`**. Older historical tags are not moved or rewritten.

Read the [Changelog](CHANGELOG.md) and [GitHub Releases and publishing policy](docs/RELEASES.md). A CI-green badge does **not** mean the project is production-ready.

Expand Down
11 changes: 6 additions & 5 deletions RELEASE_MANIFEST.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
German Library v3.2.1-p0-preview
Based on: v3.2.0 Mobile Article Studio Preview (derived from V7.4)
Source-only P0 patch; not deployed
Mandatory after vNext article migration: backend/migrations/20261015_p0_article_source_read_access.sql
Live RLS/role test pending; see docs/P0_SECURITY_AND_NAV_REPORT_FA.md
Lexipfad v3.3.0 production candidate
Based on: v3.2.1 P0 source preview (derived from V7.4)
Mobile navigation, Author/Admin workspaces, API and supply-chain hardening
Latest migration: backend/migrations/20261028_v33_production_hardening.sql
Supabase v33 migration validated live; Vercel environment synchronized
Role-matrix and public-production HTTP verification remain rollout gates
9 changes: 7 additions & 2 deletions _headers
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
X-Frame-Options: DENY
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=()
Strict-Transport-Security: max-age=31536000
Strict-Transport-Security: max-age=63072000; includeSubDomains
Cross-Origin-Opener-Policy: same-origin
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self'; img-src 'self' data: https:; media-src 'self' blob: https:; connect-src 'self' https://*.supabase.co wss://*.supabase.co; font-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests
X-DNS-Prefetch-Control: off
X-Permitted-Cross-Domain-Policies: none
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data: https:; media-src 'self' blob: https:; connect-src 'self' https://*.supabase.co wss://*.supabase.co; font-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; manifest-src 'self'; worker-src 'self' blob:; upgrade-insecure-requests

/*.html
Cache-Control: public, max-age=0, must-revalidate
Expand All @@ -18,3 +20,6 @@

/assets/runtime-config.js
Cache-Control: no-store, max-age=0

/assets/vendor/*
Cache-Control: public, max-age=31536000, immutable
Loading
Loading