Welcome to rxst.me, a high-performance, scalable, and secure URL shortener built using Rust, Actix-Web, and SQLx. This project was developed as part of the BLAZINGLY FAST Hackathon to provide an ultra-fast and reliable solution for shortening and managing URLs.
β
Blazing Fast Performance β Built with Rust and Actix-Web, leveraging async operations for speed.
β
Short URL Generation β Generates short, Base62-encoded or custom alias URLs.
β
Custom Alias Handling β Users can provide their own alias; if taken, alternative suggestions are provided.
β
Automatic Expiration (TTL) β URLs expire after 6 months and are automatically deleted.
β
Leet (1337) Transformations β If an alias is taken, the system suggests leet-style variations.
β
Redirection System β Redirects users to the original URL via /{short_url}.
β
URL Info Retrieval β Retrieve URL details (original URL, expiration date) via /u/{short_url}.
β
Validation β Ensures valid URLs and prevents invalid alias names.
β
Security Headers β Enforced CORS, XSS, and Content Security Policies.
β
Zero Downtime Cleanup β A background task automatically deletes expired URLs.
- Rust β Safe, fast, and memory-efficient.
- Actix-Web β High-performance web framework.
- SQLx + SQLite β Async database interaction.
- Tokio β Async runtime for Rust.
- Regex β For URL validation.
- dotenv β Manage environment variables.
rxst.me/
βββ src/
β βββ main.rs # Main server entry point
β βββ config.rs # Initializes logging & environment variables
β βββ database.rs # Handles database interactions & TTL cleanup
β βββ handlers.rs # HTTP request handlers (shorten, redirect, info)
β βββ hash.rs # Hashing & encoding for short URLs
β βββ models.rs # Database models & request structures
β βββ routes.rs # Actix-Web route configuration
β βββ validation.rs # URL validation logic
βββ migrations/ # SQL migration files
βββ static/index.html # Frontend UI for shortening URLs
βββ .env # Environment configuration
βββ Cargo.toml # Rust dependencies
git clone https://github.com/s3r1msultan/blazingly_fast_url_shortener.git
cd blazingly_fast_url_shortenerCreate a .env file with:
DATABASE_URL=sqlite://url_shortener.dbcargo install sqlx-cli
cargo sqlx migrate runcargo runVisit http://0.0.0.0:8080 and start shortening URLs.
POST /shorten
{
"original_url": "https://example.com",
"custom_alias": "myalias"
}Response:
{
"short_url": "myalias"
}GET /{short_url}
- Redirects users to the original website.
GET /u/{short_url}
Response:
{
"short_url": "myalias",
"expiration_date": "2025-08-03 13:00:00"
}- Uses FNV-1a Hashing + Base62 Encoding to generate deterministic short URLs.
- If an alias is already taken, the system suggests alternative aliases using leet-style replacements:
"google" β "9oogle", "90ogle", "900gle"
- URLs expire in 6 months.
- A background task deletes expired URLs every hour.
- Users can retrieve info about a short URL via
/u/{short_url}.
Want to improve rxst.me? Contributions are welcome!
To contribute:
- Fork the repo.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m "Added feature XYZ"). - Push to GitHub (
git push origin feature-name). - Submit a Pull Request (PR).
This project is licensed under the MIT License.
Built by s3r1msultan for the BLAZINGLY FAST Hackathon.
π Let's make URL shortening faster than ever!