<?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: Zaqueu Nilton</title>
    <description>The latest articles on DEV Community by Zaqueu Nilton (@isccnewt).</description>
    <link>https://dev.to/isccnewt</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%2F2438989%2Fae531706-d082-4922-a3b1-2a87929c425a.jpg</url>
      <title>DEV Community: Zaqueu Nilton</title>
      <link>https://dev.to/isccnewt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/isccnewt"/>
    <language>en</language>
    <item>
      <title>Beyond Containers: Building Globally Distributed APIs with Bun, Elysia, and Turso.</title>
      <dc:creator>Zaqueu Nilton</dc:creator>
      <pubDate>Thu, 29 Jan 2026 23:25:59 +0000</pubDate>
      <link>https://dev.to/isccnewt/beyond-containers-building-globally-distributed-apis-with-bun-elysia-and-turso-2ii9</link>
      <guid>https://dev.to/isccnewt/beyond-containers-building-globally-distributed-apis-with-bun-elysia-and-turso-2ii9</guid>
      <description>&lt;p&gt;I love performance. If you, just like me, love it as well and want to leverage your application with blazing performance, today I bring a new approach to guide you through the process of understanding the Cloudflare Workers Universe.&lt;/p&gt;

&lt;p&gt;First of all, I would like to justify the stack. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bun is 17x faster than pnpm, 29x faster than npm and 33x faster than yarn&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is a complete runtime environment for the performance addicted. &lt;br&gt;
ElysiaJS is a backend stack built on Bun, and focuses on a very smooth developer experience. It is just cozy to build with it and my backend just gets faster than any Express around the globe.&lt;/p&gt;

&lt;p&gt;Turso is an blazing fast SQLite revival, focused on low latency and performance.&lt;/p&gt;

&lt;p&gt;Cloudflare workers is something I have discovered recently, and has since been my go-to when it comes to deploying a server or front-end applications.&lt;br&gt;
Unlike Railway or Render which put your code to sleep and brings the user to your code, Cloudflare workers bring the code to your user, since it has thousands of servers around the world.&lt;/p&gt;

&lt;p&gt;Said that, I would like to introduce you to Cloudflare workers, since I have not seen any detailed documentation on how to do it on this context.&lt;/p&gt;

&lt;p&gt;Now, you will have to set up your backend with ElysiaJS and your database with Turso. Once done that, there are a few things to configure before deploying your server.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Install Wrangler
&lt;/h2&gt;

&lt;p&gt;What on earth is it? The name is scary but it works just as cozy.&lt;br&gt;
It is the CLI tool that you use to deploy your server.&lt;br&gt;
Run this: &lt;br&gt;
&lt;code&gt;bun add -g wrangler&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Configure your wrangler.toml
&lt;/h2&gt;

&lt;p&gt;This file is the heart of your deployment. It tells Cloudflare who you are and what resources your app needs. Create a wrangler.toml in your server root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "my-awesome-api"
main = "src/index.ts"
compatibility_date = "2026-01-29"
compatibility_flags = [ "nodejs_compat" ]

[vars]
DATABASE_URL = "libsql://your-db-name.turso.io"
# Note: Use 'wrangler secret put AUTH_TOKEN' for your database token!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. The "No-Eval" Rule: Disabling AOT
&lt;/h2&gt;

&lt;p&gt;Elysia is incredibly fast because it uses AOT (Ahead-of-Time compilation) to generate optimized code. However, Cloudflare Workers has a strict security policy that disallows generating code from strings (no eval or new Function()).&lt;/p&gt;

&lt;p&gt;To make it work, simply pass aot: false to your Elysia constructor. Don't worry, it's still faster than most frameworks out there!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const app = new Elysia({ aot: false })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Respect the Global Scope (The Snapshot Rule)
&lt;/h2&gt;

&lt;p&gt;This is where most devs get stuck. Cloudflare Workers use V8 Isolates. They take a "snapshot" of your code's memory to make it boot in under 5ms.&lt;/p&gt;

&lt;p&gt;Because of this, you cannot open a database connection in the global scope (at the top of your file). If you do, the deploy will fail because you can't "take a photo" of a live network connection.&lt;/p&gt;

