Commit Graph
54 Commits
Author SHA1 Message Date
hamed 9cfbd2e002 feat: Revert homepage changes, fix Persian slug 404, and make various article and about us adjustments
- Removed the newly added city-focused section from the homepage.
- Fixed 404 error for Persian slugs in specialties and blog pages by implementing a decode helper.
- Removed the "مخصوص شهر" label from article headers.
- Linked article tags to their respective filter pages.
- Adjusted related content images to prevent distortion.
- Added a section in the "About Us" page for physician registration guidance.
- Updated the logo in the "About Us" header to the correct version.
- Added tests for the new functionality and ensured existing tests are updated accordingly.
2026-08-08 21:06:48 +03:30
hamed 72beb8b591 feat: Refactor clinic-related functions and tests, removing doctor intro logic 2026-08-08 20:26:17 +03:30
hamed b494473e40 feat: رفع لینک /doctor/undefined و متمایزسازی صفحهٔ اصلی شهرها
- ایجاد پرامپت برای رفع خطای 404 ناشی از لینک `/doctor/undefined` در سایت‌های بهبهان و یاسوج.
- افزودن کامپوننت `CityHighlights` برای نمایش محتوای یکتا و آمار پزشکان و تخصص‌های پرمراجعه در صفحهٔ اصلی هر شهر.
- به‌روزرسانی تست‌های مربوط به کامپوننت‌های `ItemDoctor` و `CityHighlights` برای اطمینان از عدم وجود لینک‌های نامعتبر و نمایش صحیح اطلاعات.
- ایجاد سند جدید برای مستندسازی خطاهای Search Console که باگ نیستند و نیاز به رفع ندارند.
- افزودن تست‌های واحد برای توابع `buildCityIntro` و دیگر توابع مرتبط با تولید متن یکتا برای صفحات لیست.
2026-08-08 19:14:50 +03:30
hamed 79747c443c feat: Enhance specialty handling and navigation across doctor and specialty pages 2026-08-08 17:33:13 +03:30
hamed 56e264e44c feat: Refactor specialty display logic and enhance specialty filtering
- Introduced SpecialtyChips component to manage the display of doctor's specialties with a primary specialty and a count of additional specialties.
- Updated ItemDoctor component to utilize SpecialtyChips for better UI presentation.
- Enhanced PosterLight and Poster components to display primary specialties and a text line for sub-specialties.
- Implemented nextSpecialtyFilter function to improve specialty selection logic in the Content component.
- Updated search functionality to allow searching by both doctor name and specialty.
- Added new specialties to specialties.json for better coverage.
- Created sync-specialties script to synchronize specialties data with the backend during build.
- Added tests for new components and helper functions to ensure functionality and reliability.
2026-08-08 17:19:22 +03:30
hamed cea8982e6d feat: add script to generate default blog cover image
- Introduced a new script `make-blog-cover.mjs` to create a default cover image for blog posts.
- The image is generated in PNG format with dimensions 1200x630, suitable for Open Graph.
- Utilizes the site's branding colors and logo from `public/nobat724.svg`.
- Includes custom font styling using the Vazirmatn font.
- The generated image is saved to `public/assets/images/blog-default-cover.png`.
2026-07-27 19:07:30 +03:30
hamed 2f8dec0fb8 fix(sanitize): update comments for ALLOWED_TAGS to clarify synchronization with composer.py 2026-07-27 11:35:54 +03:30
hamed d02ae8bff0 feat(entityQuality): rename isThinDoctor to isNoindexDoctor for clarity and update related logic 2026-07-26 09:17:42 +03:30
hamed b8514e64cf feat(breadcrumb): implement BreadcrumbList structure and validation for SEO compliance 2026-07-24 10:39:41 +03:30
hamed 9053681375 feat(blog): implement domain-specific blog fetching and canonical URL handling 2026-07-24 10:01:35 +03:30
hamed a39b90c88c feat: normalize doctor name query to enhance search functionality and improve URL building 2026-07-20 12:33:22 +03:30
hamed ac3a84d55d feat: implement search URL building and enhance search functionality in Fields and RedirectLink components 2026-07-20 12:28:52 +03:30
hamed 30c3fe8637 feat: enhance SEO for listing and specialty pages, fix search autocomplete issue 2026-07-20 10:26:03 +03:30
hamedandClaude Fable 5 daf38c8631 feat(maintenance): show maintenance page when the API is in maintenance
The backend now answers 503 with code MAINTENANCE_MODE while maintenance is
on. Without this change a visitor got a red error toast over a broken page
client-side, and a silently empty page server-side, because fetchReq discards
the status and returns null on any failure.

- lib/maintenance.js detects the state by BOTH status 503 and the error code;
  a bare 503 can come from a reverse proxy and is not maintenance
