Overview of My Submission
I always wanted to build my own URL shortener that could give metrics like how many times the URL was visited. I had always been busy to try, but redis hackathon felt like perfect opportunity for me to work on this. So I decide to use this opportunity to build myself a URL shortener. I built it using redis as primary database where it uses Redis JSON to store URL details and RedisTimeSeries to store usage metrics.
The project has two parts a server, provides REST API and is built using ExpressJS. The server is also responsible to interface with Redis. I'm using official Javascript redis package and Redis OM for Node.js to interface with redis database to save and retrieve data.
And, another is the client, that is build with Sveltekit. It provides web UI where users can create short URLs and view the metrics in beautiful looking charts.
You can view the live demo of client at https://urlui.vercel.app
Submission Category:
MEAN/MERN Maverics
Video
Language
JS/TS/Node.js
Link to Code
lohanidamodar / redis-hack-urlshortner
URL Shortener app built for redis x dev hackathon
URL Shortener with Node.JS and Redis
A URL shortener application build with ExpressJS, Redis and SvelteKit. Shorten URLs and also get link visit history.
Table of Contents
- Screenshots
- Overview video
- How it works
- How to run it locally?
- Deployment
- More Information about Redis Stack
Screenshots
Overview video
Here's a short video that explains the project and how it uses Redis:
How it works
How the data is stored:
The project uses redis json to store Url records. Each record has following properties
- originalUrl: string
- shortName: string
- createdAt: date
- updatedAt: date
To easily work with redis project uses Redis OM for Node.js.
-
Schema definition
// server/app/om/url.js import { Entity, Schema } from 'redis-om' import client from './client.js' class Url extends
…
Additional Resources / Info
Home Page |
Create new Short URL |
History |
QR Code |
Hourly and Daily Metrics using RedisTimeSeries |
- Check out Redis OM, client libraries for working with Redis as a multi-model database.
- Use RedisInsight to visualize your data in Redis.
- Sign up for a free Redis database.
Top comments (2)
woo cool..
Thank you!