<?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: 胡亚洲</title>
    <description>The latest articles on DEV Community by 胡亚洲 (@huyazhou).</description>
    <link>https://dev.to/huyazhou</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%2F3870827%2F50473524-b503-42b5-9af0-443edc5245f6.png</url>
      <title>DEV Community: 胡亚洲</title>
      <link>https://dev.to/huyazhou</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/huyazhou"/>
    <language>en</language>
    <item>
      <title>I built the world's shortest URL shortener — here's how</title>
      <dc:creator>胡亚洲</dc:creator>
      <pubDate>Fri, 10 Apr 2026 03:43:25 +0000</pubDate>
      <link>https://dev.to/huyazhou/i-built-the-worlds-shortest-url-shortener-heres-how-1okn</link>
      <guid>https://dev.to/huyazhou/i-built-the-worlds-shortest-url-shortener-heres-how-1okn</guid>
      <description>&lt;p&gt;Every URL shortener claims to make links "short." But a Bitly link is 22 characters. TinyURL is 26. That's not short — that's just... shorter.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://y.hn" rel="noopener noreferrer"&gt;y.hn&lt;/a&gt;. Every link is 7 characters: y.hn/abc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does length matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SMS: 160 character limit. Every character counts.&lt;/li&gt;
&lt;li&gt;Twitter/X: Display text matters for readability.&lt;/li&gt;
&lt;li&gt;QR codes: Shorter URLs = simpler QR patterns = faster scanning.&lt;/li&gt;
&lt;li&gt;Print: Shorter URLs are easier to type manually.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The tech stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Framework: Next.js 16 (App Router)&lt;/li&gt;
&lt;li&gt;Database: PostgreSQL 16 with pgvector&lt;/li&gt;
&lt;li&gt;ORM: Drizzle ORM&lt;/li&gt;
&lt;li&gt;Auth: NextAuth v5 (Google, Apple, Email)&lt;/li&gt;
&lt;li&gt;Analytics: Custom-built click tracking (country, city, device, browser, UTM)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Anti-phishing at scale
&lt;/h2&gt;

&lt;p&gt;URL shorteners are a prime target for phishing. We built a 7-layer detection system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keyword blocklist matching&lt;/li&gt;
&lt;li&gt;Google Safe Browsing API&lt;/li&gt;
&lt;li&gt;PhishTank database&lt;/li&gt;
&lt;li&gt;URLhaus malware database&lt;/li&gt;
&lt;li&gt;VirusTotal (70+ security vendors)&lt;/li&gt;
&lt;li&gt;AI URL pattern analysis&lt;/li&gt;
&lt;li&gt;AI page content deep scanning&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The AI content scanner uses free LLM models (DeepSeek, Groq, Cerebras, SiliconFlow). Total cost: $0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Analytics without cookies
&lt;/h2&gt;

&lt;p&gt;We track clicks using hashed IP + user agent for unique visitor counting. No cookies needed. Geographic data comes from Cloudflare headers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://y.hn" rel="noopener noreferrer"&gt;y.hn&lt;/a&gt; — free, no account required for basic shortening. &lt;a href="https://y.hn/docs" rel="noopener noreferrer"&gt;API docs&lt;/a&gt; for developers.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
  </channel>
</rss>
