
Kutt – a modern, open-source URL shortener - hugodutka
https://github.com/thedevs-network/kutt
======
Meph504
To me at this point I question the wisdom of even using URL shorteners.

They almost all get abused by spammers and malware, they end up getting
blacklisted, and as a best practice they are generally advocated for end users
not to click on them.

In a Corp business environment I haven't found the pains that come with using
them worth the shorter URL.

What places are they still widely used outsider of social media?

~~~
romwell
>What places are they still widely used outsider of social media?

Is that not a good enough reason to begin with?

But really, URL shorteners are the direct result of:

1)Most websites not having human-readable URL's

2)Many places not allowing HTML-style links

Both (1) and (2) apply to this forum; e.g.:

news.ycombinator.com/reply?id=21870064&goto=item%3Fid%3D21867994%2321870064

As a result, we have URL shorteners. They perform the function of <a
href="">link text</a>, with the advantage of the users being able to type them
by hand, if needs be.

They are immensely useful as an internal tool: if you run one locally, URLs of
the form [http://link/useful-link-description](http://link/useful-link-
description) will quickly become the norm.

~~~
Meph504
I have my doubts that you'll find an increase in url shorteners internally, as
one this can be handled through Dns if it must. And how often are people
reading and typing urls locally?

For anything like needing to widely distro a URL it will be posted In a
commonly accessible page, a email to those needing it, or distribed slide
deck.

Or even physically posted QR Codes.

As far as putting them in line in a post, i can see the value there but me
personally 250 characters isn't going to make or break my ability to read
them.

To each their own though, ans thanks for the insight.

~~~
romwell
>I have my doubts that you'll find an increase in url shorteners internally

 _ahem_ go links _ahem_

[https://medium.com/@golinks/the-full-history-of-go-links-
and...](https://medium.com/@golinks/the-full-history-of-go-links-and-the-
golink-system-cbc6d2c8bb3)

~~~
Meph504
I'm not really seeing how this AD by golinks conveys an increasing trend of a
3rd party application to handle internal url shorteners.

Just seems to me that any company with a remotely competent IT staff could
handle this with a few Dns records and a very simple lookup system.

But I've been wrong before admittedly.

~~~
curryst
I've worked at several companies that use some form of go links before.

The primary advantage of them is that they are very easily self-serviceable.
Anyone can create a new go link, and it's easy enough to do even the HR
department managed their own.

You are definitely correct that the same thing can be handled using DNS
records and something like a reverse proxy configured to route them based on
the subdomain. However, that introduces permissions and ease of use issues.
You typically don't want HR to have access to edit DNS records. You can
relegate it to a subdomain, but at the point you're typing in
"mylink.links.company.com" the shortening effect is dubious. Secondly,
managing DNS records is typically technical enough that some groups like HR
are not going to want to do it. And if I have to go talk to some group every
time I want a go link, I'm just not going to do it.

It's shockingly useful to think "This is a page other people should know
about" and be able to enter "go/page-name/edit", paste the link in the box
that comes up, and have "go/page-name" go to that page on everyone's computer
in the company. Done and done, you made it accessible in less time than it
would take to figure out who you have to talk to get a domain name set up.

A secondary benefit is that you can enter a description in your go link. So I
can just go to "go/" and get an index of all the golinks we have, with
descriptions. It's sometimes useful for when I'm working on a system I haven't
used before and want to see what other people have "bookmarked" about it.

------
xwowsersx
What makes a project "modern"? Seriously curious, as it seems to often be used
to describe projects/tools. Is it that the tools and languages used to build
it are new? If so, should I care? I suppose if the point is to showcase a
useful project in some new language/framework, then I'd care. But otherwise,
do I? Like, what if this were built in some really old language and with
ancient tools? Feel free to ignore this ramble, just curious what people
think.

~~~
nine_k
Hmm, TypeScript + deployed as a container?

Not cutting-edge, but definitely not obsolete, and does have obvious benefits
over e.g. a traditional plain Python-based app which you need to package and
host yourself.

~~~
xwowsersx
What are the obvious benefits? I don't follow your example... you can run a
Python app on AWS, directly on an EC2 instance or in a container, using
Lambda, whatever.

~~~
nine_k
Installing Python code and having all dependencies correctly resolved is a
common source of problems and complaints.

OTOH URL shortener run as a Lambda looks like a good idea in many cases.

~~~
xwowsersx
I hear ya, but still...I think I feel that you're overstating things. You can
use pipenv or poetry or whatever to minimize issues with dependencies, bake
into an image and run as a container. I've nothing against typescript or any
other techniques/practices you might be alluding to, but choosing those
languages/tools based on the kinds of benefits you're pointing to seems rather
off to me. It's a bit of work (just a bit) to get deployments working
correctly, but once you do, it's there and you can rely on it as part of your
infrastructure. I think the decision of which language or framework is going
to be used should be informed by something more than the benefits you stated
(assuming you meant those are the primary ones) because those seem a bit weak
tbh.

