18 Commits
Author SHA1 Message Date
MOH 0a5f77d8de REFACTORED - migrate the data layer from Prisma to Drizzle (unify the stack)
- Add lib/db (Drizzle schema: 7 tables + 6 enums + relations, postgres.js client),
  drizzle.config.ts, lib/db/enums.ts (Prisma-compatible enum objects)
- Rewrite all 14 app consumers + 4 admin components to Drizzle
- Move the test DB layer to Drizzle + in-process PGlite; convert all 8 integration
  test files + factories (371 tests green)
- Remove Prisma: deps, prisma/ schema+migrations, lib/prisma.ts, Dockerfile prisma
  generate; wire db:generate/migrate/push/studio to drizzle-kit; update Makefile
- Preserve the old seed as scripts/legacy-prisma-seed.cjs (needs a Drizzle rewrite)
2026-08-07 14:18:41 +02:00
MOH 9c40d9030f FIXED - build type errors (vitest fileParallelism placement, NODE_ENV assignment) 2026-08-06 20:03:27 +02:00
Moh e2e06be86e test: add comprehensive automated test coverage
- Vitest multi-project setup (unit / integration / component)
- Real-Postgres integration harness via in-process PGlite (TEST_DATABASE_URL
  override), migrations applied per worker; production code untouched
- Unit: routing, locale, validation/Zod schemas, metadata, mail, site-theme,
  marquee, media, portfolio helpers, plus architecture-rule tests
- Integration: Prisma data layer, API routes, and all server actions
- Component: UI primitives and form components (jsdom + Testing Library)
- 371 tests passing
2026-08-06 02:27:20 +02:00
MohFarawati d48497b992 refactor: drop toast + over-engineered extras, add inline admin feedback
CI / quality (push) Waiting to run
Phase 1 cleanup of the personal-site revamp. Backend/architecture untouched;
changes are limited to removing unused complexity and restoring feedback.

Removals
- Toast system: delete react-hot-toast, Toaster, QueryToastBridge, lib/toast,
  the toggle/easter-egg calls, related i18n keys and the dependency.
- Contact protection: remove Turnstile + per-IP rate limiting
  (lib/contact-guard, lib/contact-protection, admin screen, form widget,
  app-config wiring, nav entry, test).
- Speculative specs: delete orders, products, downloads, project-inquiry.

Inline feedback (replaces toast, no new deps)
- Add lib/admin-feedback (withFlash/readFlash) and components/admin/admin-flash,
  rendered centrally by AdminDashboardShell.
- Emit success/error messages for media, site-settings, portfolio, smtp,
  marquee and maintenance actions; pages read them via searchParams.
- Contact form shows validation/delivery errors inline; success still
  redirects to /success.

Docs
- Fix stale paths in frontend-system-* (components/root -> components/admin,
  lib/root-navigation -> lib/admin-navigation, drop phantom src/) and remove
  contact-protection references from docs and CLAUDE.md.
- Add docs/PHASE0_DIAGNOSIS.md (diagnosis report).

Note: proxy.ts self-fetch kept intentionally; it also drives maintenance mode.
2026-07-14 21:03:51 +02:00
MOHandClaude Sonnet 4.6 f490133345 Harden security, fix rate-limiting, and rename proxy
CI / quality (push) Has been cancelled
- Move admin login lockout from client cookie to AppConfig (DB), keyed
  by hashed client IP — clearing browser cookies no longer bypasses it
- Replace rate-limit $transaction (TOCTOU) with atomic SQL
  INSERT...ON CONFLICT...RETURNING; add stale-entry cleanup on each
  submission to prevent table bloat
- Add 5 s module-level cache for middleware runtime state fetch, reducing
  per-request DB roundtrips
- Rename middleware.ts → proxy.ts to resolve Next.js 16 deprecation
  warning; update test import accordingly
- Require ADMIN_PASSWORD, ADMIN_AUTH_SECRET, ADMIN_BASIC_AUTH_USER, and
  ADMIN_BASIC_AUTH_PASS in docker-compose.yml (:? syntax) — startup
  fails loudly instead of using placeholder defaults
- Add set -e and informative echo lines to Dockerfile CMD for clearer
  startup failure attribution
- Export requireAdminAuth() from lib/admin-auth for centralised use in
  admin pages
- Add CLAUDE.md with architecture notes and working rules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:05:50 +01:00
MOH 635d54cb0e Use internal origin for runtime locale state
CI / quality (push) Waiting to run
2026-03-15 08:33:27 +01:00
MOH c18128c965 Fix runtime default locale resolution
CI / quality (push) Waiting to run
2026-03-15 06:02:27 +01:00
MOH 27df4ad2fe Unify dynamic locale routing
CI / quality (push) Waiting to run
2026-03-15 05:12:33 +01:00
MOH 3eb9238268 moh/admin-portfolio-ux-improvements
CI / quality (push) Waiting to run
2026-03-15 04:42:09 +01:00
MOH 50c3f5cce9 Fix maintenance redirects and admin host detection 2026-03-15 04:33:07 +01:00
MOH 5d3f77962a Add admin site settings sections and locale defaults 2026-03-15 04:06:33 +01:00
MOH 7956b073e9 Refactor portfolio admin and views 2026-03-11 17:46:35 +01:00
MOH 77cc9dca87 Add Sonner-based notifications and UX polish 2026-03-10 17:43:26 +01:00
MOH 5ca4819bcb Add SMTP admin settings and contact form delivery 2026-03-08 06:27:09 +01:00
MOH 0c2b67e378 Refactor site header, heroes, and design system 2026-03-08 00:29:51 +01:00
MOH cd6ec7fa78 Fix localized SEO template parsing
CI / quality (push) Waiting to run
2026-03-07 18:54:23 +01:00
MOH f259dfc6bd Add SEO settings and root admin save flows
CI / quality (push) Waiting to run
2026-03-07 18:48:01 +01:00
MOH ea64373853 Implement portfolio admin management 2026-03-07 16:06:20 +01:00