#link-shortener #postgresql #web-server #actix-web #cli-configuration

app swiftlink

Swiftlink is a fast, flexible URL shortener. With a simple API, it transforms long URLs into short, shareable links: shortening made simple!

2 releases

Uses new Rust 2024

new 0.0.2 Mar 19, 2025
0.0.1 Mar 19, 2025

#216 in Database interfaces

Download history 132/week @ 2025-03-14

132 downloads per month

Apache-2.0 OR MIT

24KB
308 lines

Swiftlink

Blazingly fast, memory-efficient and safe URL shortener to fit you.

Swiftlink is a URL shortener built with Rust and Actix. It enabled you to create short links from long URLs and provides a simple API for managing these links. The service uses PostgreSQL for database operations.

Table of Contents

Features

  • Create short links from long URLs.
  • Customizability in mind, from database options to the web server.
  • Database configuration for PostgreSQL.
  • Flexible logging with configurable log levels.

Usage

./swiftlink --config path/to/config.toml --log-level Info

Configuration

The configuration file is in TOML format and should be placed wherever you want, given you specify the right path. We have an example can config file.

Value Description Default
code_size Length of the generated short link code 6
port Port for the web server to listen on 8080
username Database username postgres
password Database password password
host Database host localhost
port Database port 5432
database Database name swiftlink_db
max_connections Maximum database connections 5

Contributions

Contributions are welcome! Please feel free to submit issues and pull requests.

Roadmap

Functionality:

  • Add authentication support (JWT or similar).
  • Add /api/info endpoint.
  • Deduplicate links.
  • Check if links exist before creating.

Look and feel:

  • Make project logo for favicon.ico.
  • Add landing page:
    • Information about the project
    • Simple usage with cURL
    • Templating (handlebars) for the landing page (domain, port, etc)

Documentation:

  • Information about the API

License

Dual-licensed under Apache v2 or MIT.

Dependencies

~24–38MB
~686K SLoC