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
- 01
Set up Actix-web and the database
~2hScaffold an Actix-web project and set up a SQLite database with sqlx for storing short codes and target URLs.
- 02
Implement the shorten endpoint
~2hBuild a POST endpoint that generates a short code for a submitted URL and stores the mapping.
- 03
Implement the redirect endpoint
~1.5hBuild a GET endpoint that looks up a short code and issues an HTTP redirect to the original URL, incrementing a click counter.
- 04
Add a stats endpoint
~1.5hBuild an endpoint that returns click counts and creation date for a given short code.
- 05
Add input validation and tests
~2hValidate submitted URLs and write integration tests for the shorten/redirect/stats flow.
Resources
- DocsThe Rust Book
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack