Commit Graph
90 Commits
Author SHA1 Message Date
Parsa Aghayi 5fb68a4464 feat(blog): ensure RealBlogContentSeeder runs reliably on boot when new articles are detected
Deploy Backend / deploy (push) Successful in 46s
2026-11-02 16:57:00 +00:00
Parsa Aghayi 27231a091e ci(deploy): run RealBlogContentSeeder automatically during deploy pipeline
Deploy Backend / deploy (push) Successful in 46s
2026-11-02 16:53:16 +00:00
Parsa Aghayi 39919e82a7 feat(blog): publish comprehensive battle-tested Git engineering article
Deploy Backend / deploy (push) Successful in 49s
2026-11-02 16:52:05 +00:00
Parsa Aghayi cb844d2ee7 fix(blog): serialize resource collections cleanly before caching in HomeController
Deploy Backend / deploy (push) Successful in 47s
2026-11-02 13:25:46 +00:00
Parsa Aghayi accf0b6aab fix(backend): harden sanctum auth, remove dead models, add composite indexes and optimize homepage queries
Deploy Backend / deploy (push) Successful in 48s
2026-11-02 13:00:24 +00:00
Parsa Aghayi 5e6647d812 feat(projects): add description to API response and update seeders with real portfolio projects
Deploy Backend / deploy (push) Successful in 1m17s
2026-11-02 11:39:20 +00:00
Parsa Production Ops 3fb1e417c6 fix(ops): reconcile CI backend wrapper and gate locked dependency image before swap
Deploy Backend / deploy (push) Successful in 1m17s
2026-10-26 05:52:27 +00:00
Parsa Aghayi c2960c4ed0 Filter projects by category id and expose category_id
Deploy Backend / deploy (push) Successful in 2m44s
2026-10-04 05:32:23 +00:00
Parsa Aghayi eacd0d73f1 Add newsletter subscription endpoint (email/mobile) plus admin CSV export
Deploy Backend / deploy (push) Successful in 2m50s
2026-10-03 08:31:17 -04:00
Parsa Aghayi e98807da05 Add post comments with moderation plus view/like interaction endpoints
Deploy Backend / deploy (push) Successful in 2m41s
- blog_comments table + Comment model/factory; comments attach to the post,
  public list shows approved rows only, public submission starts unapproved
- Admin moderation API: list/filter, approve, delete comments
- Public POST posts/{slug}/view and posts/{slug}/like toggle counters
- Route groups: comments throttled like the contact form, interactions at
  60/min; comments resource exposed to the generic admin list
2026-10-02 11:06:06 -04:00
Parsa Aghayi fbacb0c9a1 Expand blog to 36 mirrored posts with deepened sections and page-turn links
Deploy Backend / deploy (push) Successful in 2m35s
- Six new topic pairs (EN+FA): TypeScript advanced patterns, SQL indexes,
  Git branching/reviews, TDD, clean architecture in Laravel, browser page load
- Every existing post gains Key takeaways + FAQ sections in both languages
- New engineering-practices category pair and database/git/testing tag pairs
- Single-post API now returns same-language previous_post/next_post links
2026-10-02 09:34:53 -04:00
Parsa Aghayi d659c5d325 Keep generated blog cover URLs within the featured_image VARCHAR(255) limit
Deploy Backend / deploy (push) Successful in 2m48s
Persian covers are percent-encoded into og-image URLs and several long Persian titles produced URLs over 255 chars, failing the prod seeder with a data-too-long error. Shorten Persian cover text so every featured_image fits the column; guard with a seeder test asserting all 24 images are non-empty and under 256 chars.
2026-10-02 08:46:36 -04:00
Parsa Aghayi 65415beae7 Blog localization: lang-filtered API, strict EN/FA mirrored content, 12 new topics
Deploy Backend / deploy (push) Successful in 2m51s
- Add FilterableByLanguage scope (posts/categories/tags) keyed off the -fa slug convention; every public blog list endpoint honors ?lang=fa|en, feeds/sitemaps keep all languages when omitted
- Homepage (latest/most-viewed/random posts + categories) filters per language; post detail shows same-language related posts only
- Reseed content to a strict English/Persian mirror: 6 existing international topics + 6 new Iran-market topics (technical SEO for Persian sites, Iranian dev freelancing, AI & Iranian dev careers, web design for Iranian businesses, React job market in Iran, WordPress-to-Next migration), 12 posts per language, zero posts in only one language
- Fix 2 legacy FA slugs to follow the EN-slug + -fa convention so twin redirects and mirror assertions hold
- Update seeder test to assert balanced languages, full twin coverage and same-language related posts; add lang-filter coverage
2026-10-02 08:27:20 -04:00
Parsa Aghayi 21fa37af1f Add tag-by-slug posts endpoint for real tag pages
Deploy Backend / deploy (push) Successful in 2m43s
2026-10-02 06:48:53 -04:00
Parsa Aghayi d4f41b9c2e Store contact messages in DB and seed real bilingual blog content
Deploy Backend / deploy (push) Successful in 2m40s
Contact form messages were sent via mailto and the site has no mail
service, so visitors saw a placeholder caveat instead of a working
channel. Add a contact_messages table, a public throttled POST endpoint,
and admin list/mark/delete endpoints, then wire them into the panel.

