Skip to content
andesvelPublic

About

πŸ”— An URL shortener with in-app browser detection & escape powered by Cloudflare Workers.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

528 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

nuto-banner

πŸ”— Nuto is a smart URL shortener designed to escape in-app browsers and open links where they belong: in the user's native browser or the corresponding native application. Available in English and Spanish at nuto.dev.

The name "Nuto" comes from the Spanish word "diminuto" (tiny), reflecting its purpose of making long URLs tiny.

🀝🏻 This project's UI was highly influenced by Pheralb's slug. πŸ—Ώ

React Router Cloudflare shadcn/ui Check workflow Deploy workflow GitHub issues License: GPL v3

nuto-dashboard-desktop

πŸ“š Table of Contents

✨ Key Features

  • In-App Browser Escape: Short links opened inside Instagram, TikTok, Facebook, Messenger, Threads, X, Snapchat, LinkedIn, WhatsApp, Telegram, Pinterest, Reddit, Discord and other in-app browsers jump to the device's real browser. The whole site does it too: opening nuto.dev from an Instagram chat reopens it in Safari or Chrome, and a banner offers it again if you come back.
  • Deep Linking: On Android, links to 20+ apps open straight in the app from any browser, with the web as fallback: YouTube, YouTube Music, Spotify, Apple Music, SoundCloud, Deezer, Amazon Music, Twitch, Netflix, Prime Video, Disney+, Instagram, Threads, TikTok, X, WhatsApp, Telegram, Discord, LinkedIn, Amazon, Mercado Libre and Google Maps. On iOS, YouTube, Spotify and WhatsApp links open their apps from in-app browsers; everything else goes to Safari, where each app's universal links take over.
  • QR Codes: Every link has a QR code (brand or black, transparent background, optional logo) to download as PNG or SVG or copy. Scans are counted separately from taps.
  • Analytics: Clicks over time, change against the previous period, share of clicks rescued from in-app browsers, QR scans, top links, apps, countries, devices and busiest hours, for 7/30/90 days or all time, per link or overall, with a live view of the last hour.
  • Password Protection: Visitors enter a password before being redirected. Passwords are hashed with salted PBKDF2, attempts are rate limited, and owners reveal them on demand.
  • Link Expiration: Links stop redirecting after a date you pick and answer 410 Gone.
  • Custom Short Codes: Pick your own code or generate one.
  • Privacy-Friendly: Clicks store only time, country, user agent and derived app/device/QR flags. IP addresses are never stored.
  • English and Spanish: The whole app, Clerk's sign-in included, with Spanish pages under /es.
  • SEO and AI-ready: Canonical and hreflang tags, a bilingual sitemap, Open Graph images per language, JSON-LD (WebApplication and FAQ) and an llms.txt.
  • Authentication: Email, GitHub and Google sign-in, managed with Clerk.

πŸ› οΈ Tech Stack

πŸš€ Getting Started

Prerequisites

You will need the following to run Nuto locally:

Wrangler comes with the project's dev dependencies; run it with pnpm exec wrangler.

1. Installation

git clone https://github.com/andesvel/nuto.git
cd nuto
pnpm install

2. Environment Setup

