Commit Graph
215 Commits
Author SHA1 Message Date
root 68b0bf4b91 Fix the locale bug and the shared-metadata race behind the lint errors
services.tsx fetched /api/website/services/undefined, because the locale
cookie was read with a check that is false for the empty string and then fell
through unguarded. The endpoint is /api/website/services/{locale}. It also
ignored response.ok and assumed a payload shape, so a failing API threw. All
three are covered by a new regression test; the suite was 2 failures before
and passes 10/10 now.

The filtered-posts page rewrote fields of an exported module-level `metadata`
object during render. That object is a singleton shared by every request in the
process, so concurrent visits to different filters could serve each other's
title, description and OG image, and Next reads the export at build time so the
runtime writes were largely discarded anyway. Values now live in an immutable
record and generateMetadata returns a fresh object per request.

Also replaces set-state-in-effect locale reads with a useSyncExternalStore hook
over the cookie store, derives the active project category instead of storing
it in state (so it self-heals when the data or locale changes), makes the
"random" not-found picks stable per path instead of Math.random() during
render, and tightens a few `any` types.

eslint goes from 36 errors to 0, tsc stays clean.
2026-10-01 17:15:12 -04:00
root 80b3be48ea Stop next/image from 400-ing every SVG in the site
The logo, the burger button and the social icons are SVGs, and the image
optimizer refuses SVG by default, so each of those requests answered 400 and
the images silently never appeared.

Allow SVG on the optimiser together with the restrictive CSP the image
endpoint then requires (script-src 'none'; sandbox), so an SVG served from
_next/image cannot carry script. Verified: all three paths now return 200
with that CSP on the response.
2026-10-01 17:15:12 -04:00
root 6a56b27b01 Add security headers and make the contact form actually submit
The contact section collected input and discarded it on submit.

There is no backend contact endpoint and no mail provider, so the form opens
the visitor's mail client with a prefilled Persian subject and body. Validation
is client-side with inline Persian errors, an accessible alert summary, and
focus moved to the first invalid field; a persistent hint states up front that
nothing is stored on the server and shows the address to copy if no mail
client is registered.

Also add the response headers the site was missing: HSTS, nosniff, frame
denial, a strict referrer policy, a restrictive permissions policy, and a CSP.
The CSP still needs 'unsafe-inline' for scripts because nonces are not
implemented yet; that is the next hardening step. poweredByHeader is off so
the framework is not advertised.
2026-10-01 16:33:20 -04:00
root cc7a5f2b7c Make the site crawlable and describe itself properly
public/robots.txt was "Disallow: /", which told every crawler to ignore the
entire site. It now allows crawling, keeps /admin and the API paths out of the
index, and points at the sitemap.

Add a generated sitemap covering the static routes plus every post and
category. The API caps per_page at 50, so it follows meta.last_page instead of
asking for more, and every fetch is wrapped so an unreachable API degrades to
the static entries rather than taking the site down.

Replace the placeholder layout metadata with real Persian titles, description,
keywords, canonical URL, hreflang alternates, OpenGraph and Twitter cards, and
add Person/WebSite JSON-LD.
2026-10-01 16:33:19 -04:00
root a3cce41d1e Normalise about-me data before rendering
NULL title/description and an empty skills list reached the components as-is.
Normalising once in aboutMeData.ts keeps the presentational components free of
undefined checks, and wraps the fetch so a failing API degrades to a skeleton
instead of an unhandled error.
2026-10-01 16:33:12 -04:00
root 546ee8cc22 Render the real post body instead of a hardcoded article
The blog post page ignored the API entirely and rendered a hardcoded
placeholder article, so every published post showed the same invented content
regardless of what was stored in the database. Metadata (author, category,
date, tags, counts) came from placeholders too.

post.body is plain text written from the admin panel, so parse it into
paragraphs, h1/h2 headings and lists and render the pieces as text nodes.
dangerouslySetInnerHTML is deliberately not used: there is no sanitiser in
this app, so injecting author-supplied HTML would be an XSS hole.

The body falls back to the excerpt, then to an empty-state message. The cover
image now renders only when featured_image holds a real URL; the seeded rows
point at via.placeholder.com, so they render nothing rather than a broken or
third-party image.

