FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
How I Built a Multi-Tenant Documentation Platform with Next.js 15 (Subdomain Routing, MDX, and ISR)
NewsWeb Development

How I Built a Multi-Tenant Documentation Platform with Next.js 15 (Subdomain Routing, MDX, and ISR)

via Dev.to WebdevGautam1mo ago

I recently built Dokly , a documentation platform where users get instant subdomains (like acme.dokly.co ) for their docs. Think Mintlify/GitBook but affordable. Here's the technical deep-dive on how multi-tenant subdomain routing works in Next.js 15, including the gotchas that took me days to figure out. The Architecture Challenge The goal was simple: one Next.js app serving multiple purposes: dokly.co → Marketing site app.dokly.co → Dashboard (auth, editor) *.dokly.co → User documentation sites docs.acme.com → Custom domains (Pro feature) All from a single deployment. No separate apps. No complex infrastructure. The Secret: Middleware Routing Next.js middleware intercepts every request before it hits your pages. We use it to rewrite URLs based on the hostname. // middleware.ts import { NextResponse } from " next/server " ; import type { NextRequest } from " next/server " ; export function middleware ( request : NextRequest ) { const hostname = request . headers . get ( " host " ) ||

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
22 views

Related Articles

I Have Been Unemployed for Months as a Developer — Here’s Everything I Did to Stay Sane and Keep…
News

I Have Been Unemployed for Months as a Developer — Here’s Everything I Did to Stay Sane and Keep…

Medium Programming • 2d ago

The Most Dangerous Bugs Don’t Throw Errors
News

The Most Dangerous Bugs Don’t Throw Errors

Medium Programming • 2d ago

heerich.js - A tiny engine for 3D voxel scenes rendered to SVG
News

heerich.js - A tiny engine for 3D voxel scenes rendered to SVG

Lobsters • 2d ago

32 - Filter Assignments
News

32 - Filter Assignments

Dev.to • 2d ago

Hello everyone!
News

Hello everyone!

Medium Programming • 2d ago

Discover More Articles