Non-secret variables (VITE_CLERK_PUBLISHABLE_KEY and Clerk's redirect URLs) live in wrangler.jsonc under vars. Put the secrets in .dev.vars (gitignored):

CLERK_SECRET_KEY="sk_..."
CLERK_WEBHOOK_SECRET="whsec_..."
# base64-encoded 32 random bytes, e.g. `openssl rand -base64 32`
PASSCODE_ENC_KEY="..."

3. Local Database

Create the local D1 schema once:

pnpm exec wrangler d1 execute nuto-db --local --file=./schema.sql

4. Development Server

pnpm dev

Your application will be available at http://localhost:5173. pnpm preview builds and serves the production bundle instead (with the production Content-Security-Policy).

πŸ§ͺ Testing and Code Quality

pnpm vitest run       # full suite against real D1/KV via Miniflare (what CI runs)
pnpm run typecheck    # wrangler types + react-router typegen + tsc
pnpm exec eslint app components utils

☁️ Deployment

Cloudflare Workers handles both the SSR routing (via React Router) and the API.

1. Provision Cloudflare Resources (First time only)

Log in to Cloudflare:

pnpm exec wrangler login

Create the D1 database:

pnpm exec wrangler d1 create nuto-db

(Update wrangler.jsonc with the new database_id)

Create the KV namespace (for production and preview):

pnpm exec wrangler kv namespace create URL_STORE
pnpm exec wrangler kv namespace create URL_STORE --preview

(Update wrangler.jsonc with the corresponding id and preview_id)

The password rate limiter (PASSWORD_LIMITER) is declared in wrangler.jsonc and needs no setup.

2. Configure Secrets

pnpm exec wrangler secret put CLERK_SECRET_KEY
pnpm exec wrangler secret put PASSCODE_ENC_KEY
pnpm exec wrangler secret put CLERK_WEBHOOK_SECRET

3. Initialize the Database

For a new database, apply the full schema:

pnpm exec wrangler d1 execute nuto-db --remote --file=./schema.sql

For an existing database created from an older schema, run the numbered files in migrations/ that it hasn't had yet, before deploying the code that needs them:

pnpm exec wrangler d1 execute nuto-db --remote --file=./migrations/0002_click_attribution.sql

4. Deploy

pnpm deploy

In this repository, deploys run from GitHub Actions instead: every push to main deploys after checking that main is a merge of a dev commit that passed CI.

🀝 Contributing

Work flows from small to big: a feature branch (feat/, fix/, refactor/, test/, docs/) β†’ dev β†’ main.

  • Open pull requests against dev. CI (Code Quality & Tests: eslint, typecheck, Vitest) runs on every PR and push to dev.
  • main is production. It only receives dev through a merge commit, and each push to it deploys to Cloudflare Workers.
  • Keep commits small and atomic, and run the test suite before each one.

AGENTS.md documents the codebase conventions (data access, KV cache, i18n, analytics, security) in more detail.

πŸ—ΊοΈ Roadmap

Here's a look at the current state and future plans for Nuto.

  • βœ… Stable
  • 🚧 In Development
  • πŸ€” To Be Decided (TBD)
Feature Status Details
Core Functionality βœ… URL shortening, redirection, in-app browser escape and click tracking.
Link Management βœ… Create, view, edit, delete, search and sort links.
UI/UX βœ… Click-to-copy, notifications, responsive design, view transitions, light and dark themes.
Security βœ… Password-protected links, expiration dates, rate limiting, CSP.
Authentication βœ… Email, GitHub and Google through Clerk.
QR Codes βœ… Generation, styling and export (PNG/SVG), with scan tracking.
Dashboard Analytics βœ… Charts, breakdowns, per-link analytics and a live view.
Languages βœ… English and Spanish, with Spanish SEO.
Custom Domains πŸ€” Short links on your own domain.
Link Organization πŸ€” Tags or folders for large link lists.

πŸ› Known Issues

No known issues right now. Found one? Open an issue.

πŸ”— Related projects

  • slug - 🌱 An open-source URL shortener built with T3 Stack.
  • midu.link - Create shorten urls easily with Cloudfare Workers.
  • inapp-debugger - Test common in-app issues.
  • inapp-spy - Detect in-app browsers.
  • Bowser - A browser detector.
  • Sink - A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.
  • Kutt - Free Modern URL Shortener.
  • ZWS - Shorten URLs using invisible spaces.

βš–οΈ License

This project is licensed under the GNU General Public License v3.0

About

πŸ”— An URL shortener with in-app browser detection & escape powered by Cloudflare Workers.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Sponsor this project

Contributors

Languages