Replace the faker-generated blog demonstration content with real
English and Persian SEO-oriented articles via RealBlogContentSeeder
(deterministic, bilingual posts with per-language categories and tags,
and cross-linked related posts).
2026-10-02 05:41:05 -04:00
Parsa Aghayi 16057c06b9 ci: verify fresh push triggers deploy
Deploy Backend / deploy (push) Successful in 31s
2026-10-02 05:00:38 -04:00
Parsa Aghayi c397acd8ce Merge remote-tracking branch 'origin/main'
Deploy Backend / deploy (push) Successful in 33s
# Conflicts:
#	routes/api.php
2026-10-02 03:59:05 -04:00
Parsa Aghayi 37f994bec1 Make uploaded images actually reachable in the container
Two things the image upload feature needs at runtime were missing.

public/storage is gitignored, so it never reaches the build context, and
nothing in the image created it. Storage::url() returns .../storage/media/x.jpg,
so nginx 404s every file the admin uploaded even though the upload succeeded
and the URL was stored in the record. storage:link at build time fixes it;
the ln fallback covers artisan refusing to boot without APP_KEY.

PHP's own ceiling was the other half. StoreMediaRequest accepts 4 MB but
upload_max_filesize defaults to 2M, so larger files are discarded before
Laravel validates them and the admin just sees a 422 for a valid image.
Next's Server Action limit was already raised to 8 MB, so 8M keeps the
whole chain consistent. post_max_size must sit above upload_max_filesize
or the extra form fields are dropped along with $_FILES.

The ini directory is resolved at build time rather than hardcoded, and the
effective values are asserted so a silently mislocated ini fails the build.
2026-10-01 19:02:44 -04:00
Parsa Aghayi 99f786265e Let the admin panel manage services, skills and testimonials
These three had read endpoints or nothing at all, so their content could only
be changed by hand in the database. All writes are admin-only and rate
limited like the existing admin routes.

Testimonials are the awkward one: the migration that collapsed the legacy
per-locale tables into JSON columns deliberately skipped them, so they still
live in a child table. Testimonial therefore exposes a translations accessor
to present the same translations[key][locale] shape as Service and Skill,
which is what the generic resource form binds to. Reading the child relation
has to go through getRelation(), since a plain $this->translations inside an
accessor of that name re-enters the accessor and silently yields nulls.

The store requests now mark the NOT NULL columns as required. Leaving them
nullable let a bad payload reach the database and come back as a 500 instead
of a 422, and about_me_id is additionally a cascading foreign key.

Also registers the three resources with the admin read endpoint so the panel
can list them, eager loading the relations their forms need.
2026-10-01 18:19:32 -04:00
Parsa Aghayi 6b03c0fbc3 Add a locked-down image upload endpoint for the admin panel
Posts, projects and about-me all carry an image column that could only ever
be filled by typing a URL by hand, so every featured image in the database is
still a placeholder. Uploads are the missing half of content management.

Filenames are generated rather than reused from the client, which is what
keeps a double extension or a path traversal out of a web-served directory.
The upload surface is restricted to raster formats (no SVG, which can carry
script) with a size and dimension ceiling, and throttled at 12/min against
the general admin API's 30/min because an upload costs far more than a JSON
write.

Routes move to per-feature files registered from bootstrap/app.php, since
api.php had become a chokepoint for parallel work on this repo.
2026-10-01 17:41:49 -04:00
Parsa Aghayi 6f6640330a Keep local agent tooling and the generated knowledge graph out of git 2026-10-01 17:24:36 -04:00
Parsa Aghayi 5ae1d1a632 Eager-load relations the admin read API returns
Edit forms are populated from a single request, so posts need their tags and
projects their category attached; otherwise the tag multi-select and category
picker come back empty.
2026-10-01 16:00:06 -04:00
Parsa Aghayi 3f386c7be8 Add the admin content API the CMS needs
Two gaps blocked building the admin panel:

