<?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: Yomumi</title>
    <description>The latest articles on DEV Community by Yomumi (@yomumi_moe).</description>
    <link>https://dev.to/yomumi_moe</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%2F4263997%2F2c6aa993-6677-4c85-b98a-7241c9774e80.jpg</url>
      <title>DEV Community: Yomumi</title>
      <link>https://dev.to/yomumi_moe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yomumi_moe"/>
    <language>en</language>
    <item>
      <title>Splitting Edge SSR and APIs with Astro, Cloudflare Workers, Bun, and Elysia</title>
      <dc:creator>Yomumi</dc:creator>
      <pubDate>Wed, 25 Nov 2026 06:28:17 +0000</pubDate>
      <link>https://dev.to/yomumi_moe/splitting-edge-ssr-and-apis-with-astro-cloudflare-workers-bun-and-elysia-3djf</link>
      <guid>https://dev.to/yomumi_moe/splitting-edge-ssr-and-apis-with-astro-cloudflare-workers-bun-and-elysia-3djf</guid>
      <description>&lt;p&gt;When you are a very small team building a multi-surface web platform on a tight budget, most architectural decisions come down to drawing clear boundaries early so one part of the stack does not drag down the rest.&lt;/p&gt;

&lt;p&gt;We are building &lt;strong&gt;Yomumi&lt;/strong&gt; (&lt;code&gt;yomumi.moe&lt;/code&gt;), an independent platform for original web novels, manga, webtoons, illustration, music, and seasonal anime discovery. Ahead of opening our Public Beta on 18 December 2026 (00:00 Asia/Bangkok), the public surface sits behind a pre-launch gate while we finish testing in an invite-only Alpha. Along the way, we settled on a split architecture: &lt;strong&gt;Astro&lt;/strong&gt; running on &lt;strong&gt;Cloudflare Workers&lt;/strong&gt; at the edge, paired with a &lt;strong&gt;Bun&lt;/strong&gt; and &lt;strong&gt;Elysia&lt;/strong&gt; backend backed by &lt;strong&gt;PostgreSQL&lt;/strong&gt; and &lt;strong&gt;Drizzle&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is why we separated the edge from the API, what actually runs where today, and a few practical lessons from treating edge routing, fonts, and crawler rules as first-class engineering work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why split the edge from the API?
&lt;/h2&gt;

&lt;p&gt;It is tempting for a small team to put everything into one full-stack framework or one container. The reason we kept them apart is that public pages and interactive creator/reader workflows have very different traffic patterns and failure modes.&lt;/p&gt;

&lt;p&gt;On the public side, pages like our pre-launch &lt;code&gt;/coming-soon/&lt;/code&gt; page, &lt;code&gt;/manifesto/&lt;/code&gt;, &lt;code&gt;/press/&lt;/code&gt;, and &lt;code&gt;/legal/&lt;/code&gt; notices are read-heavy, cacheable, and mostly static or lightweight edge SSR. They should respond cleanly even when backend services are restarting or under load. Meanwhile, the core application—authentication, watchlists, Creator Studio drafts, chapter unlocking, and search—needs stateful database transactions, background checks, and strict input validation.&lt;/p&gt;

&lt;p&gt;Splitting &lt;code&gt;yomumi.moe&lt;/code&gt; (Astro on Cloudflare Workers, with static assets and covers in Cloudflare R2) from &lt;code&gt;api.yomumi.moe&lt;/code&gt; (Bun + Elysia on Google Cloud Run with PostgreSQL) keeps those concerns isolated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Edge changes stay fast to ship:&lt;/strong&gt; Updating legal copy, press assets, or SEO metadata does not require touching the core API runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript stays shared in spirit, not coupled at runtime:&lt;/strong&gt; Both Astro and Elysia let us stay in TypeScript across frontend and backend without forcing every request through one monolithic process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asset delivery stays off the API server:&lt;/strong&gt; Web fonts, logos, and media cards serve directly from the edge/R2 rather than tying up application workers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Edge routing, pre-launch gates, and asset traps
&lt;/h2&gt;

&lt;p&gt;A pre-launch gate sounds trivial—redirect unauthenticated routes to &lt;code&gt;/coming-soon/&lt;/code&gt; with a &lt;code&gt;302&lt;/code&gt;—until you inspect what crawlers and browsers actually hit.&lt;/p&gt;