------
mikl
A full-scale database server (Neo4j or PostgreSQL), a heavy frontend React app
with Redux. A little over-engineered for a URL shortener, I think. That’s a
lot of spinning wheels to maintain for a relatively simple service.

------
whermans
You may want to think twice before marketing this to anyone who speaks Dutch.

~~~
yborg
Reminds me of how the Zune amused French-Canadians.

~~~
beagle3
What does it mean in French-Canadian?

In Hebrew it is the modern noun for "fuck" (as in, the act of coitus) -
perhaps you mean that? (And to add insult to injury, you used to "squirt"
songs)

------
strict9
I feel better about this than a commercial service I suppose.

But links should be what they are—the address of a page and not the product of
a cloaking and tracking service that takes you to a page with added delay.

~~~
joegahona
Is there a better solution for what to do when space is at a premium? The
choices are:

\- Don't post the link

\- Post the link and let it get lopped off in the middle

\- Post the link without adequate context surrounding it

\- Create a shortened link that points to the original

~~~
mathnmusic
Is space really at a premium though?

Tweets and SMS can allow full-sized links while retaining character limits for
UX reasons. It's almost 2020. Our networks can handle a few more bytes.

When presenting visually (such as outdoor advertising), users should be able
to simply scan the link - either as text or QR code.

~~~
earenndil
There's a limit to the length of an SMS, built into the protocol. 160
characters iirc.

~~~
ThalesX
Recently set up a system, the limit was preventable by concatenating multiple
messages, with the end-user not knowing this was done.

By the way, we were going just a few characters into the next message so for
pricing / logging issues we decided on shortening our own URL.

------
petesaia
Just to add to the list - Go/Redis/gRPC:
[https://github.com/LevInteractive/dwarf](https://github.com/LevInteractive/dwarf)

And a js/ts client to interface with it:
[https://github.com/LevInteractive/dwarf-client-
ts](https://github.com/LevInteractive/dwarf-client-ts)

Edit: Fix url.

------
ekianjo
> we moved from Neo4j

Strange, why even use graph databases for this kind of service? It does not
seem like it would be needed for this use case.

~~~
bszupnick
I started my project ([https://onefiftyone.run](https://onefiftyone.run))
using Mongo. It wasn't intentional, that was simply my stack.

We quite quickly outgrew it, and had to rip out that plumbing for Postgres. It
wasn't fun, but in retrospect I realise I was using the new, cool, hip
technologies instead of actually evaluating things on their merits.

Maybe this project fell into the same trap?

------
aspaviento
There's a link in the official Microsoft documentation (for office-js if I
remember it right) that uses bitly or a similar service. I don't what happened
to that link but now, when clicked, it tries first to load some random porn
site and then redirects to a YouTube video (about a car or something like
that). I wanted to report it, but didn't find an easy way of doing so, so
there must be still there trying to add malware or who knows what to the poor
people reading official Microsoft documentation.

~~~
technion
I can pick up a few here:

[https://github.com/MicrosoftDocs/azure-
docs/search?q=bit.ly&...](https://github.com/MicrosoftDocs/azure-
docs/search?q=bit.ly&unscoped_q=bit.ly)

Edit: All those seem "legit", but do point to a pattern

------
codingslave
I've been through this source code, really clean and well written modern
javascript (as far as I can tell). I was completely new to this whole
webstack, learned a ton about javascript and building front ends from this. I
think an underrated way to get good at coding or even to learn whole new
methods is to extend well written open source code. I find myself regularly
working with high quality code off github, learning more from the developers
on there than the developers I interact with at work.

~~~
poeti8
Hey, creator of Kutt here! Wanted you to know that I'm refactoring client side
as well to use TypeScript and new React features like hooks to ditch Redux,
and I'm really really excited to push this code into production, so much
cleaner now. You check the progress here:

[https://github.com/thedevs-
network/kutt/tree/feature/refacto...](https://github.com/thedevs-
network/kutt/tree/feature/refactor-client)

~~~
bisby
For hosting this myself, the major 2 things I am seeing:

this requires captcha it seems for link creation? I'm getting captcha errors.
Would much prefer requires being signed in to work.

And on that note, no easy ENV var type way to disable sign ups.

I really like the concept, but would love it as private only.

~~~
poeti8
It's on my list and will implement it soon.

------
surround
See also: Polr

[https://github.com/cydrobolt/polr](https://github.com/cydrobolt/polr)

------
cosmotic
What makes it modern?

~~~
joegahona
Is its open-source-ness what makes it unique?

~~~
robbyoconnor
nothing really does.

~~~
robbyoconnor
It's not incredibly hard to make a URL shortener...so yeah.

------
uj8efdkjfdshf
If anyone is interested, I made a single page URL shortener some while back
(technically 2 if you count the required .htaccess file).

[0] [https://g.sia.nz/public-
html/shortener/tree/master](https://g.sia.nz/public-
html/shortener/tree/master)

