feat: harden admin security, add AI trip planner, map view, and SEO/notification improvements

Security:
- requireAdmin() session check added to every admin-only server action
  (previously relied only on middleware path matching, which Next.js
  Server Actions don't reliably respect)
- Real Prisma + bcrypt admin auth, replacing hardcoded credentials; split
  into an Edge-safe auth.config.ts (used by proxy.ts) and the full
  Prisma-backed auth.ts (route handler, server actions, server components)
- Removed hardcoded fallback secret on the Instagram sync cron endpoint
- Honeypot field + per-IP rate limiting on contact/business-submission
  forms and the analytics events endpoint

Features:
- AI trip planner (/plan-olustur, /plan/[id]) backed by DeepSeek, grounded
  to only recommend isLocalApproved listings, with a deterministic
  link-injection fallback for anything the model doesn't format as markdown
- Interactive Leaflet/OpenStreetMap view on category listing pages
- Telegram notifications for new contact messages and business submissions

SEO:
- Brand-consistent favicon/apple-icon/PWA icons and default Open Graph/
  Twitter share images, generated via next/og (replacing default Next.js
  placeholders)
- BreadcrumbList structured data on category and listing detail pages
- Fixed two remaining raw <img> tags to use next/image

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
AyrisAI
2026-08-24 00:01:06 +03:00
co-authored by Claude Sonnet 5
parent 390bd699a6
commit 1b8cfeda95
62 changed files with 2216 additions and 411 deletions
+7 -6
View File
@@ -73,13 +73,13 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
href={item.href}
onClick={() => setSidebarOpen(false)}
className={`
flex items-center px-4 py-3 text-xs font-semibold rounded-xl transition-all duration-150
flex items-center px-4 py-3 text-xs font-semibold rounded-xl transition-all duration-150 min-h-[44px]
${isActive
? 'bg-white/5 border-l-4 border-turquoise text-stone pl-3'
: 'text-stone/75 hover:bg-white/5 hover:text-stone'}
? 'bg-turquoise/15 text-turquoise font-bold'
: 'text-stone/80 hover:bg-white/10 hover:text-stone'}
`}
>
<item.icon className={`mr-3 flex-shrink-0 h-4.5 w-4.5 ${isActive ? 'text-turquoise' : 'text-stone/50'}`} />
<item.icon className={`mr-3 flex-shrink-0 h-4.5 w-4.5 ${isActive ? 'text-turquoise' : 'text-stone/60'}`} />
{item.name}
</Link>
)
@@ -90,10 +90,11 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
{/* Logout Action */}
<div className="p-4 border-t border-white/10">
<button
type="button"
onClick={() => signOut({ callbackUrl: '/' })}
className="flex w-full items-center px-4 py-3 text-xs font-semibold text-red-400 hover:text-red-300 rounded-xl hover:bg-red-950/20 transition-colors"
className="flex w-full items-center px-4 py-3 text-xs font-semibold text-bougainvillea hover:bg-bougainvillea/10 rounded-xl transition-colors min-h-[44px] cursor-pointer"
>
<LogOut className="mr-3 h-4.5 w-4.5 text-red-400/70" />
<LogOut className="mr-3 h-4.5 w-4.5 text-bougainvillea" />
Çıkış Yap
</button>
</div>
+4 -2
View File
@@ -23,12 +23,14 @@ export default async function AdminListingEditPage({ params }: Props) {
const categoryOptions = categories.map(c => ({
value: c.id,
label: c.nameTr
label: c.nameTr,
slug: c.slug
}))
const neighborhoodOptions = neighborhoods.map(n => ({
value: n.id,
label: n.nameTr
label: n.nameTr,
slug: n.slug
}))
return (