<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Akeleojo Achor on Medium]]></title>
        <description><![CDATA[Stories by Akeleojo Achor on Medium]]></description>
        <link>https://medium.com/@aakele?source=rss-c823291072da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_BoHQHxJnznXJVe9dE_kdQ@2x.jpeg</url>
            <title>Stories by Akeleojo Achor on Medium</title>
            <link>https://medium.com/@aakele?source=rss-c823291072da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:42:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aakele/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Theseus: A Modern, Edge-Powered URL Shortener with Next.js 16, Prisma & Upstash Redis]]></title>
            <link>https://medium.com/@aakele/building-theseus-a-modern-edge-powered-url-shortener-with-next-js-16-prisma-upstash-redis-411693ca2c06?source=rss-c823291072da------2</link>
            <guid isPermaLink="false">https://medium.com/p/411693ca2c06</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[nigerian-writing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Akeleojo Achor]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 17:02:09 GMT</pubDate>
            <atom:updated>2025-11-26T17:02:09.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2tQTMTjJ7GRdUFEpA9C7g.jpeg" /></figure><p>URL shorteners seem simple at first, but things get tricky when you have to handle collisions, stop abuse, cache data worldwide, and keep redirects under 50ms no matter where users are. When I began building Theseus, my goal was to learn how these systems work at scale by using the latest features in Next.js 16, the reliability of PostgreSQL with Prisma, and the global speed of Upstash Redis.</p><p>In this article, I’ll explain the architecture, the thinking behind it, and the trade-offs involved in building a URL shortener ready for real-world use.</p><h3>Why This Architecture?</h3><p>A production URL shortener must be:</p><p><strong>Quick</strong> : redirects should feel instant, regardless of geography<br> <strong>Scalable</strong>: caching and rate-limiting need to work across regions<br> <strong>Safe</strong> : validation must prevent garbage input<br> <strong>Predictable</strong> : API responses should follow a clear contract<br> <strong>Edge-friendly</strong> : latency must stay low globally</p><p>Theseus attempts to accomplish this through a layered approach:</p><ul><li><strong>Edge runtime</strong> for high-speed redirects</li><li><strong>Node.js runtime</strong> for Prisma DB writing</li><li><strong>Redis caching</strong> for global hot paths</li><li><strong>Zod validation</strong> to structure inputs</li><li><strong>Rate limiting</strong> to prevent abuse.</li><li><strong>Smart fallback design</strong> for cache misses</li></ul><p>Let’s break down each layer.</p><h3>1. The Shortening API: Precision and Protection</h3><p>Shortening a URL seems trivial — accept a link, store a code. But to do it properly, you must guard against malformed payloads, abuse, conflicting aliases, and domain mismatch.</p><p>The shortener endpoint (app/api/shorten/route.ts) handles four critical jobs:</p><h3>1. Input Validation with Zod</h3><p>Instead of trusting JSON blindly, Zod enforces type safety:</p><ul><li>long_url must be a valid http/https URL</li><li>custom_alias is optional but trimmed of whitespace</li><li>An empty alias means auto-generation</li></ul><p>Validation errors return structured 400 responses with field-level details, easing debugging for API consumers.</p><h3>2. IP-Based Rate Limiting</h3><p>URL shorteners are easy targets for spammers. Each POST request goes through a Redis-backed limiter:</p><ul><li>30 requests per minute per IP</li><li>Fast lookup via Redis GET/SET</li><li>Shared across all deployments</li></ul><p>If a client exceeds the limit, the API returns a 429 response with a Retry-After header.</p><h3>3. Dynamic Base Domain</h3><p>Theseus doesn’t hard-code its output domain. It checks:</p><ol><li>BASE_URL from environment (for production custom domains)</li><li>Falls back to the origin of the incoming request</li></ol><p>This means:</p><ul><li>Locally → <a href="http://localhost:3000/xyz">http://localhost:3000/xyz</a></li><li>Vercel deployment → <a href="https://theseus.vercel.app/xyz">https://theseus.vercel.app/xyz</a></li><li>Custom domain → <a href="https://hrm.es/xyz">https://hrm.es/xyz</a></li></ul><p>Auto-adaptive, zero manual config.</p><h3>4. Collision Handling</h3><p>Two scenarios:</p><ul><li>If a custom alias already exists → return <strong>409 Conflict</strong></li><li>If the random code already exists, generate a new one and try up to 5 times total.</li></ul><p>This retry loop should guarantee stability even at millions of links.</p><h3>2. Edge-Based Redirects: Optimized for Speed</h3><p>Redirects live at app/[code]/route.ts and run on the Edge Runtime near users.</p><p>The redirect flow prioritizes minimum latency:</p><h3>Step 1 — Check Redis</h3><p>The handler queries Upstash Redis:</p><pre>GET url:{code} → longUrl</pre><p>If the result exists, that’s an instant redirect ; typically under 1ms.</p><h3>Step 2 — Cache Miss → Fallback to Node API</h3><p>If Redis doesn’t have the link:</p><ol><li>Call /api/get?code=… (runs on Node runtime)</li><li>That endpoint queries Postgres via Prisma.</li><li>Edge function automatically warms the Redis cache.</li></ol><p>This creates a two-tier lookup: a fast path Edge → Redis) and a slow path (Edge → Node → Postgres) that self-heals.</p><h3>Step 3 — Serve a Permanent Redirect</h3><p>The final response is a <strong>301 Moved Permanently</strong> with long-lived caching headers:</p><pre>Cache-Control: public, max-age=31536000, immutable</pre><pre>CDN-Cache-Control: public, s-maxage=31536000, immutable</pre><p>This allows browsers, Vercel’s CDN, and intermediate caches to store the redirect for one full year. After the first hit, the redirect is essentially free forever.</p><h3>3. The Database Layer: Clean and Contained</h3><p>A dedicated repo.ts file isolates all database logic:</p><ul><li>Singleton Prisma client</li><li>repoCreate(code, long_url)</li><li>repoGet(code)</li><li>Graceful handling of Prisma’s unique constraint errors</li></ul><p>Route handlers never touch raw database code. This keeps the system modular:</p><ul><li>Edge redirect doesn’t know anything about Prisma.</li><li>The “get” endpoint is the only place that queries Postgres.</li><li>Swapping the DB layer (e.g., to Neon serverless) becomes trivial.</li></ul><p>Separation of concerns makes the codebase maintainable and testable.</p><h3>4. Caching, Throttling &amp; Safety Nets</h3><p>Theseus uses Upstash Redis for two kinds of operations:</p><h3>1. Redirect Cache</h3><p>Stores code → long URL mappings for fast redirects.</p><h3>2. Rate Limiting Keys</h3><p>Stores per-IP counters with 60-second expiry.</p><h3>Why Redis, Not In-Memory?</h3><p>Scalability. You want:</p><ul><li>Multiple Edge regions</li><li>Multiple server instances</li><li>Multiple deployments</li></ul><p>A single shared Redis instance keeps limits and cache consistent globally. In-memory caching breaks the moment you scale horizontally.</p><h3>5. The Frontend: A Brutalist Terminal UI</h3><p>The UI uses a kind of neon green brutalist theme with monospace typography. While stylized, it demonstrates:</p><ul><li>Clean React state management</li><li>Predictable loading states</li><li>Client-side QR code rendering</li><li>Clipboard copy UX</li></ul><p>The interface shows that the backend is able to integrate with real client logic.</p><h3>6. Why This Architecture Works</h3><p>Theseus is intentionally layered:</p><p><strong>Edge layer</strong> → Handles real-time redirects with microsecond latency<br><strong>Node API layer</strong> → Handles all DB writes, validation, and logic requiring heavy libraries<br> <strong>Database layer</strong> → Keeps persistence concerns isolated through Prisma<br> <strong>Cache layer</strong> → Ensures speed, global consistency, and protection from abuse</p><p>This separation brings the best of all worlds:</p><ul><li>Edge runtime → speed</li><li>Node runtime → compatibility</li><li>Redis → scalability</li><li>Postgres → permanence</li><li>Next.js → developer happiness</li></ul><p>Each layer does one thing well, and the boundaries between them are clean.</p><h3>7. What I Learned Building This</h3><p>A project like Theseus demonstrates to you:</p><ul><li>The difference between Edge and Node runtimes</li><li>Why Redis is essential for high-read-frequency systems</li><li>How to structure an API for real clients</li><li>Why input validation matters at the boundary</li><li>How route handlers behave under load</li><li>How CDNs actually cache redirects</li><li>Why Prisma shouldn’t run at the Edge</li><li>How to think about layering, separation, and reliability</li></ul><h3>What I’d Change</h3><p>No system is perfect. Here’s what I think is missing:</p><ul><li><strong>No analytics</strong> : I could add lightweight event tracking</li><li><strong>No soft deletes</strong> : currently, hard deletes only</li><li><strong>No custom expiry</strong> : all links are permanent.</li></ul><p>These aren’t blockers, but they’d be the first improvements if I were to do a V2.</p><h3>Conclusion</h3><p>Theseus isn’t just another URL shortener — it attempts to study distributed systems design. It shows how modern web frameworks like Next.js 16 can power real-world infrastructure when combined with the right primitives: Edge computing, serverless databases, and global caching.</p><p>The website is live at <a href="https://theseus-iota.vercel.app/">https://theseus-iota.vercel.app/</a>, and the github repo is at <a href="https://github.com/AkeleA/theseus">https://github.com/AkeleA/theseus</a> <br>Check it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=411693ca2c06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Modern Developer’s Guide to i18n: Why next-intl is Changing Everything]]></title>
            <link>https://medium.com/@aakele/the-modern-developers-guide-to-i18n-why-next-intl-is-changing-everything-7a459d85f6e0?source=rss-c823291072da------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a459d85f6e0</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Akeleojo Achor]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 14:33:34 GMT</pubDate>
            <atom:updated>2025-09-25T14:33:34.590Z</atom:updated>
            <content:encoded><![CDATA[<p>What do McDonald’s, Netflix, Google, Microsoft, and every top SaaS have in common? They know speaking your users’ language isn’t just polite — it’s profitable.</p><p>Yet some developers still treat internationalization (i18n) like a scary project for “someday” — one with complex routes, translation files to juggle, and dreaded “the site broke in French” emergencies.</p><p>But what if I told you that modern i18n could be implemented in your React app in under 30 minutes? What if the process can go from overtly complex to… <em>fun</em>?</p><h3>The Real Cost of English-Only Thinking</h3><p>Let’s start with some sobering data. According to CSA Research, <strong>72.4% of users are more likely to use your services when information is presented in their native language</strong>. Even more striking, the Common Sense Advisory found that <strong>60% of global consumers rarely or never buy from English-only websites</strong>.</p><p>Think about that for a moment. In a world where 4.95 billion people use the internet, building English-only websites is basically passing a message that only English speakers can relate to. Sure, some people will get the message, but you’re alienating a lot of other people.</p><p>This is more than being inclusive (though that matters enormously). This is about the reality of business in a global marketplace.</p><h3>With the global opportunity clear, let’s see how next-intl truly changes the game.</h3><p>Traditional i18n solutions have always felt like wrestling with a hydra. Solve one problem, and three more appear: route configuration breaks, translations go missing in production, pluralization rules make you question your life choices, and date formatting across different locales gives you a head-splitting headache.</p><p>Consider this: In the old system, you’d configure a route like this:</p><p>// Traditional Routing</p><p>app.get(‘/en/about’, …);</p><p>But with next-intl, it becomes significantly more intuitive:</p><p>// next-intl Routing</p><p>pages[‘/about’] = ‘about-page’;</p><p>pages[‘/en/about’] = ‘about-page-en’;</p><p>pages[‘/fr/about’] = ‘about-page-fr’;</p><p>Next-intl changes this entire paradigm. Built specifically for modern React applications and Next.js App Router, it treats internationalization as a first-class citizen rather than an afterthought bolted onto your application.</p><p>Here’s what makes it different: instead of fighting your framework, it works <em>with</em> it. Instead of runtime surprises, it gives you compile-time safety. Instead of configuration hell, it provides sensible defaults that just work.</p><h3>The Moments That Make i18n Click.</h3><p>After working with Next-Intl across several projects, there are three moments that completely changed how I think about internationalization:</p><h3>Moment 1: TypeScript-Safe Translations</h3><pre>const t = useTranslations(&#39;Navigation&#39;);<br>return &lt;h1&gt;{t(&#39;welcome&#39;)}&lt;/h1&gt;; // TypeScript k\nows this key exists</pre><p>No more runtime errors from typos. No more broken translations making it to production. TypeScript integration means your IDE catches translation issues before your users do.</p><h3>Moment 2: Pluralization That Actually Works</h3><pre>{<br>  &quot;items&quot;: &quot;{count, plural, =0 {No items} =1 {One item} other {# items}}&quot;<br>}</pre><p>ICU message syntax built into next-intl handles the linguistic complexity, so you don’t have to. It understands that different languages have different pluralization rules, and it handles them automatically.</p><h3>Moment 3: SEO That Scales Globally</h3><p>Your routes automatically become:</p><ul><li>/en/about</li><li>/fr/a-propos</li><li>/es/acerca-de</li></ul><p>Search engines love it. Users find content in their language. Your organic traffic grows. It’s not magic — it’s just good engineering that considers the global web from day one.</p><h3>The Development Experience Revolution</h3><p>What used to take days now takes minutes. Adding a new language to your application becomes as simple as:</p><ol><li>Creating a new JSON file in your /messages/ directory</li><li>Adding the locale to your configuration</li><li>Deploying</li></ol><p>That’s it. No complex build processes. No route reconfiguration. No breaking changes to existing code.</p><p>The middleware handles locale detection intelligently, respecting user preferences while providing manual overrides. The request-level configuration allows you to customize behavior per locale without performance penalties.</p><pre>export default getRequestConfig(async ({ requestLocale }) =&gt; {<br>  const locale = await requestLocale;<br>  return {<br>    locale,<br>    messages: await import(`../messages/${locale}.json`).then(m =&gt; m.default)<br>  };<br>});</pre><h3>Why This Matters More Than Ever</h3><p>The web is global by default, but too many applications are still built with a single-language mindset. This isn’t just about missing revenue opportunities — it’s about digital inclusion in an increasingly connected world.</p><p>Consider the developer experience improvements alone: type-safe translations mean fewer bugs, automatic locale detection means better User Experience, and proper SEO structure means organic growth. These aren’t nice-to-haves; they’re necessary for competitive advantage.</p><h3>Getting Started: Less Scary Than You Think</h3><p>If you’re building anything user-facing in 2025 and haven’t considered i18n, start small. Pick a second language — maybe Spanish if you’re an English speaker, or English if you’re not. Use next-intl to implement it properly from the start.</p><p>You’ll find that the hardest part isn’t the technical implementation — it’s changing your mindset from “English-first” to “global-first.” Once you make that shift, the tools support you every step of the way.</p><p>The web is borderless. Isn’t it time your applications were too?</p><p><em>What’s been your experience with internationalization? Have you encountered any memorable translation bugs or cultural localization challenges? I’d love to hear your stories in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a459d85f6e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Next.js: The Growing Choice for Developers and Vercel’s Remarkable Contribution]]></title>
            <link>https://medium.com/@aakele/exploring-next-js-the-growing-choice-for-developers-and-vercels-remarkable-contribution-493b0fce5171?source=rss-c823291072da------2</link>
            <guid isPermaLink="false">https://medium.com/p/493b0fce5171</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Akeleojo Achor]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 12:38:05 GMT</pubDate>
            <atom:updated>2023-06-29T16:50:09.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxaAmDry1AlFqLJQnfM4DQ.jpeg" /></figure><p>It was less than a week ago when a friend and I sat down to plan a project we had wanted to do for almost 3 months. While discussing the design and implementation, he said, “I’d like to build using Next.js.” “That’s new”, I thought, because we have never worked with Next.js. Curious, I asked him to explain why Next.js is better.</p><p>So, why is Next.js growing in popularity?</p><p>In the ever-evolving world of web development, Next.js has quickly become a preferred framework worldwide. Its seamless integration with Vercel and unique features make it stand out. Let’s dive into why Next.js is gaining popularity and how it surpasses React in certain aspects, all while recognizing Vercel’s significant contributions.</p><ul><li>Server-side rendering (SSR) and Static Site Generation (SSG) <br>These are built-in features of Next.js. They enable developers to generate pre-rendered HTML pages on the server, resulting in better performance, improved SEO, and enhanced user experiences. In contrast, React primarily focuses on client-side rendering, necessitating additional configurations for server-side rendering.</li><li>Automatic Code splitting<br>Next.js embraces automatic code splitting, dividing JavaScript bundles into smaller chunks for efficient loading. This feature reduces initial load times and enhances overall performance by sending only the necessary code to the client. In contrast, React.js requires manual configuration or the use of third-party libraries like React Loadable or React.lazy to achieve code splitting.</li><li>Incremental Adoption<br>Next.js allows for easy incremental adoption, making it an ideal choice for both new projects and existing React.js applications. Developers can gradually introduce Next.js into their projects, benefiting from its additional features without rewriting the entire codebase.</li><li>API Routes<br>API routes in Next.js provide a convenient way to create serverless API endpoints directly within your Next.js application. These endpoints enable you to handle HTTP requests and execute server-side logic without the need for an additional server setup.</li></ul><p>Here’s an example to illustrate the usage of API routes in Next.js:</p><p>Create an API endpoint:</p><pre>// pages/api/example.js<br>export default function handler(req, res) {<br> const data = { message: &#39;Hello, API!&#39; };<br> res.status(200).json(data);<br>}</pre><p>Access the API endpoint:</p><p>With the API endpoint defined, you can access it using the following URL: /api/example. This URL corresponds to the file structure within the pages/api directory.</p><p>When a request is made to /api/example, the handler function is invoked. In this example, it sends a JSON response with the message “Hello, API!” and a status code of 200.</p><p>Comparatively, in a React.js project without Next.js, setting up API endpoints typically requires configuring a separate server, such as using Express.js or other frameworks. Next.js simplifies this process by integrating API routing directly into the project structure.</p><p>Vercel, the company behind Next.js, has played a significant role in its success. Vercel provides a powerful platform for hosting and deploying Next.js applications seamlessly. Its features include automatic SSL certificates, serverless functions, and CDN distribution. Vercel’s commitment to developer experience and continuous improvement has earned immense popularity and trust.</p><p>Next.js has gained popularity among developers due to its powerful features, seamless integration with React.js, and the remarkable contributions of Vercel. Its support for SSR, SSG, automatic code splitting, incremental adoption, and built-in API routes make it an appealing choice for modern web application development. The collaboration between Next.js and Vercel has paved the way for a smoother development and deployment experience, empowering developers to create high-performance applications effortlessly. As the web development landscape continues to evolve, Next.js and Vercel remain extremely relevant, revolutionizing the way we build web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=493b0fce5171" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>