Back to projects

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
-
Install Deno:
curl -fsSL https://deno.land/x/install/install.sh | sh
-
Run Locally:
deno run --allow-net --allow-read --allow-write src/main.ts
-
Access App:
Visithttp://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.