Back to projects
Deno Link Shortener

Deno Link Shortener

HongYip Cheng / March 18, 2025


Demo: Link

šŸ“Œ Overview

A minimalist, dependency-free URL shortener built with:
āœ” 100% Deno (no Node.js/npm)
āœ” Pure TypeScript (strict mode)
āœ” Web Platform APIs (no frameworks)

Developed as part of Fireship's Deno Course between March 2-13, 2025


✨ Features

  • Zero Dependencies
    Uses only Deno's built-in modules
  • Realtime Link Creation
    Generate short URLs instantly
  • Deno KV Storage
    Built-in key-value database
  • TypeScript Patterns
    Generics, discriminated unions, and strict typing

šŸ› ļø Tech Stack

  • Deno: A secure JavaScript/TypeScript runtime with built-in tooling.
  • Deno KV: A built-in key-value database for persistent storage.
  • TypeScript: Strongly typed JavaScript for reliable code.
  • Web Platform APIs: Native browser APIs for DOM manipulation and styling.
  • Deno Deploy: Globally distributed hosting for Deno applications.

⚔ Quick Start

  1. Install Deno:

    curl -fsSL https://deno.land/x/install/install.sh | sh
    
  2. Run Locally:

    deno run --allow-net --allow-read --allow-write src/main.ts
  3. Access App:
    Visit http://localhost:8000


šŸ“‚ Project Structure

deno-short-link/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ main.ts        # Server entry point
│   ā”œā”€ā”€ types/         # TypeScript interfaces
│   ā”œā”€ā”€ utils/         # Shortening logic
│   └── static/        # Frontend assets
ā”œā”€ā”€ README.md          # This file
└── deno.json          # Deno config

šŸ“š Development Notes

Why No Dependencies?

  • Master core Web Platform APIs
  • Understand Deno's built-in capabilities
  • Avoid dependency bloat

Key Learnings:
āœ” Deno's native HTTP server
āœ” TypeScript advanced patterns
āœ” Deno KV for persistence

Conclusion

This link shortener website is a great way to learn more about http server routing, realtime stream listener, as well as basic user authentication. By using Deno for both frontend and backend, you can focus solely on mastering essential tools such as typescript and web platform APIs.