- The axios interceptor checks it before the 401 branch, so a maintenance
  response never triggers the refresh-token path or logs the user out
- fetchReq redirects to /maintenance, with a silentMaintenance opt-out used by
  getStateInfo: that one runs inside generateMetadata and while rendering the
  maintenance page itself, where a redirect is either ineffective or loops
- redirect() works by throwing, so the try/catch blocks in the doctors,
  clinics and specialties pages now rethrow NEXT_REDIRECT instead of
  swallowing it
- clinicApi.js handles 503 too; it previously rendered maintenance as a clinic
  with zero doctors
- The page reuses the existing 404 design and is marked noindex

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 22:01:45 +03:30
hamed 1522ee8b73 feat: enhance clinic contact information display with new helper functions for phone, city, and state 2026-07-19 16:44:06 +03:30
hamed 4c8377f439 feat: add doctorTitle helper function and update references in metadata and FAQ 2026-07-19 15:40:24 +03:30
hamed 672a7d89bf Fix community IDs and update sitemap functionality
- Updated community IDs for various components in graph.json to reflect correct associations.
- Added new function `getPublishedDoctors()` in app/sitemap.js and established relationships with existing functions.
- Adjusted source locations for several functions in app/sitemap.js to ensure accurate mapping.
- Enhanced canonical URL handling in lib/getCanonicalUrl.js to prevent incorrect canonicalization for paginated specialty pages.
- Updated manifest.json with new modification times and AST hashes for affected files.
2026-07-19 09:32:00 +03:30
hamed 4d7b87ee1a feat(blog): enhance metadata generation and blog fetching by city context 2026-07-19 09:02:14 +03:30
hamed 88782e70c2 test(extractEntityCityId): prioritize address over top-level city in entity extraction 2026-07-19 08:54:00 +03:30
hamed fd48b48613 feat: add canonical URL handling and entity quality checks
- Implemented canonical URL strategies for city-specific domains and entities.
- Added helper functions for domain and city resolution.
- Created tests for canonical URL generation and domain resolution.
- Introduced entity quality checks for doctors and clinics to ensure meaningful content.
- Developed unique introductory texts for listing pages to avoid duplicate content.
- Established robots.txt policies for listing pages to manage indexing based on user filters.
- Enhanced specialty content with dynamic introductions and FAQs to improve SEO.
2026-07-19 07:52:50 +03:30
hamed 165a0a2240 feat(appointment): implement service-based booking flow with service selection and slot adaptation 2026-07-15 23:48:40 +03:30
hamed d5845bf84d refactor(dateTime): streamline slot handling and improve session management 2026-07-15 19:16:24 +03:30
hamed ab2ab0dea2 feat: enhance domain handling for global representatives
- Updated `getStateInfo` to fetch site context for domains not in city.json, returning `repContext` with representative details.
- Implemented caching for site context requests to optimize performance.
- Modified doctor and clinic listing pages to pass the `domain` parameter when fetching data for global representatives.
- Adjusted metadata generation in layout and pages to reflect representative branding based on `repContext`.
- Added documentation for the new functionality in `.claude/prompt/global-rep-domain-site.md`.
2026-07-09 07:34:09 +03:30
hamed a9fcfea12a Refactor code structure for improved readability and maintainability 2026-07-06 09:35:17 +03:30
hamed b04bb45ca1 Implement multi-domain SEO improvements:
- Add metadata to login and login-verify pages to prevent indexing.
- Update robots.txt to disallow additional sensitive paths.
- Enhance sitemap generation to filter by city and include accurate last modified dates.
- Refactor canonical URL generation to support multi-domain architecture, ensuring self-canonicalization for city domains.
- Remove deprecated CanonicalHandler component and streamline canonical URL handling.
- Introduce safe JSON-LD output to prevent XSS vulnerabilities.
- Add payment layout with appropriate metadata to prevent indexing.
- Conduct a comprehensive technical SEO audit and implement necessary fixes across the application.
2026-07-05 15:47:47 +03:30
hamed 5bec4848a2 feat: unify currency display to toman across the application 2026-07-03 10:31:16 +03:30
hamed 79f7df2e4d feat: implement root domain handling for nobat724.com to prevent city filtering 2026-07-02 21:53:45 +03:30
hamed c316d22160 feat: add testing setup with Vitest and Testing Library
- Updated package.json to include Vitest and Testing Library dependencies and scripts for testing.
- Created a test suite for the ProvinceProvider context to validate cityId and province detection based on subdomains.
- Implemented unit tests for utility functions in helper/index.js, including phone number formatting and validation.
- Added tests for state information retrieval in lib/getStateInfo.js, ensuring correct city and state matching based on subdomains.
- Developed tests for appointment slot adaptation and availability checks in lib/appointmentSlots.js.
- Created tests for token storage functionality in lib/tokenStore.js.
- Implemented sanitization and JSON parsing tests in lib/sanitize.js.
- Added CASL ability tests in lib/ability.js to verify user access rights.
- Created tests for cookie management in lib/refreshCookie.js.
- Developed tests for patient user representation in lib/representationAdapters.js.
- Implemented client-side state information retrieval tests in lib/getStateInfoClient.js.
- Created tests for canonical URL generation in lib/getCanonicalUrl.js.
- Developed tests for clinic API service functions in services/clinicApi.js.
- Added request wrapper tests in services/response.js to ensure correct API interaction.
- Set up Vitest configuration in vitest.config.mjs for JSX support and alias resolution.
- Created setup and utility files for testing environment in test/setup.js and test/utils.jsx.
2026-06-28 23:25:46 +03:30
hamed f87110c277 refactor: remove unused components and files related to date filtering and doctor search
- Deleted Date.js and FilterDate.js components as they are no longer needed.
- Removed SearchDoctor.js component which was responsible for searching doctors.
- Cleaned up the Head component by removing references to the deleted Date and SearchDoctor components.
- Removed TurnsPage component and its associated List component, which were not utilized.
- Deleted Cards and Table components from the list directory as they were not in use.
- Removed user account related components including Tab, Head, and Form components.
- Cleaned up bank account components including List, Item, and modal components.
- Removed representation adapters and related functions that were not in use.
2026-06-25 18:14:27 +03:30
hamed cb9d9beaab feat(sitemap): refactor sitemap generation to include doctors, clinics, and blogs with improved URL handling 2026-06-21 12:52:41 +03:30
hamed 194ffd889c feat: enhance security by implementing HttpOnly refresh tokens and in-memory access token management
- Added isomorphic-dompurify for improved XSS protection
- Refactored token storage to use in-memory management for access tokens
- Implemented server-side route handlers for OAuth token management
- Introduced security headers in next.config.js
- Removed client-side exposure of client_secret and sensitive tokens
- Updated API interceptors to handle token refresh logic
- Cleaned up cookie management for refresh tokens
2026-06-20 13:10:17 +03:30
hamed ea2c0c29ec feat(userAccount): enhance user profile handling with avatar upload and additional user data 2026-06-19 10:19:52 +03:30
hamedandClaude Opus 4.8 cec6b51f23 fix(dashboard): fetch profile by real user uuid, not OTP uuid
app/dashboard/page.js fetched the profile with the standalone uuid cookie,
which still holds the OTP uuid and 404s. Read the user uuid from the
userInfo cookie (falling back to the uuid cookie); the backend resolves it
and lazy-creates the profile. Also fix buildPatientUser to read the
double-nested response (data.data) and the profile's label field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 19:17:50 +03:30
hamedandClaude Opus 4.8 dcfdedd93c fix(appointment): render real slot structure in time picker
The slots API returns data.sessions[].slots[] with start_time (HH:MM),
is_available, and start/end unix timestamps — not the morning/evening +
time/status shape the UI assumed. Add lib/appointmentSlots.js to flatten
sessions into morning/evening by start_time, fetch with doctor.uuid, and
read item.start_time / item.is_available in the slot grid. Derive the
clinic address from the already-loaded doctor.address by location_id
instead of a separate auth-required call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 15:40:21 +03:30
hamedandClaude Opus 4.8 1d56972b65 fix: use SSL-tolerant axios instance for server-side API calls
صفحات سرور (doctors, doctor/[slug], appointment/[doctorId]) از axios خام
استفاده می‌کردند که گواهی self-signed ddev محلی را رد می‌کرد
(unable to verify the first certificate). حالا از axiosInstance/fetchReq
در lib/req استفاده می‌کنند که در development آن را می‌پذیرد.
افزودن clinic-pro.ddev.site (http/https) به remotePatterns تصاویر.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 00:21:34 +03:30
hamedandClaude Opus 4.8 dc1c6d25be feat(dashboard): connect patient dashboard to real user profile
- buildPatientUser: ساخت آبجکت user از user-profile واقعی با کلیدهای
  مورد انتظار کامپوننت‌ها؛ comments/messages خالی و اعداد هدر صفر
  (بدون داده ساختگی، چون endpoint ندارند)
