Back to Projects

Cury.xyz

GoNextJSAWS RDSDocker

A minimal and simple, cost effective URL shortner. Features temporary anonymous url shortening as well.

Cury.xyz Hero

Problem Statement

When doing events, it is necessary to share lots of documents such as meeting links, project proposals etc. It's clean and professional when we use a short url reflecting event branding instead of sharing raw drive links or meeting links. However, mainstream URL shorteners are very expensive.

Project Description

Cury.xyz is a simple URL shortner. This project was developed out of personal necessity. The point of this project is to have an almost free alternative to otherwise expensive URL shortening. Project is developed having "event management" in mind where in event planning, it is often required to create event branded short urls.

The project is mainly divided into 3 components.

  1. Application frontend to serve dashboard
  2. Redirection server
  3. API

Instead of just having a application frontend and backend API, since a core requirement is redirect users fast to the corresponding destination URLs, a custom server is needed. If we have high volume of visitors rather than users, it is necessary to scale the ability to redirect. Hence, redirection server is a separate microservice to scale separately. Redirection server serves website landing page as well.

Challenges & Learning Experience

A key challenge I faced is when mapping domain names to microservice components. A redirection server may consider any slug to be a short URL. Hence API and application frontend heavily uses path segments to communicate, they cannot serve on the domain as the redirection server. Otherwise, redirection server has to have complex and unscalable condition checks to check if a requested endpoint is a short URL or part of the API/frontend. Hence, API, frontend and redirection server is separated, giving them its own sub-domains. Then, since redirection server serves on our main domain, and because visitors checks out the plain domain as well, a landing page must be served for request that don't have other URIs matching short links. Hence, redirection server is written to also serve a vanila html page upon requests on root. Then for the landing page, a separate NextJS project was initiated, configured for static output. Deploy pipeline takes the static build of the landing page from the NextJS project and provide it for the redirection service to serve on root.

This was a good learning experience as it forced me to think about architecture well before coding.