DEV Community

Cover image for I Built Bitly Clone with Redis, Express Svelte and Node ( RESN)
Damodar Lohani
Damodar Lohani

Posted on

I Built Bitly Clone with Redis, Express Svelte and Node ( RESN)

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

GitHub logo 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.

Live Demo

Table of Contents

Screenshots

image

image

image

Overview video

Here's a short video that explains the project and how it uses Redis:

Embed your YouTube video

How it works

Architecture Diagram

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.

  1. Schema definition

    // server/app/om/url.js
    import { Entity, Schema } from 'redis-om'
    import client from './client.js'
    class Url extends
    Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Architecture Diagram

Home Page
Home Page
Create new
Create new Short URL
URL History
History
QR Code
QR Code
Metrics
Hourly and Daily Metrics using RedisTimeSeries

Top comments (2)

Collapse
 
kafle1 profile image
Niraj Kafle

woo cool..

Collapse
 
lohanidamodar profile image
Damodar Lohani

Thank you!