&lt;p&gt;The Solution? Lazy Initialization. Create a function that only connects to the database when a request actually hits your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// db.ts
export const getDb = (env: Env) =&amp;gt; {
  const client = createClient({
    url: env.DATABASE_URL,
    authToken: env.AUTH_TOKEN,
  });
  return drizzle(client);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Exporting for the Edge
&lt;/h2&gt;

&lt;p&gt;Forget app.listen(3000). In the Workers universe, Cloudflare is the one in charge. You need to export your app so Cloudflare can call its fetch handler whenever a user knocks on your door.&lt;/p&gt;

&lt;p&gt;instead of &lt;code&gt;export default app&lt;/code&gt;, do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default {
  fetch: (request: Request) =&amp;gt; {
    return app.fetch(request);
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, Cloudflare will pass the url through the fetch function of ElysiaJS and ✨&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Forget .env
&lt;/h2&gt;

&lt;p&gt;As mentioned earlier, you can put your environment variables in your wrangler.toml. If you did that, you can do &lt;code&gt;wrangler types&lt;/code&gt; and it will generate a file called "worker-configuration.d.ts". This file contains what Typescript needs to stop screaming at you.&lt;/p&gt;

&lt;p&gt;Abstract: You won't use process.env anymore. Instead, do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { env } from "cloudflare:workers";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But with a detail... your tsconfig.json, wherever you import it, has to include this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler", // Crucial para pacotes que usam subcaminhos como /cloudflare
    "strict": true,
    "skipLibCheck": true,
    "noEmit": true,
    "types": ["@cloudflare/workers-types"]
  },
  "include": ["index.ts", "..path/to/your/worker-configuration.d.ts"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. The Grand Finale: Deployment
&lt;/h2&gt;

&lt;p&gt;Now, the magic moment. Run the following command and watch your code being replicated to over 300 cities across the globe:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bunx wrangler deploy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Within seconds, you'll receive a .workers.dev URL. Congratulations! You just deployed a globally distributed, performance-addicted backend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building on the Edge is not just about speed; it's about a smarter way to handle resources. By using Bun, Elysia, and Turso inside Cloudflare Workers, you are skipping the heavy "cold starts" of Docker containers and bringing your data as close to your user as possible.&lt;/p&gt;

&lt;p&gt;It's cozy, it's fast, and it's the future of the web. 🚀&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>bunjs</category>
      <category>turso</category>
      <category>programming</category>
    </item>
    <item>
      <title>React/Tailwind template with default responsive NavBar.</title>
      <dc:creator>Zaqueu Nilton</dc:creator>
      <pubDate>Fri, 15 Nov 2024 18:08:19 +0000</pubDate>
      <link>https://dev.to/isccnewt/reacttailwind-template-with-default-responsive-navbar-3gko</link>
      <guid>https://dev.to/isccnewt/reacttailwind-template-with-default-responsive-navbar-3gko</guid>
      <description>&lt;p&gt;I was just annoyed with excluding App.test.js and all those default files that I would not use in my React project, and also I've never found a good navbar other than that free version of navbar from Tailwind UI website, which is not the best navbar I've got to see. Thinking of that, I created a template for any react project from scratch. I removed all unnecessary files, it's just the essential to start creating. &lt;br&gt;
You can see the live website following the link: &lt;a href="//react-twind-template.vercel.app"&gt;React/Tailwind template with default responsive NavBar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get started&lt;/strong&gt;&lt;br&gt;
To use this template is quite simple. You will do the same as you do with any React project you create, but you are going to add some parameters. Just move to your folder on your terminal and then execute the following line of code: &lt;br&gt;
&lt;code&gt;npx create-react-app my-project --template https://github.com/zaqueu-dev/react-tailwind-template&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And there you go! You initiated a new project with the template. Just open it on VScode and be happy, straight forward to creating instead of deleting files first.&lt;/p&gt;

&lt;p&gt;Look at how it looks:&lt;br&gt;
Desktop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqhqoicdxyls3ydzbcvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqhqoicdxyls3ydzbcvf.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mobile:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwb0jwgxyhpp0oar0xmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwb0jwgxyhpp0oar0xmv.png" alt="Image description" width="450" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85ljga4if687rjavx5mr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85ljga4if687rjavx5mr.png" alt="Image description" width="450" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to read the details about this template on my github: &lt;a href="https://github.com/zaqueu-dev/react-tailwind-template?tab=readme-ov-file" rel="noopener noreferrer"&gt;ReadMe for React/Tailwind template with default responsive NavBar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you enjoy the template :)&lt;br&gt;
If you have any idea on how to improve this default template, let me know by submitting an issue on the same github page: &lt;a href="https://github.com/zaqueu-dev/react-tailwind-template/issues" rel="noopener noreferrer"&gt;Tell me how it can be improved&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
