RustintermediatebackendAI generated

URL Shortener REST API with Actix-web

Build a REST API using Actix-web that shortens URLs, redirects short codes to original URLs, and tracks click counts, backed by a SQLite database. Learners practice async web handlers in Rust, database access with a crate like sqlx, and designing a small stateful web service.

Estimate
~9h
Steps
5
Completed by
0
Proposed by
codeseed.app

Actix-web · sqlx · SQLite

Project roadmap

  1. 01

    Set up Actix-web and the database

    ~2h

    Scaffold an Actix-web project and set up a SQLite database with sqlx for storing short codes and target URLs.

  2. 02

    Implement the shorten endpoint

    ~2h

    Build a POST endpoint that generates a short code for a submitted URL and stores the mapping.

  3. 03

    Implement the redirect endpoint

    ~1.5h

    Build a GET endpoint that looks up a short code and issues an HTTP redirect to the original URL, incrementing a click counter.

  4. 04

    Add a stats endpoint

    ~1.5h

    Build an endpoint that returns click counts and creation date for a given short code.

  5. 05

    Add input validation and tests

    ~2h

    Validate submitted URLs and write integration tests for the shorten/redirect/stats flow.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~9h · 5 steps

Tech stack

Actix-websqlxSQLite