{"repo":"rehan-adi/shortly","free":true,"listed":false,"github":"https://github.com/rehan-adi/shortly","clone":"git clone https://github.com/rehan-adi/shortly.git","description":"A fast and scalable URL shortener built for efficiency and reliability. 🚀","language":"Go","stars":29,"topics":["gin","golang","gorm","postgresql","mongodb","redis","grpc"],"license":"MIT","category":"databases-storage","readme_excerpt":"Shortly - High-Performance URL Shortener with Pre-Generated Key System (KGS) Shortly is a scalable URL shortener built entirely in Go with a clean microservices architecture. It includes authentication, analytics, rate limiting, Redis-based caching, and a high-performance Key Generation Service (KGS) that pre-generates short keys to ensure consistent latency under heavy load. Architecture Overview Below is a high-level illustration of Shortly’s architecture to help you visualize the flow and interactions between components: Service Responsibilities & Components 1. API Service - Built using Go + Gin framework for RESTful HTTP APIs. - Handles user authentication (signup, signin, logout) with JWT tokens. - Manages URL lifecycle operations: creating shortened URLs, fetching details, updating, deleting, and redirection. - Communicates internally with the KGS Service using gRPC to request pre-generated keys for URL shortening. - Caches frequently accessed data like user profiles and short key mappings in Redis for low-latency reads. - Implements rate limiting using Redis (DB 2) with ulule middleware to protect endpoints from abuse. - For redirection, looks up the short key in Redis; if cached, instantly issues a 302 redirect response. - Store analytics data asynchronously using Goroutines to avoid blocking the request lifecycle. 2. Key Generation Service (KGS) - A dedicated microservice written in Go and exposed via gRPC . - Responsible for generating unique short keys ahead of tim","default_branch":null,"files":null,"tree":[],"storefront":"/r/rehan-adi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rehan-adi/shortly/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}