<?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>DEV Community: John Doe </title>
    <description>The latest articles on DEV Community by John Doe  (@templatesbylumen).</description>
    <link>https://dev.to/templatesbylumen</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2586640%2F2198cfb8-6e51-479b-9a4f-7d5dbbbd9a41.png</url>
      <title>DEV Community: John Doe </title>
      <link>https://dev.to/templatesbylumen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/templatesbylumen"/>
    <language>en</language>
    <item>
      <title>I built a dental clinic website template with Next.js 16 — 5 things that bit me</title>
      <dc:creator>John Doe </dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:55:44 +0000</pubDate>
      <link>https://dev.to/templatesbylumen/i-built-a-dental-clinic-website-template-with-nextjs-16-5-things-that-bit-me-2l7o</link>
      <guid>https://dev.to/templatesbylumen/i-built-a-dental-clinic-website-template-with-nextjs-16-5-things-that-bit-me-2l7o</guid>
      <description>&lt;p&gt;I spent the last couple of weeks building a website template for dental clinics, mostly to learn the Next.js 16 App Router properly: static rendering with &lt;code&gt;next-intl&lt;/code&gt;, &lt;code&gt;next/og&lt;/code&gt;, the new &lt;code&gt;proxy.ts&lt;/code&gt;, Tailwind 4. The free version is MIT on GitHub, the full one has booking, a gallery and a second language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free lite (MIT): &lt;a href="https://github.com/aivnaov123/lumen-dental-lite" rel="noopener noreferrer"&gt;https://github.com/aivnaov123/lumen-dental-lite&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Live demo of the full version: &lt;a href="https://lumen-dental-demo-brown.vercel.app" rel="noopener noreferrer"&gt;https://lumen-dental-demo-brown.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the five things that cost me the most time, so they don't cost you.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Every page silently became dynamic
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;next-intl&lt;/code&gt; and a &lt;code&gt;[locale]&lt;/code&gt; segment, I had &lt;code&gt;generateStaticParams&lt;/code&gt; in the layout and assumed everything was prerendered. The build output said otherwise: every route was &lt;code&gt;ƒ (Dynamic)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The cause: &lt;code&gt;getLocale()&lt;/code&gt; (and anything that reads the locale) falls back to request headers unless &lt;strong&gt;each page&lt;/strong&gt; calls &lt;code&gt;setRequestLocale(locale)&lt;/code&gt; — the layout alone isn't enough.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;ServicesPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;params&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="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;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="nf"&gt;setRequestLocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;copy&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getContent&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;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding it to all 11 pages: 30 static pages, 60 ms TTFB on Vercel. Check your build output for &lt;code&gt;●&lt;/code&gt; vs &lt;code&gt;ƒ&lt;/code&gt; — it's easy to miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The root &lt;code&gt;opengraph-image.tsx&lt;/code&gt; 404'd in production
&lt;/h2&gt;

&lt;p&gt;I put &lt;code&gt;opengraph-image.tsx&lt;/code&gt; in &lt;code&gt;src/app/&lt;/code&gt;, as the docs show. Locally it worked; on Vercel &lt;code&gt;/opengraph-image&lt;/code&gt; returned 404 and no &lt;code&gt;og:image&lt;/code&gt; tag was emitted.&lt;/p&gt;

&lt;p&gt;The i18n middleware matcher excluded files with an extension (&lt;code&gt;.*\..*&lt;/code&gt;) — but &lt;code&gt;/opengraph-image&lt;/code&gt; has none, so it was treated as a page and routed to the locale handler.&lt;/p&gt;

&lt;p&gt;Fix: move it inside the segment, &lt;code&gt;src/app/[locale]/opengraph-image.tsx&lt;/code&gt;, read &lt;code&gt;params.locale&lt;/code&gt;, and you get a per-language OG image for free:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generateStaticParams&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="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;routing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;locales&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;locale&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="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;OpenGraphImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;params&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="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;copy&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;contentFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ImageResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. &lt;code&gt;toISOString().slice(0, 10)&lt;/code&gt; lost a day
&lt;/h2&gt;

&lt;p&gt;The booking calendar stored the selected date as &lt;code&gt;date.toISOString().slice(0, 10)&lt;/code&gt;. In Sofia (UTC+2), clicking Monday the 23rd produced &lt;code&gt;2026-11-22&lt;/code&gt; — Sunday, which the clinic is closed on. Classic, and I still wrote it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;toISODate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sb"&gt;`${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything that represents a calendar day should never go through UTC.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The hero was invisible until JavaScript loaded
&lt;/h2&gt;

&lt;p&gt;Lighthouse mobile gave the home page a 62. LCP was 4.6 s even though the hero image was 23 KB. The culprit was Framer Motion: &lt;code&gt;initial={{ opacity: 0 }}&lt;/code&gt; on the hero meant the largest element painted only after hydration on a throttled CPU.&lt;/p&gt;

&lt;p&gt;Two changes took it to 91:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Above the fold, animate &lt;strong&gt;transform only&lt;/strong&gt;, in CSS, so first paint isn't gated on JS:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="nt"&gt;rise&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Below the fold, keep Framer Motion but load it lazily with &lt;code&gt;LazyMotion&lt;/code&gt; + &lt;code&gt;m&lt;/code&gt; instead of &lt;code&gt;motion&lt;/code&gt; — JS on the home page dropped from 342 KB to 179 KB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also: &lt;code&gt;useSearchParams()&lt;/code&gt; inside &lt;code&gt;Suspense&lt;/code&gt; with an empty fallback made the booking page's footer jump (CLS 0.47). A skeleton with the same height fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Custom 404 never showed
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;[locale]/not-found.tsx&lt;/code&gt; is only rendered when something calls &lt;code&gt;notFound()&lt;/code&gt;. Unknown URLs under a dynamic segment don't — Next served its plain default 404. A catch-all route solves it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/app/[locale]/[...rest]/page.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;notFound&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next/navigation"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;CatchAll&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="nf"&gt;notFound&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's in the template
&lt;/h2&gt;

&lt;p&gt;All copy lives in &lt;code&gt;src/content/&amp;lt;locale&amp;gt;/*.ts&lt;/code&gt;, shared config in &lt;code&gt;src/config/&lt;/code&gt;. Nine services, six doctors, booking with calendar/slots/validation and email or webhook delivery, before/after sliders, financing section, dark mode, EN + BG, schema.org &lt;code&gt;Dentist&lt;/code&gt; JSON-LD, sitemap/robots/manifest. Lighthouse 100 desktop, 90+ mobile.&lt;/p&gt;

&lt;p&gt;If you build sites for clinics, the full version is a one-time purchase (link in the repo README). If you just want to poke at the Next.js 16 setup, the lite is free — PRs and issues welcome.&lt;/p&gt;

&lt;p&gt;Happy to answer questions about any of the above in the comments.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
