Commit Graph
187 Commits
Author SHA1 Message Date
Parsa Aghayi aae13b259c fix(ui): enable tailwind class darkMode, fix navbar contrast, sync language switcher with URL, and add 7 blog category images
Deploy Frontend / deploy (push) Successful in 1m14s
2026-11-02 07:47:39 +00:00
Parsa Aghayi 8d91da7677 fix(website): fix audit bugs, SVG inline headers, contact localization, and clean scripts
Deploy Frontend / deploy (push) Successful in 6m33s
2026-11-02 06:53:45 +00:00
Parsa Aghayi 98c43c4b30 Fix Persian OG image letter joining and reading order
Deploy Frontend / deploy (push) Successful in 1m13s
The OG renderer resolves glyphs through the font cmap alone: satori emits an
SVG <font> and plain <text>, so no shaping engine and no bidi implementation
run. Persian titles were painted in logical order with every letter in its
isolated shape, which made them look scattered and mirrored.

Shaping is now derived from the shipped Vazirmatn font rather than guessed
from the Unicode block, and the presentation forms are joined per position.
Lines are broken here as well, in logical order, and each line is reordered
through the bidi algorithm before it is handed over, so a wrapped title keeps
its reading order instead of being filled from the wrong end.
2026-10-04 06:47:22 +00:00
Parsa Aghayi cb134b1cf1 Fix Persian OG image shaping, add category/tag social images, fix project category tabs
Deploy Frontend / deploy (push) Successful in 1m2s
2026-10-04 05:32:23 +00:00
Parsa Aghayi abfcd87668 Improve newsletter validation messages (show backend errors, clearer email validation)
Deploy Frontend / deploy (push) Successful in 1m5s
2026-10-03 12:35:50 -04:00
Parsa Aghayi 7606237c5c Newsletter subscribe modal, Persian OG image shaping, Jalali dates, all-posts page, fresh view/like counts and responsive pagination
Deploy Frontend / deploy (push) Successful in 1m13s
2026-10-03 08:31:17 -04:00
Parsa Aghayi ea0401b1ff Functional like/view counters and comment section on blog posts
Deploy Frontend / deploy (push) Successful in 1m7s
- PostStats: optimistic like toggle (localStorage per post) and one view per
  browser session (sessionStorage) against the new public endpoints
- CommentSection: lists approved reader comments, submits new ones into
  moderation with a pending-confirmation state
- Both wired into the single-post page sidebar and after the prev/next cards;
  new en/fa dictionary labels
2026-10-02 11:13:31 -04:00
Parsa Aghayi 2d2371da9d Richer blog reading experience: TOC, reading time, share, prev/next, newsletter CTA
Deploy Frontend / deploy (push) Successful in 1m8s
- Single post: sticky table of contents from h2 headings (anchored ids),
  estimated reading time badge, working share buttons (X/LinkedIn/Telegram/
  copy link), and same-language previous/next navigation cards
- Home: featured hero gains tag chips, reading time and a read CTA; new
  newsletter subscribe band linking to the site's contact address
- Both en/fa dictionaries updated for the new UI labels
2026-10-02 09:49:36 -04:00
Parsa Aghayi 2ef4d41588 Blog is language-locked: locale-aware API queries and twin redirects
Deploy Frontend / deploy (push) Successful in 1m10s
- Every blog list fetch (homepage, new/popular/search, categories, posts, tags) sends the active locale as lang to the API, so only that language's content renders
- Post, category and tag detail pages redirect to the mirrored twin slug when the URL language does not match the selected locale, so shared links always open in the viewer's language
- Fix home card links that used category.name as the URL slug instead of category.slug
- Add slugForLocale/isFaSlug helpers in lib/functions/utils
2026-10-02 08:31:05 -04:00
Parsa Aghayi 32a7481ef6 Complete SEO metadata, JSON-LD, real tag/projects pages, OG fallback fixes
Deploy Frontend / deploy (push) Successful in 1m11s
2026-10-02 06:48:55 -04:00
Parsa Aghayi 88703ae4ea Harden mobile menu backgrounds with inline styles, wire real social links, drop contact helper text
Deploy Frontend / deploy (push) Successful in 1m6s
2026-10-02 06:26:01 -04:00
Parsa Aghayi 06c776a604 Fix mobile menu backdrop, send contact form to backend, add messages inbox
Deploy Frontend / deploy (push) Successful in 1m9s
The mobile menu overlays were only 20% opaque and sat below the fixed
header, so after scrolling, page text bled through and made menu items
unreadable. Make the backdrop a dark blurred veil and raise the drawer
above the header on both the website and blog menus.

Replace the mailto-only contact form (which contained a placeholder
caveat) with a form that POSTs to the new /api/contact endpoint, keeps
client-side validation, and shows success/error states.

Add an admin messages inbox at /admin/contact-messages with read/unread
toggling and delete, plus a nav link and a dashboard card.

Swap the lorem ipsum testimonials for real client feedback in both
dictionaries.
2026-10-02 05:41:17 -04:00
Parsa Aghayi 696e36bcc8 Let the admin panel upload its own images
Deploy Frontend / deploy (push) Successful in 13s
Typing a URL into the featured-image box meant the panel could only ever
reference images uploaded by hand, so every content change needed an SFTP
round trip. Image fields now get a uploader that posts straight to the
media endpoint, while the plain URL box stays: plenty of images still live
on another host, and pasting a URL should keep working.

The upload is a Server Action rather than a client fetch because the admin
token lives in an httpOnly cookie. adminUpload cannot reuse adminFetch —
that helper always JSON-stringifies the body and pins a JSON Content-Type,
and a hand-written Content-Type on multipart drops the boundary, which
leaves $_FILES empty and turns every upload into a 422.

The value reaches the existing saveResourceAction through the named text
input, which the uploader writes to; the file input itself is left unnamed
so a 4 MB image is never re-sent inside the save request. Removing an
image only clears the field, because the old URL may already be in use by
another row — deleteMediaAction is the separate, deliberate path.

Server Actions default to a 1 MB body, so next.config.mjs now allows 8 MB.
That is the Next-side half only: PHP's upload_max_filesize and post_max_size
have to be at least as large on the API host or it discards the file before
validation ever runs.

Also adds /feed.xml. The blog had a sitemap but no feed, so it was not
readable in any reader.
2026-10-01 19:00:51 -04:00
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 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 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
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 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 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
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 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
parsa aghaei 3a0c5746b7 1.4-1.6: add rewrites, remove BFF handlers, update client to use relative URLs 2026-06-23 18:20:01 +03:30
parsa aghaei 99d56e3bfe about me image updated 2024-11-20 17:23:22 +03:30
parsa aghaei 4a0a8d08d5 build error fixed 2024-11-20 16:51:47 +03:30
parsa aghaei 809cb7378f download resume loading bug fixed 2024-11-20 16:43:46 +03:30
parsa aghaei 0dccf4b734 projects images updated 2024-11-20 16:38:40 +03:30
parsa aghaei 2d1533589c filtered-post page mobile view debugged 2024-11-18 16:20:21 +03:30
parsa aghaei 6e32d9b8fd home page mobile biew debugged 2024-11-18 16:16:13 +03:30
parsa aghaei 40b8b6539a blog mobile header button style debugged 2024-11-18 16:03:31 +03:30
parsa aghaei 0ce625022a loading progressbar added to mobile menu 2024-11-18 15:39:35 +03:30
parsa aghaei efb8dcd60c loading progressbar added 2024-11-18 15:33:20 +03:30
parsa aghaei eef5690a4a home page for mobile view updated 2024-11-16 17:54:38 +03:30