Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 tinyurl-rs: A Simple & Efficient URL Shortener

Introduction

Ever struggled with long, ugly URLs? tinyurl-rs helps you convert them into short, shareable, and trackable links in just seconds!

Whether you're sharing links on social media, marketing campaigns, or messaging apps, this tool enhances link engagement, accessibility, and customization. While some platforms block unknown short URLs to prevent abuse, responsible use makes URL shorteners a powerful tool for businesses and individuals alike.

System Architecture

System Overview

graph TD;
    
    subgraph User
        A[User Request] -->|Long URL| B[Frontend/UI]
    end
    
    subgraph Backend
        C[FastAPI Server] --> |API Call| D[Shorten URL Function]
        D --> |Store Data| E[MongoDB]
        C --> |Retrieve Data| E
        C --> |Redirect to Long URL| F[Redirect Handler]
    end

    subgraph Database
        E[(MongoDB)]
    end

    subgraph External Service
        F[Redirect to Original URL]
    end

    B -->|Send API Request| C
    C -->|Return Short URL| B
    B -->|Access Short URL| F
    F -->|Redirect to Long URL| G[User Accesses Original Site]
Loading
  • User submits a long URL through the frontend.
  • FastAPI backend:
    • Generates a shortened URL.
    • Stores mapping in MongoDB.
    • Redirects users to the original URL upon request.
  • MongoDB acts as the database to store the URL mappings.

API Endpoints

Method Endpoint Description
POST /api/v1/shorten-data Generates a short URL from a given long URL. The client sends a POST request with the original URL.
GET /{shorten_url} Redirects users to the original long URL when they access a shortened link. The client sends a GET request with the short URL.
GET /api/v1/info Sends periodic service info for health-checking.

Getting Started

Contributor

This project is developed and maintained by:

About

Building a TinyURL with Rust

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages