<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mehmet</title>
    <description>The latest articles on Forem by Mehmet (@mehmet_814020d1de66bc1a16).</description>
    <link>https://forem.com/mehmet_814020d1de66bc1a16</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3657953%2Fb5183cd4-09a7-4462-bea9-ae980ebfa43d.png</url>
      <title>Forem: Mehmet</title>
      <link>https://forem.com/mehmet_814020d1de66bc1a16</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mehmet_814020d1de66bc1a16"/>
    <language>en</language>
    <item>
      <title>I Built a Type-Safe JSON-LD Generator for Next.js to Automate SEO</title>
      <dc:creator>Mehmet</dc:creator>
      <pubDate>Mon, 22 Dec 2025 00:14:48 +0000</pubDate>
      <link>https://forem.com/mehmet_814020d1de66bc1a16/i-built-a-type-safe-json-ld-generator-for-nextjs-to-automate-seo-mdl</link>
      <guid>https://forem.com/mehmet_814020d1de66bc1a16/i-built-a-type-safe-json-ld-generator-for-nextjs-to-automate-seo-mdl</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When building &lt;strong&gt;&lt;a href="https://www.hemenhesap.com" rel="noopener noreferrer"&gt;hemenhesap.com&lt;/a&gt;&lt;/strong&gt; - a Turkish financial calculator platform with 100+ calculator pages - I needed structured data for every page. Existing solutions were either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Too verbose:&lt;/strong&gt; &lt;code&gt;next-seo&lt;/code&gt; requires tons of boilerplate for simple schemas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not type-safe:&lt;/strong&gt; It's extremely easy to make syntax mistakes in complex JSON-LD objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing schemas:&lt;/strong&gt; Hard to find lightweight builders for &lt;code&gt;SoftwareApplication&lt;/code&gt; (Calculator) or &lt;code&gt;HowTo&lt;/code&gt; schemas.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;&lt;code&gt;nextjs-jsonld-schema&lt;/code&gt;&lt;/strong&gt; - a lightweight, type-safe JSON-LD builder specifically designed for Next.js (App &amp;amp; Pages Router).&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🎯 &lt;strong&gt;Full TypeScript support:&lt;/strong&gt; Autocomplete and type checking for all schema fields.&lt;/li&gt;
