This weekend’s goal was to create a small utility site to replace functionality provided by sites such as pastebin or tinyurl.


Features

  • URL shortener (ex: https://mkl.ski/u/abc123)
    • Expires after duration (if any)
  • Pastebin (ex: https://mkl.ski/s/abc123)
    • Markdown supported
    • /raw endpoint gives plaintext content
    • Can be curled from the command line!
    • Expires after duration (if any)

Technical Details

  • With the goal of speed in mind, I used redis for data storage.
    • Since strings are the only type of data being saved, it worked out well with redis’ key-value store.
    • Using redis also afforded pastes/URLs expirations which were trivial to implement.
    • The pastebin feature actually displays the time it took to load/render in the bottom right of the page!
  • Backend is super simple: node + redis
  • Frontend is a simple React app, using BlueprintJS for UI components.
    • Since this was a quick project, I didn’t care to spend much time building components.
    • Also, this was an opportunity for me to evaluate BlueprintJS.

Future Plans

  • Image Hosting
    • I’d like to add image hosting to the site, though that would require dealing with actually hosting images and so on.
  • Hosting the site locally
    • Currently, I use a simple (free tier) Heroku app.
    • I love the idea of using a Raspberry Pi to host the web server, and later the storage device(s) for image hosting.