About-me writes could only set the image. Title and description live in the
JSON translations column and were unreachable from the API, so the homepage
bio could never be edited through the app. Accept title_fa/title_en/
description_fa/description_en on both About Me form requests and write them
per locale through setTranslation().

Editing also needs raw rows. The public project and about-me endpoints only
return display-oriented payloads - one translated title, reshaped image
arrays, no second locale - which is not enough to populate a form. Add
GET /api/admin/resources/{resource} behind the same auth:sanctum + admin
middleware as the write routes, returning stored rows including every locale,
plus a public GET /api/website/project-categories so project forms have a
category picker.

Covered by AdminResourceReadTest: anonymous and non-admin callers are
rejected for every resource, unknown resource names 404, and project rows
expose both locales.
2026-10-01 15:28:23 -04:00
DevOps 7ee8440a65 Expose About Me translations and project categories for the admin panel
Deploy Backend / deploy (push) Waiting to run
About-me writes could only set the image: title and description live in the
JSON translations column and were unreachable from the API, so the homepage
bio could never be edited. Accept title_fa/title_en/description_fa/
description_en on both About Me form requests and write them through
setTranslation() for each locale.

Adds a read-only GET /api/website/project-categories endpoint backed by the
existing (previously unreachable) ProjectCategory model, so project forms can
offer a category picker.
2026-10-01 19:24:00 +00:00
root d2f6bd4d7d Close anonymous write access to the public API and repair the broken test suite
Deploy Backend / deploy (push) Has been cancelled
Every mutating endpoint was reachable without authentication, so any visitor
could create, edit or delete posts, categories, tags, projects and about-me
records on the live site.

Security
- Split routes into an anonymous read-only group and a write group gated by
  `auth:sanctum` + a new `admin` middleware.
- Add `is_admin` to users; Sanctum token support on the User model.
- Add AuthController (login / me / logout). The Sanctum token is delivered in
  an httpOnly cookie and never returned in the JSON body, because the admin
  panel reaches the API through a Next.js server-side proxy that breaks
  Sanctum's first-party domain detection.
- AuthenticateAdminPanelSession promotes that cookie to a bearer header so
  Sanctum's normal validation, expiry and revocation still apply.
- Remove the unauthenticated `/user/{id}` route, which exposed user emails.
- Non-admin accounts are refused at login and the failure shape is identical
  to a bad password, so the endpoint cannot enumerate accounts.
- Fix `Route [login] not defined`: a non-JSON unauthenticated request resolved
  a route that does not exist in this API-only app and returned 500.
- Reject invalid list query parameters with 422 instead of 500, and cap
  per_page at 50 (`?per_page=100000` previously dumped whole tables).

Correctness
- Make the translation migration portable. It used MySQL-only JSON_OBJECTAGG,
  which aborted all 29 tests during migration; the data collapse now runs in
  PHP so it works on MySQL, MariaDB and SQLite.
- Add HasJsonTranslations trait providing the missing setTranslation(), which
  made project create/update return 500, and replace five copy-pasted
  getTranslation()/hasTranslation() bodies.
- Make posts.excerpt nullable to match StorePostRequest; omitting an excerpt
  was a guaranteed SQL integrity error.
- Route the AboutMeController CRUD methods that existed but were never
  registered.
- CategoryTest omitted a required description; fixed the test, the existing
  schema and validation already agreed.

Tests: 83 passing / 126 assertions (was 29 failing / 0 assertions)
2026-10-01 18:47:34 +00:00
root 8b834189a4 Close anonymous write access to the public API and repair the broken test suite
Every mutating endpoint was reachable without authentication, so any visitor
could create, edit or delete posts, categories, tags, projects and about-me
records on the live site.

Security
- Split routes into an anonymous read-only group and a write group gated by
  `auth:sanctum` + a new `admin` middleware.
- Add `is_admin` to users; Sanctum token support on the User model.
- Add AuthController (login / me / logout). The Sanctum token is delivered in
  an httpOnly cookie and never returned in the JSON body, because the admin
  panel reaches the API through a Next.js server-side proxy that breaks
  Sanctum's first-party domain detection.
- AuthenticateAdminPanelSession promotes that cookie to a bearer header so
  Sanctum's normal validation, expiry and revocation still apply.
