ASP.NET Core MVC URL Shortener

A basic implementation of an URL shortener web application using ASP.NET Core MVC and Entity Framework Core.

Goal

I've started this little project in order to have a support during my approach of ASP.NET Core MVC.

My idea was to implement a simple web application using the framework.

I've chosen to implement an URL shortener application because it's pretty simple.

Algorithm

So, how works an URL shortener?

Basicaly, we store the URL in database, so it has a numeric ID, an we convert it to a another base in order to have a "stringified" version of the ID.

When we have the short URL the process is:

More theory here in this stackoverflow topic.

Implementation

For the stringification, I've chosen base 62 with this alphabet : "23456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ-_".

I've used the ShortURL class by delight.im to do this work. See this link for more information about it.

You can also see this link: https://gist.github.com/dgritsko/9554733.

Conclusion

ASP.NET Core allowed me to do this simple app in the quickest way. So that, I've doing more investigations about the framework.