- app/dashboard/page.js پروفایل را server-side از user-profile/{uuid} می‌گیرد
- حذف import userData.json mock از Content داشبورد
- نوبت/تراکنش/تب اطلاعات از قبل به API واقعی وصل بودند (بدون تغییر)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 00:10:40 +03:30
hamedandClaude Opus 4.8 5067824f28 feat(panel): connect turns/user-account/add-doctor to real data
- انتقال adapterهای نماینده به lib/representationAdapters (server-safe،
  بدون وابستگی client مثل js-cookie/react-toastify)
- turns: لیست از daily[] داشبورد ماهانه (ستون نام/تخصص خالی، بدون داده ساختگی)
- user-account: حساب بانکی واقعی از bank_account نماینده (map به آرایه تک‌کارته)
- add-doctor: حذف import mock مرده (کامپوننت data مصرف نمی‌کرد)
- رفع dead import اشتباه از turns/page در clinic/doctors که build را می‌شکست

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 00:06:01 +03:30
hamedandClaude Sonnet 4.6 59e0a0fe4f fix: resolve critical bugs and security issues across the project
Security:
- Disable SSL verification only in development (lib/req.js)
- Wrap all JSON.parse(cookie) calls in try-catch via safeJsonParse utility
- Sanitize dangerouslySetInnerHTML in blog/clinic with sanitizeHtml utility
- Fix open redirect in payment page — validate URL origin before redirect
- Fix cookie cleanup on 401 — use js-cookie with correct domain scope

