- getAppointmentSlots uses doctor_uuid + date (was doctor_id, which the
backend rejects with دکتر یافت نشد).
- postAppointmentPayment posts to /api/v1/payment/appointment (was the
nonexistent /api/v1/payment).
- Remove getAppointmentNotAvailable: the not-available route does not
exist (404); disabled dates come from the slots response.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The routing modal shipped broken deep links: snapp.ir/route and
tapsi.ir/route paths don't exist (404), and balad used the wrong path
and params. Keep only apps with verified destination deep links and
fix their formats:
- Remove Snapp and Tapsi (no valid web destination route).
- Balad: balad.ir/location?latitude=&longitude= (was /map?lat=&lng=).
- Google Maps and Waze kept (already correct).
- Guard data.map destructuring against null.
- Dashboard turn detail: use maps/dir directions URL instead of a
plain q= pin to match the مسیریابی label.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The map iframe lived inside a collapsed (max-h-0, overflow-hidden)
accordion with loading=lazy, so it often never loaded after expanding.
Mount the iframe only when the location item is open so it loads fresh,
and raise the open clamp from max-h-screen to max-h-[800px] so the map
isn't clipped on shorter viewports.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The GET /api/v1/doctor/{uuid} response is double-nested
({ success, data: { data: {...} } }), but the page only unwrapped one
level, leaving every field (name, specialties, expertise, address)
undefined — so خدمات / موقعیت مکانی / نظرات rendered empty or broken.
- Extract the doctor object with res.data?.data?.data in both
generateMetadata and the page.
- Hide the خدمات block when expertise is empty (no fabricated data).
- Render the location map iframe and routing buttons only when the
address has real latitude/longitude (was building q=null,null).
- Fix the comments list rendering a stray 0 on empty arrays.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete data/information.json, data/userData.json, data/bank.json — the
panel and patient dashboard now read real data from the API, and no
render path references these files anymore. Verified via grep + build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
backend جدید clinicpro صفحهبندی را در پاسخ تحت کلید meta برمیگرداند
({totalRecords, totalPages, currentPage})، نه page. به همین دلیل
PaginationContent مقدار totalRecords نمیگرفت و count=NaN میشد و
صفحهبندی مخفی میماند. اصلاح در صفحات /doctors و /clinics.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
برخی پزشکان address ندارند؛ data?.address[0] روی آنها کرش میکرد
(Cannot read properties of undefined). اصلاح به data?.address?.[0]
در Address و Telefon صفحه پروفایل پزشک.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
بهینهساز تصویر داخلی Next با fetch بومی خودش تصویر را از ddev میگیرد و
گواهی self-signed را رد میکرد (UNABLE_TO_VERIFY_LEAF_SIGNATURE روی
/_next/image). افزودن NODE_TLS_REJECT_UNAUTHORIZED=0 فقط به اسکریپت dev.
build و start production دستنخورده و امن میمانند.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
API مسیرهای تصویر را نسبی برمیگرداند (/uploads/...) که next/image روی
دامنه localhost میجست و 404 میداد. helper جدید imageUrl مسیرهای نسبی
uploads را با NEXT_PUBLIC_API_URL کامل میکند (absolute و asset محلی
دستنخورده). اعمال روی لیست/جزئیات پزشک، نوبت، گالری کلینیک، آواتارها.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
backend جدید clinicpro جریان سهمرحلهای دارد:
send-code → verify-code (uuid+code) → oauth/token (uuid).
- token route حالا اول /api/v1/user/verify-code را صدا میزند سپس
/oauth/token با بدنه JSON {grant_type, uuid} (بهجای form-urlencoded
با client_id/secret/scope که فقط backend پروداکشن قدیم میپذیرفت)
- refresh route به مسیر درست /oauth/token/refresh با بدنه JSON
- تست E2E روی ddev محلی: access_token واقعی صادر شد
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prop loading روی Button فقط در MUI v6+ پشتیبانی میشود؛ این پروژه v5 است
و هشدار "Received false for a non-boolean attribute loading" میداد.
- دکمههای login/verify: disabled + CircularProgress شرطی (بازخورد بصری حفظ شد)
- بقیه دکمهها: loading → disabled (ادغام با disabled موجود در صورت وجود)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
route های token و refresh از fetch بومی Node استفاده میکردند که گواهی
self-signed ddev محلی را رد میکرد و خطای 500 میداد. حالا از axiosInstance
استفاده میکنند و خطای واقعی backend را با status درست برمیگردانند.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
صفحات سرور (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>
- افزودن الگوی http برای api.clinic-pro.ir به next.config (عکسهای بیمه
با http برمیگردند و خطای 500 next/image میدادند)
- جایگزینی prop loading نامعتبر روی Button با disabled در SendReq/ButtonApply
(loading فقط در MUI v6+ پشتیبانی میشود؛ این پروژه v5 است و lab نصب نیست)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 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>
- انتقال 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>
تبدیل صفحه dashboard پنل به Server Component که آمار ماهانه نماینده را
از API میگیرد (year/month میلادی جاری) و با adaptRepresentationDashboard
به propهای کامپوننت map میکند. حذف داده mock.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
افزودن adaptRepresentationInfo که خروجی API نماینده را به propهای
کامپوننتهای نمایشی map میکند و حذف import داده mock از Content پنل.
فیلدهای آماری بدون معادل API خالی میمانند (بدون داده ساختگی).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
افزودن getRepresentationDashboardMonthly و getRepresentationDashboardYearly
به لایه request برای مصرف endpointهای داشبورد نماینده.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
- Fix GPS map links always sending literal "latitude"/"longitude" strings
instead of actual coordinates in openLocation/Content.js
- Add api.clinic-pro.ir to next.config.js remotePatterns so production
images load correctly
- Fix appointment page: await params and getStateInfo (Next.js 15 pattern)
- Enable 401 handling in api.js: clear cookies and redirect to /login
- Move OAuth client_secret to server-side API routes (/api/auth/token,
/api/auth/refresh) so it is never bundled into client-side JavaScript
- Update SendReq, SubmitData, ButtonSendData to call API routes instead
of directly sending client_secret from the browser
- Update docker-compose.yml to use server-only CLIENT_SECRET env var
- Remove debug console.log from clinic doctors list component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace new Date(b.created) with toSafeDate() helper to guard against
invalid date strings from blog API responses
- Use a single NOW constant instead of new Date() per entry to avoid
serialization issues during static generation
- Remove unused imports (cityData, DOMAIN_CONFIG, etc.)
- Add CLAUDE.md with project architecture and development guidance
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Updated MUI packages to version 5.x and x-charts/x-date-pickers to 7.x
- Downgraded React and React-DOM to version 18.3.1
- Added .dockerignore to exclude unnecessary files from Docker context
- upgraded @maptiler/sdk from 2.5.1 to 3.9.0
- upgraded @mui/styled-engine-sc from 6.4.9 to 7.3.6
- upgraded @mui/x-charts from 7.29.1 to 8.21.0
- upgraded @mui/x-date-pickers from 7.29.4 to 8.21.0
- upgraded date-fns from 3.6.0 to 4.1.0
- upgraded npm from 10.9.4 to 11.7.0
- upgraded react and react-dom from 18.3.1 to 19.2.1
- upgraded swiper from 11.2.10 to 12.0.3
- upgraded cross-env from 7.0.3 to 10.1.0
- 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