13 Commits
Author SHA1 Message Date
Parsa Aghayi 7ba29d290f feat(perf,seo): enable react strict mode, prefetch projects & services on server, and expand vitest coverage
Deploy Frontend / deploy (push) Successful in 1m22s
2026-11-02 13:05:16 +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 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 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
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 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 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 353d842cd1 Add output: standalone for Docker build 2026-06-23 12:36:08 +03:30
parsa aghaei dc11b6c9b3 all menu pages got dynamic 2024-10-13 18:33:43 +03:30
parsa aghaei 3e75cef667 webpack optimized 2024-09-30 12:15:43 +03:30
parsa aghaei 3e757c5481 header is responsive now 2024-09-23 16:31:48 +03:30
parsa aghaei a2926561e5 Initial commit from Create Next App 2024-09-15 10:08:29 +03:30