Also guard the about-me section: title and description are NULL in the live
database, so it now falls back to Persian text, omits the skills grid when
there are none, and degrades to a skeleton if the API fails instead of
crashing.
2026-10-01 16:33:12 -04:00
root 2b7eda656a Add the admin panel for managing site content
Server-rendered CMS at /admin, reachable only with an authenticated admin.
There was no way to change anything on the site without a database session,
while every mutating endpoint used to be anonymous, so the site was either
unmanageable or, before the API lock-down, wide open.

Everything runs through Server Actions, so the httpOnly
parsaaghayi_admin_session cookie set by the backend is read server-side and
forwarded as a bearer token. No token ever reaches client JavaScript and the
browser never talks to the backend cross-origin, so CORS and CSRF do not
apply. Unauthenticated visits to any panel route redirect to /admin/login.

Resources are declared once in a registry (src/app/lib/admin/resources.ts)
and the list, create and edit screens are generated from it, so adding a
content type is a data change rather than three new pages. Covered: posts,
categories, tags, projects, about-me.

Records are read from GET /api/admin/resources/{resource}, which returns
stored rows including every locale; the public endpoints only expose
translated display payloads and cannot populate an editing form.

Verified: tsc --noEmit clean, eslint clean, next build compiles and registers
all five admin routes as dynamic, and /admin, /admin/posts redirect 307 to
/admin/login while /admin/login renders.

