A dynamic link service built as an alternative to Firebase Dynamic Links, providing URL shortening, platform detection, social media link previews, and analytics for mobile and web applications.

Overview

A link management system that routes users to different destinations based on their platform (iOS, Android, Web). Provides link previews for social media sharing and analytics for tracking user behavior.

Key Features

  • URL Shortening: Generate short links with custom identifiers for tracking
  • Platform Detection: Detects user platform (iOS/Android/Web) and redirects to appropriate destination
  • Link Previews: Open Graph meta tags for social media previews
  • Mobile Deep Linking: Deep linking into mobile apps with fallback to web or app store
  • Analytics: Track clicks, geographic distribution, device types, and user engagement
  • Multi-Language Support: Language routing for internationalized applications
  • RESTful API: API for integration

Technical Architecture

  • Backend: Go-based microservices
  • Caching: Redis for link resolution
  • Analytics: ClickHouse data warehouse for link interaction analysis
  • Metadata: Dynamic HTML generation with Open Graph tags
  • Database: PostgreSQL for link storage

API Example

POST /generate-link
Content-Type: application/json

{
  "type": "product",
  "link_id": "product_123",
  "user_id": "user_456",
  "language": "ENG",
  "data_id": "optional_data"
}

Response:

{
  "short_url": "https://link.example.com/M9PoxcPb0D8d_HD7z"
}
GET /{shortId}

Returns a 302 Redirect to the mobile app (if installed) or fallback web URL, with platform detection for iOS/Android/Web.

Social Media Preview

Generates link previews when shared on social platforms (Facebook, Twitter, LinkedIn, WhatsApp) with custom images, titles, and descriptions.

Go PostgreSQL Redis REST API Docker Nginx

Use Cases

  • Product links that open in mobile apps or web
  • Tracking article engagement with short links
  • Campaign performance monitoring
  • Mobile app deep linking

Technical Highlights

  • Redis caching for fast link resolution
  • Real-time analytics with ClickHouse
  • Fallback mechanisms for reliability
  • Monitoring with Prometheus/Grafana

Project Context

Built for a social commerce platform (June 2024 - Present). The service replaced Firebase Dynamic Links and handles link interactions for mobile and web applications, providing analytics on user behavior.