Skip to content

code/app-shorty-dot-dev

 
 

Repository files navigation

shrty.dev

A #BuildInPublic URL shortening service built on the Cloudflare Developer Platform.

What it uses

  • Workers — Runtime
  • Hono — Web framework
  • KV — Stores slug-to-URL mappings
  • Workers Analytics Engine — Tracks and reports on click events with geo metadata
  • Workers AI — Powers the admin chat interface (@cf/zai-org/glm-4.7-flash) with tool calling

Admin

  • /admin/ — Chat interface for managing shorties via natural language (create links, query analytics)
  • /admin/analytics.html — Dashboard showing click counts per slug over the past 3 months

Resources

Watch shrty.dev Admin AI on YouTube

Setup your own

Prerequisites

Create a KV namespace for URL storage:

npx wrangler kv namespace create URLS

Update the kv_namespaces id in wrangler.jsonc with the returned namespace ID.

Create a Workers Analytics Engine API token with read access.

Copy .dev.vars.example to .dev.vars and fill in the values:

cp .dev.vars.example .dev.vars

Generate types:

npm run cf-typegen

Development

npm install
npm run dev

Deployment

npm run deploy

About

A URL Shortener built on Cloudflare Developer Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 42.6%
  • HTML 36.0%
  • JavaScript 10.8%
  • CSS 10.6%