&lt;li&gt;🚀 &lt;strong&gt;Framework Ready:&lt;/strong&gt; Works perfectly with Next.js App Router and Metadata API.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Google-Compliant:&lt;/strong&gt; Generates structured data that passes Google's Rich Results Test.&lt;/li&gt;
&lt;li&gt;🪶 &lt;strong&gt;Zero Dependencies:&lt;/strong&gt; No extra bloat for your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quick Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;buildCalculatorSchema&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SchemaScript&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;nextjs-jsonld-schema&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;schema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;buildCalculatorSchema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;siteUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://hemenhesap.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/hesap/kredi-hesaplama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Loan Calculator&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Calculate your monthly payments instantly.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;howtoSteps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter amount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Input your total loan amount.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Calculate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Click the button to see the results.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;faq&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;question&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is it free?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Yes, all tools are 100% free!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Just drop this into your component&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SchemaScript&lt;/span&gt; &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;schema&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Supported Schema Types
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Builder&lt;/th&gt;
&lt;th&gt;Schema Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;buildWebsiteSchema()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;WebSite + Organization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;buildCalculatorSchema()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;SoftwareApplication + HowTo + FAQ&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;buildBlogPostSchema()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;BlogPosting + Article&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;buildFAQSchema()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;FAQPage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;buildBreadcrumbSchema()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;BreadcrumbList&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After implementing this on &lt;a href="https://www.hemenhesap.com" rel="noopener noreferrer"&gt;hemenhesap.com&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Rich snippets appearing in Google Search&lt;/li&gt;
&lt;li&gt;✅ FAQ dropdowns increasing CTR in search results&lt;/li&gt;
&lt;li&gt;✅ HowTo steps showing up in mobile SERPs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;nextjs-jsonld-schema
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📦 &lt;strong&gt;NPM:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/nextjs-jsonld-schema" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/nextjs-jsonld-schema&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🐙 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Aghefendi/nextjs-jsonld-schema" rel="noopener noreferrer"&gt;https://github.com/Aghefendi/nextjs-jsonld-schema&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback and contributions welcome!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with ❤️ for the Next.js community&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>seo</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Next.js 14 ile Finansal Hesaplama Motoru Geliştirmek: Hemen Hesap Mimarisi</title>
      <dc:creator>Mehmet</dc:creator>
      <pubDate>Thu, 11 Dec 2025 22:34:47 +0000</pubDate>
      <link>https://forem.com/mehmet_814020d1de66bc1a16/nextjs-14-ile-finansal-hesaplama-motoru-gelistirmek-hemen-hesap-mimarisi-k3c</link>
      <guid>https://forem.com/mehmet_814020d1de66bc1a16/nextjs-14-ile-finansal-hesaplama-motoru-gelistirmek-hemen-hesap-mimarisi-k3c</guid>
      <description>&lt;h3&gt;
  
  
  Neden Yeni Bir Hesaplama Motoru?👋
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;inansal okuryazarlık, karmaşık vergi mevzuatları ve sürekli değişen oranlar arasında kaybolabiliyor. Hemen Hesap, Türkiye’deki güncel vergi, maaş ve finansal hesaplamaları herkes için erişilebilir ve anlaşılır kılmak amacıyla başlattığım bir proje.&lt;br&gt;
Amacım sadece "bir form doldur, sonucu gör" uygulaması yapmak değil; SOLID prensiplerine uyan, test edilebilir ve SEO odaklı modern bir hesaplama motoru inşa etmekti.&lt;br&gt;
Bu yazıda, HemenHesap.com'un mimarisinden algoritmalarına, SEO stratejisinden test süreçlerine kadar mutfaktaki teknik detayları paylaşacağım.&lt;br&gt;
&lt;strong&gt;1. Teknoloji Yığını ve Mimari 🏗️&lt;/strong&gt;&lt;br&gt;
Projenin temelinde performans, tip güvenliği ve ölçeklenebilirlik yatıyor.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;1.1. Core Stack&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Next.js 14 (App Router): Projenin omurgası. SSR (Server-Side Rendering) ve SSG (Static Site Generation) yetenekleri sayesinde hem SEO dostu hem de şimşek hızında sayfalar oluşturduk.&lt;br&gt;
TypeScript: Finansal hesaplamalarda number ile string karışıklığına yer yok. Tamamı tip güvenli (Type-safe) bir yapı kurduk.&lt;br&gt;
React 18: Server ve Client component ayrımı ile hidrasyon (hydration) maliyetlerini minimize ettik.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;1.2. UI/UX&lt;/strong&gt;&lt;br&gt;
Tailwind CSS 3.4: Hızlı prototipleme ve tutarlı tasarım sistemi.&lt;/p&gt;

&lt;p&gt;Lucide React: Hafif ikon seti.&lt;/p&gt;

&lt;p&gt;Atomic Design: InputGroup, SelectGroup, ResultCard gibi yeniden kullanılabilir, izole bileşenler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.3. Klasör Yapısı&lt;/strong&gt;&lt;br&gt;
Proje, modülerliği korumak adına özellik tabanlı bir yapıya sahip:&lt;/p&gt;

&lt;p&gt;src/&lt;br&gt;
├── app/             # Next.js App Router (Sayfalar)&lt;br&gt;
├── components/      # UI Bileşenleri (Button, Input vb.)&lt;br&gt;
│   └── calculators/ # Hesaplama mantığını içeren bileşenler&lt;br&gt;
├── lib/             # Algoritmalar ve Helper fonksiyonlar&lt;br&gt;
├── types/           # TypeScript interface tanımları&lt;br&gt;
data/                # Oranlar, vergi dilimleri (JSON)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Hesaplama Algoritmaları ve İş Kuralları&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bu projenin kalbi src/lib/engines altında atıyor. Her hesaplama aracı (KDV, Maaş, MTV) kendi izole motoruna sahip.&lt;/p&gt;

