What I built
I built Project YALA (or simply YALA) which is "Yet Another Link-shortener App".
Category Submission:
Think Outside the JS Box - as it is not-the-JS-stack but still nothing wacky to put in other category ;-)
App Link
App is run in preview mode - no add/delete options provided.
Example links with data (some short link which redirects to dev.to):
- details page: https://project-yala.fly.dev/link/638a74cb82478a464c478282/3d9ae405-ba98-4930-9979-4ec11c7c2454
- details (analitycs) page: https://project-yala.fly.dev/link/638a74cb82478a464c478282/3d9ae405-ba98-4930-9979-4ec11c7c2454/visits
- link to click with preview - to show what URL is going to be opened: https://project-yala.fly.dev/j/3fe3fd2/preview
Screenshots
Description
YALA is a simple link shortener that works without logging in - instead it creates "secret key" which allows to view details of created short link and it's statistics.
Generally it is simple app to show that we do not need fancy frameworks to make nice looking, fully working application.
Link to Source Code
https://github.com/elwin013/project-yala
Permissive License
MIT, https://github.com/elwin013/project-yala/blob/master/LICENSE.md
Background
I always wanted to create simple link shortener, just for fun. :-) Additionally this was good moment to look into new Timeseries features from MongoDB.
Instead of using commonly used frameworks (like Spring Framework) I preffered to use something that is small and doesn't have "magic" in it. So I've chosen Javalin as a simple web framework, added MongoDB client libraries nad jte as template engine. To show that simple and clean looking apps doesn't need any big JS libraries I've selected chota - one of micro CSS frameworks.
How I built it
On the app side I've used:
- https://javalin.io/ - simple web framework,
- https://jte.gg/ - template library,
- https://jenil.github.io/chota - micro CSS framework,
- MongoDB for database.
On the MongoDB side I've used just two collections - one with data about links and the second one with visits. For the latter I used timeseries collection to aggregate data into some chunks (in case of example - group visits per hour).
All MongoDB related stuff was done on the code side (except creating cluster, database and user to access). It is pretty great that as long as you have access to database you can work with it freely - e.g. collection is created as soon as first document is saved!
For deployment I've used https://fly.io - mostly because I wanted to check out some Big-Three (AWS,GCP,Azure) alternative for hosting apps!
Additional Resources/Info
Nothing I can think of! ;-)
Top comments (0)