Shlink is a simple php-based short/link service, the code will be open-source and available here.