Post bodies are rendered as text nodes, never as HTML.
2026-10-01 16:01:40 -04:00
parsa aghaei 76cf4da118 chore: force repo size recalculation
Deploy Frontend / deploy (push) Failing after 5m3s
2026-07-12 14:14:49 +03:30
parsa aghaei 228e8e9740 chore: remove Iranian mirror from CI workflow - use official Alpine repos
Deploy Frontend / deploy (push) Failing after 1m7s
2026-07-12 13:35:39 +03:30
parsa aghaei 7bf8321392 chore: remove committed node_modules from git
- Remove node_modules/ from git tracking
- Uncomment /node_modules in .gitignore
- Dependencies will be installed via CI/CD with VPN + Nexus cache
2026-07-12 13:29:58 +03:30
parsa aghaei dc529ffa4e fix: testimonials layout - fix card width/gap alignment, remove overflow-visible, adjust quote icon size 2026-06-29 14:47:48 +03:30
parsa aghaei 4ed83bbecf fix: project images not loading - use getCleanImgSrc for grid cards + fix URL path extraction 2026-06-29 14:00:22 +03:30
parsa aghaei 056f838172 fix: testimonial arrow layout/direction logic, language switcher fonts, getCleanImgSrc sanitizer 2026-06-29 13:45:40 +03:30
parsa aghaei 4f5cfc9f1e fix: locale sync in header/testimonials, dark mode icon CSS filters, invariant arrow logic 2026-06-29 11:19:21 +03:30
parsa aghaei a91adaff28 fix: testimonials card width + text wrapping, modal scroll structure, local image paths 2026-06-29 11:14:43 +03:30
parsa aghaei 8666d8067a fix: precise fixes - name spelling, nav i18n, header scroll logic, testimonials padding, Persian digits 2026-06-29 10:53:26 +03:30
parsa aghaei 79c229a93c fix: UI/UX regressions - header glassmorphic, dark mode icons, testimonials i18n, image remotePatterns 2026-06-29 09:57:51 +03:30
parsa aghaei 7dc79b3151 fix: sticky header blur on scroll, testimonials carousel 6 items + RTL arrows, project modal dual-column, smooth scroll, hero btn no-wrap 2026-06-29 09:32:40 +03:30
parsa aghaei dfedd18f66 images updated 2026-06-29 09:21:46 +03:30
parsa aghaei 470036d6b9 fix: hero button localization/hover, lang switcher dark mode, services grid, testimonials carousel, project modal, footer gap, back-to-top 2026-06-29 08:58:26 +03:30
DevOps 9797b71f55 test: retrigger frontend CI/CD after CRLF fix 2026-06-29 05:09:25 +00:00
parsa aghaei 4a973547c1 fix: replace pink accent with orange, fix RTL overlap, improve contrast and typography 2026-06-28 22:07:02 +03:30
DevOps 8c2c63904a test: trigger frontend CI/CD pipeline 2026-06-28 18:16:17 +00:00
DevOps 19c557a154 fix: add id field to Project interface to resolve TS error 2026-06-28 17:25:03 +00:00
DevOps 34243ff641 fix: resolve TS error in AboutMeContent - add CategoryKey type assertion for dynamic category access 2026-06-28 17:22:18 +00:00
DevOps 9f06b1aa4c retry: trigger deploy (DNS transient fix) 2026-06-28 17:18:59 +00:00
DevOps 88be19c5a5 fix: restore template literal backticks in layout.tsx className 2026-06-28 17:17:42 +00:00
DevOps be6e37b11f fix: self-host Google Fonts (Inter, JetBrains Mono) via localFont; fix tailwind border-border color 2026-06-28 17:15:13 +00:00
parsa aghaei adda6ae880 content: update hero and about me copy to professional senior engineer tone 2026-06-28 20:20:29 +03:30
parsa aghaei 83b5a2f22a style: implement dark theme, glassmorphism, and framer-motion architecture; chore: update seeders with professional copywriting for EN and FA languages 2026-06-28 20:20:29 +03:30
DevOps c145467405 test: trigger frontend CI/CD 2026-06-28 15:45:32 +00:00
parsa aghaei 76046331fc fix: add @next/swc-linux-x64-{gnu,musl} native binaries for offline Docker build 2026-06-28 19:00:17 +03:30
DevOps 412b7383c7 cleanup: remove trigger file 2026-06-28 15:10:02 +00:00
parsa aghaei 5532e9e3d9 feat: commit node_modules for offline CI/CD; skip npm ci, just npm run build 2026-06-28 17:41:24 +03:30
DevOps f013e4e883 test: trigger frontend CI/CD with offline build 2026-06-28 13:54:05 +00:00
DevOps e7fc2ae5b7 chore: commit node_modules for offline build 2026-06-28 13:52:33 +00:00
parsa aghaei 6a8d7053dc package-lock updated 2026-06-28 11:43:22 +03:30
parsa aghaei 7533f8c97c upgrade: Next.js 16 + React 19, codemod transforms (async APIs, middleware→proxy, ESLint flat config) 2026-06-28 11:41:00 +03:30
parsa aghaei c496863180 trigger ci 2026-06-28 11:11:37 +03:30
parsa aghaei ee8607ffc2 trigger ci 2026-06-27 14:07:32 +03:30
parsa aghaei 9cf11a0e49 fix: use arvancloud Alpine mirror (Liara returns 500), remove unused proxy 2026-06-27 11:38:21 +03:30
parsa aghaei 6d3e6d18a1 fix: revert Alpine mirror to Liara (CI containers cant reach Nexus) 2026-06-27 11:32:20 +03:30
parsa aghaei 77a5505b38 chore: trigger CI test 2026-06-27 11:22:55 +03:30
parsa aghaei 48efbe3d90 Switch Alpine mirror to Nexus proxy registry.parsaaghayi.ir 2026-06-27 11:00:46 +03:30
parsa aghaei c71a8d09cc fix deploy: revert to Liara mirror + add http proxy 172.17.0.1:3001 2026-06-27 09:51:46 +03:30
parsa aghaei 6f6354b714 fix deploy: use default package manager repos instead of broken mirror 2026-06-27 09:41:17 +03:30
parsa aghaei 8e0655ef60 test: trigger CI/CD pipeline 2026-06-23 19:39:30 +03:30
parsa aghaei 157e47521d fix: add vitest, testing-library, jsdom, vite-plugin-react to devDependencies 2026-06-23 19:33:31 +03:30
parsa aghaei a60c403d24 5.1-5.10: remove dead code/commented types; strict already on, no barrel files 2026-06-23 19:20:26 +03:30
parsa aghaei fcb7db4d06 4.4-4.7: set up vitest, react-testing-library, cypress; add component/E2E tests 2026-06-23 18:42:40 +03:30