Performance:
- Wrap ItemDoctor with React.memo to prevent unnecessary re-renders
- Replace <img> with Next.js <Image> in blog Caption component

Functionality:
- Fix memory leak in Recode.js — store intervals in refs, cleanup on unmount
- Add null guard on retryIcon.current before classList manipulation
- Fix getParsedUserInfo in helper to handle malformed cookie gracefully

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 09:19:20 +03:30
hamed 23f20626a6 refactor: improve key assignment in FrequentSearches and update TextHeader to use async getStateInfo 2025-12-10 09:53:51 +03:30
hamed 40df2db108 chore: update dependencies in package.json
- Bumped versions for several packages including:
  - @emotion/styled from ^11.14.0 to ^11.14.1
  - @maptiler/sdk from ^2.4.0 to ^2.5.1
  - @mui/icons-material from ^7.1.0 to ^7.3.6
  - @mui/material from ^7.1.0 to ^7.3.6
  - @mui/styled-engine-sc from ^6.0.0-alpha.18 to ^6.4.9
  - @mui/x-charts from ^7.16.0 to ^7.29.1
  - @mui/x-date-pickers from ^7.17.0 to ^7.29.4
  - @next/third-parties from ^15.1.0 to ^15.5.7
  - axios from ^1.7.7 to ^1.13.2
  - dayjs from ^1.11.13 to ^1.11.19
  - jspdf from ^3.0.1 to ^3.0.4
  - next from ^14.2.20 to ^15.5.7
  - next-themes from ^0.3.0 to ^0.4.6
  - npm from ^10.8.2 to ^10.9.4
  - react from ^18.0.0 to ^18.3.1
  - react-dom from ^18 to ^18.3.1
  - react-easy-crop from ^5.1.0 to ^5.5.6
  - react-toastify from ^10.0.6 to ^11.0.5
  - sharp from ^0.34.1 to ^0.34.5
  - styled-components from ^6.1.11 to ^6.1.19
  - stylis from ^4.3.4 to ^4.3.6
  - swiper from ^11.1.9 to ^11.2.10
  - postcss from ^8 to ^8.5.6
  - prettier from ^3.5.3 to ^3.7.4
  - tailwindcss from ^3.4.1 to ^3.4.18
2025-12-04 05:26:37 +03:30
hamed 18b03ca781 refactor: enhance user role handling in List and ability definitions 2025-11-19 11:48:40 +03:30
hamed e26d342c90 refactor: enhance blog functionality with related blogs fetching, improved loading states, and tag filtering 2025-11-19 11:32:09 +03:30
hamed 8de14fd3c0 implement canonical URL handling with server and client-side support, add middleware for pathname access, and create hooks for dynamic canonical URL injection 2025-10-08 10:26:22 +03:30
ehsan e6893846bd change design poster and text head && design modal filter & data for filter and doctors & handle functionality filter, set in url, read from url and change state 2025-10-06 01:13:55 +03:30
ehsan e1510b142b handle download poster and qrcode, fix to show timestamp, add pagination to doctors page 2025-10-02 02:52:26 +03:30
Ehsan 6414293d1c handle request in modal filters, selector sort, search city with one function and field-search & handle change all data in doctors filter with one function & change modal search location in home page & set data with diffrent key in url of page doctors 2025-09-12 20:51:50 +03:30
Ehsan c88a371eda page add panel/doctor role agent && save data crop img && upload img && just roles agent can access panel && save data doctor && add field phone number && remove two tab 2025-07-16 08:13:29 +03:30
Ehsan 72ed07071c handle update data in tab dashboard 2025-06-10 14:27:06 +03:30
Ehsan f52eb43326 last update 2025-06-08 10:13:06 +03:30
Ehsan 7d6a9e6e33 update design and request pages dashboards & doctors & doctor item & clinics & clinic item and layout 2025-06-07 04:22:52 +03:30