&lt;p&gt;2.1. JavaScript ve Matematiksel Doğruluk&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bildiğiniz gibi JavaScript'te 0.1 + 0.2 !== 0.3 sorunu vardır. Finansal işlemlerde kuruş hatası kabul edilemez. Bu yüzden özel bir Akıllı Yuvarlama (smartRound) mekanizması geliştirdik.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;// Basitleştirilmiş örnek&lt;br&gt;
export const smartRound = (num: number, decimals: number = 2): number =&amp;gt; {&lt;br&gt;
  const factor = Math.pow(10, decimals);&lt;br&gt;
  return Math.round((num + Number.EPSILON) * factor) / factor;&lt;br&gt;
};&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2. Hesaplama Motorları&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;KDV Hesaplama: Dahil/Hariç dönüşümleri.&lt;/li&gt;
&lt;li&gt;Gelir Vergisi: 2025 kümülatif matrah takibi.&lt;/li&gt;
&lt;li&gt;Maaş Hesaplama: Brüt/Net döngüsü ve SGK tavan kontrolü.&lt;/li&gt;
&lt;li&gt;Kıdem Tazminatı: Tavan ücret ve giydirilmiş ücret analizi.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tüm bu motorlar, verilerini veritabanı yerine performans için Statik JSON dosyalarından (data/) çeker. Bu sayede vergi oranları değiştiğinde sadece JSON'ı güncellemek yeterlidir.&lt;br&gt;
&lt;strong&gt;3. SEO Stratejisi: Google Bizi Nasıl Görüyor?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finansal araçlarda rekabet yüksek. Teknik SEO ile fark yarattık.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{&lt;br&gt;
  "&lt;a class="mentioned-user" href="https://dev.to/context"&gt;@context&lt;/a&gt;": "&lt;a href="https://schema.org" rel="noopener noreferrer"&gt;https://schema.org&lt;/a&gt;",&lt;br&gt;
  "@type": "SoftwareApplication",&lt;br&gt;
  "name": "KDV Hesaplama Aracı",&lt;br&gt;
  "applicationCategory": "FinanceApplication",&lt;br&gt;
  "operatingSystem": "Web Browser"&lt;br&gt;
}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ayrıca BreadcrumbList ve Bloglar için BlogPosting şemaları dinamik olarak üretiliyor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2. Teknik Detaylar&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dinamik Metadata: Her hesaplama sayfası için özel title ve description.&lt;/li&gt;
&lt;li&gt;Sitemap: sitemap.ts ile her build işleminde otomatik güncellenen harita.&lt;/li&gt;
&lt;li&gt;İç Linkleme: Hesaplayıcılar ve blog yazıları arasında anlamsal bağlar.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Test ve Kalite Güvencesi (QA)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Vitest: Jest'e göre daha hızlı olduğu için tercih ettik.&lt;br&gt;
Kapsam: Hesaplama fonksiyonlarının %100'ü birim testlerden (Unit Test) geçiyor. Şu an 51 farklı senaryo her commit öncesi test ediliyor.&lt;br&gt;
ErrorBoundary: React tarafında olası bir çökmede (örn: API hatası) kullanıcının beyaz ekran görmesini engelleyip, anlamlı bir hata mesajı gösteriyoruz.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;5. Performans&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Statik Önbellekleme (SSG): Hesaplama sayfalarının iskeleti build anında oluşturulur.&lt;br&gt;
Lazy Loading: Kullanıcı "Maaş Hesaplama" sayfasındaysa, "MTV Hesaplama" kodları tarayıcıya indirilmez (Code Splitting).&lt;br&gt;
Bundle Size: bundle-analyzer ile paket boyutunu sürekli optimize ediyoruz.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6. Sonuç ve Yol Haritası&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hemen Hesap, modern web teknolojilerinin finansal araçlara nasıl entegre edilebileceğinin canlı bir örneği oldu.&lt;/p&gt;

&lt;p&gt;Gelecek Planları:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📄 Hesaplama sonuçlarının PDF olarak indirilmesi.&lt;/li&gt;
&lt;li&gt;🌍 Çoklu dil desteği (Döviz çevirici için).&lt;/li&gt;
&lt;li&gt;🔌 Public API (Diğer geliştiricilerin kullanması için).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bu teknik yolculukta edindiğim tecrübeleri paylaşmaya devam edeceğim. Projeyi incelemek isterseniz:&lt;a href="https://www.hemenhesap.com" rel="noopener noreferrer"&gt;hemenhesap.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kodla kalın, hatasız hesaplayın! 👨‍💻&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