- Remove the unauthenticated `/user/{id}` route, which exposed user emails.
- Non-admin accounts are refused at login and the failure shape is identical
  to a bad password, so the endpoint cannot enumerate accounts.
- Fix `Route [login] not defined`: a non-JSON unauthenticated request resolved
  a route that does not exist in this API-only app and returned 500.
- Reject invalid list query parameters with 422 instead of 500, and cap
  per_page at 50 (`?per_page=100000` previously dumped whole tables).

Correctness
- Make the translation migration portable. It used MySQL-only JSON_OBJECTAGG,
  which aborted all 29 tests during migration; the data collapse now runs in
  PHP so it works on MySQL, MariaDB and SQLite.
- Add HasJsonTranslations trait providing the missing setTranslation(), which
  made project create/update return 500, and replace five copy-pasted
  getTranslation()/hasTranslation() bodies.
- Make posts.excerpt nullable to match StorePostRequest; omitting an excerpt
  was a guaranteed SQL integrity error.
- Route the AboutMeController CRUD methods that existed but were never
  registered.
- CategoryTest omitted a required description; fixed the test, the existing
  schema and validation already agreed.

Tests: 83 passing / 126 assertions (was 29 failing / 0 assertions)
2026-10-01 14:35:34 -04:00
parsa aghaei 35686d82c3 chore: remove Iranian mirror from CI workflow - use official Alpine repos
Deploy Backend / deploy (push) Failing after 13s
2026-07-12 13:35:32 +03:30
parsa aghaei ab0e9517ea chore: remove committed vendor directory from git
- Remove vendor/ from git tracking
- Uncomment /vendor in .gitignore to prevent future commits
- Dependencies will be installed via CI/CD with VPN + Nexus cache
2026-07-12 13:28:08 +03:30
DevOps 6366843e47 test: trigger backend CI/CD pipeline 2026-06-28 18:09:20 +00:00
DevOps 1a75055dd9 fix: add missing hasTranslation method to AboutMe model 2026-06-28 17:41:38 +00:00
DevOps 223a4f5640 fix: remove HasTranslations trait, use translations JSON in models + seeders 2026-06-28 17:37:08 +00:00
parsa aghaei ebd4bd19ed content: update about and service seeders with professional senior engineer copy 2026-06-28 20:22:12 +03:30
DevOps 4c5f6cfe10 fix: update Service model for translations JSON column 2026-06-28 15:59:20 +00:00
DevOps 1b2e73bc0e cleanup: remove trigger, fix .dockerignore 2026-06-28 15:45:15 +00:00
DevOps b659d267cb test: trigger CI/CD with offline vendor build 2026-06-28 13:46:04 +00:00
parsa aghaei d86aef2bec fix: remove ENV HTTP_PROXY, offline install when vendor exists 2026-06-28 16:56:28 +03:30
parsa aghaei 6b81bf0afe fix: only set composer proxy when vendor absent, use offline install otherwise 2026-06-28 16:52:12 +03:30
parsa aghaei 59a8d1f82b chore: commit vendor for offline build 2026-06-28 16:47:17 +03:30
DevOps 7f44e5d33a chore: add vendor for offline builds 2026-06-28 12:47:12 +00:00
DevOps 0e1ac38cf1 final test - nexus mirrors 2026-06-28 11:37:54 +00:00
DevOps 4584645518 restore Nexus mirror, test CI/CD 2026-06-28 10:51:19 +00:00
DevOps ff1fc2afd0 fix: remove Nexus mirror, use packagist.org directly via proxy 2026-06-28 10:30:23 +00:00
DevOps e841c89444 retry ci - symfony/routing 400 transient 2026-06-28 10:27:41 +00:00
DevOps 11ebd658e4 trigger ci - test proxy 2026-06-28 10:25:12 +00:00
parsa aghaei 110d4e0ed3 trigger ci - test optimized build 2026-06-28 13:40:57 +03:30
parsa aghaei f951e19ffb trigger ci backend - test proxy 2026-06-28 12:25:14 +03:30
parsa aghaei b31b4d73ac upgrade: Laravel 13 + swagger-php v6 attributes 2026-06-28 12:01:57 +03:30
parsa aghaei f7ad5f6844 trigger ci 2026-06-28 11:11:43 +03:30
parsa aghaei 7935eb7f62 trigger ci 2026-06-27 14:07:38 +03:30
parsa aghaei 91d5398702 fix: use arvancloud Alpine mirror (Liara returns 500), remove unused proxy 2026-06-27 11:38:22 +03:30