Slink is a simple link shortener, built as a hobby project built using production standards to dwelve deeper into Clojure apart from the stuff I do at work.
Clojure is a beautiful functional programming language following the style of LISP. Working in it gave me a completely different (and better) programming experience owing to it's list type functional syntax and immutability.
Few snags I found while working with Clojure was the relatively short and small documentation for even some of the popular packages. But this made me debug deeper by reading through the source code, so I can't really complain about this. :D
- Install Leiningen
- Clone this repository and cd inside.
- Run
lein deps
- Run
lein trampoline run
to launch the server orlein uberjar
to package a jar.
GET /
: Hello WorldGET /api/links
: Get all slinks stored for an userPUT /api/links
: Create a short linkGET /swagger/docs
: Swagger Docs for the API
The amazing Ring libary is being used for running the server and Reitit is being used for composing routes and Swagger for the server.
Configuration management is being done using Clonfig which merges
the default EDN file (found in resources/config.edn
) and environment
variables.
A Postgres instance is being used with Toucan
to simplify database queries and Ragtime
being used for migrations. Database code resides in src/slink/db
.
Created short slinks are also being cached in Redis.
Timbre is being used for logging data.
Errors are reported to a personal Slack channel by utilising it's webhook feature. :D
- Code Coverage
- Dockerisation
- User Tables
- JWT Authentication
- Analytics per link