&lt;p&gt;Two real edge bugs we ran into and fixed during pre-launch audits are good reminders for anyone running a holding gate on Cloudflare Workers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Do not gate your own static assets or fonts.&lt;/strong&gt; Early on, a broad route gate caught font files (&lt;code&gt;/fonts/*.woff2&lt;/code&gt;), redirecting font requests to &lt;code&gt;/coming-soon/&lt;/code&gt; HTML instead of serving binary font files. Browsers fell back to system fonts, layout shifted on load, and page weight ballooned for no reason. Explicitly bypassing &lt;code&gt;/fonts/*&lt;/code&gt;, &lt;code&gt;/press/&lt;/code&gt; assets, &lt;code&gt;/robots.txt&lt;/code&gt;, and &lt;code&gt;/sitemap.xml&lt;/code&gt; before any gate redirect eliminated the layout shift immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep your sitemap honest about what returns &lt;code&gt;200&lt;/code&gt;.&lt;/strong&gt; If 25 or 30 routes behind an invite or dev gate return &lt;code&gt;302&lt;/code&gt; redirects, listing them in &lt;code&gt;/sitemap.xml&lt;/code&gt; tells search engines to crawl redirects. Trimming &lt;code&gt;/sitemap.xml&lt;/code&gt; down to only the five genuinely public &lt;code&gt;200&lt;/code&gt; routes (&lt;code&gt;/coming-soon/&lt;/code&gt;, &lt;code&gt;/legal/privacy/&lt;/code&gt;, &lt;code&gt;/legal/terms/&lt;/code&gt;, &lt;code&gt;/manifesto/&lt;/code&gt;, and &lt;code&gt;/press/&lt;/code&gt;) cleaned up crawl waste right away.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Treating crawlers and edge formats explicitly
&lt;/h2&gt;

&lt;p&gt;Because Yomumi is built for creators publishing original novels, comics, and art, crawler policy was not an afterthought. We wanted our stance—no AI training on creators' work—to be unambiguous both in legal terms and at the HTTP edge.&lt;/p&gt;

&lt;p&gt;At the same time, we learned an important distinction: &lt;strong&gt;&lt;code&gt;robots.txt&lt;/code&gt; and &lt;code&gt;noai&lt;/code&gt; meta tags are policy signals, not access control.&lt;/strong&gt; A scraper that spoofs a browser user agent will not obey a &lt;code&gt;Disallow&lt;/code&gt; line. Still, being explicit matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every public HTML page sends &lt;code&gt;index, follow&lt;/code&gt; alongside &lt;code&gt;noai, noimageai&lt;/code&gt;, and our default &lt;code&gt;robots.txt&lt;/code&gt; group sets &lt;code&gt;ai-train=no&lt;/code&gt; and &lt;code&gt;ai-input=no&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When we later decided to allow AI search-retrieval bots (&lt;code&gt;OAI-SearchBot&lt;/code&gt;, &lt;code&gt;Claude-SearchBot&lt;/code&gt;, &lt;code&gt;PerplexityBot&lt;/code&gt;) to answer search questions strictly from our public &lt;code&gt;/coming-soon/&lt;/code&gt; page—while keeping training blocked—we scoped &lt;code&gt;Allow: /coming-soon/$&lt;/code&gt; and &lt;code&gt;Content-Signal: /coming-soon/ ai-input=yes&lt;/code&gt; narrowly to that single path rather than opening the whole domain.&lt;/li&gt;
&lt;li&gt;We also added edge &lt;code&gt;text/markdown&lt;/code&gt; negotiation on public informational pages (&lt;code&gt;/coming-soon/&lt;/code&gt;, &lt;code&gt;/manifesto/&lt;/code&gt;, &lt;code&gt;/press/&lt;/code&gt;, &lt;code&gt;/legal/*&lt;/code&gt;), appending a clear notice that catalogue and chapter data load separately via the API and are not part of the static edge document.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separately, on private surfaces like our invite-only Alpha host (&lt;code&gt;alpha.yomumi.moe&lt;/code&gt;), returning &lt;code&gt;X-Robots-Tag: noindex, nofollow&lt;/code&gt; at the HTTP header level plus &lt;code&gt;Disallow: /&lt;/code&gt; ensures preview hosts never leak into search results even if someone links to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Bun + Elysia for the API
&lt;/h2&gt;

&lt;p&gt;On the backend (&lt;code&gt;api.yomumi.moe&lt;/code&gt;), running Bun with Elysia gave us a single TypeScript toolchain for REST endpoints, schema validation, WebSockets, and Drizzle ORM against PostgreSQL. Keeping the API cleanly separated behind its own subdomain also makes security boundaries easier to reason about: authentication, OAuth callbacks, and Studio endpoints live behind one API surface, while the Astro edge layer only handles rendering and public marketing routes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is next toward Beta
&lt;/h2&gt;

&lt;p&gt;As we move toward Public Beta on 18 December 2026, the remaining edge work is mostly discipline: flipping the gate cleanly without breaking public URLs, expanding &lt;code&gt;sitemap.xml&lt;/code&gt; to live localized routes with proper &lt;code&gt;hreflang&lt;/code&gt;, and keeping main-thread JavaScript lean on our Astro pages.&lt;/p&gt;

&lt;p&gt;If you have built a similar split between Astro on Cloudflare Workers and a Bun/Elysia backend—especially around pre-launch gating, localized routing, or edge caching—we would love to compare notes in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the Yomumi team with AI assistance, and reviewed against our live configuration before publishing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>astro</category>
      <category>bunjs</category>
      <category>cloudflare</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
