PerlintermediatebackendAI generated

REST API for URL Shortener

Build a URL-shortening REST API with Dancer2 that generates short codes, redirects to original URLs, and tracks click counts, persisting data via DBI to SQLite. Learners practice building JSON REST APIs and database-backed redirect logic in Perl.

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

Dancer2 · DBI · SQLite

Project roadmap

  1. 01

    Set up the Dancer2 app

    ~1h

    Scaffold a Dancer2 application with JSON serialization configured.

  2. 02

    Design the URL table

    ~1h

    Create a database table mapping short codes to original URLs and click counts.

  3. 03

    Implement shorten and redirect endpoints

    ~2h

    Add a POST endpoint to create short codes and a GET route that redirects and increments clicks.

  4. 04

    Add code generation logic

    ~1.5h

    Implement a base62 short-code generator that avoids collisions.

  5. 05

    Add stats endpoint and tests

    ~1.5h

    Expose a stats endpoint returning click counts and write tests for all routes.

Resources

Ready to build this?

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

~7h · 5 steps

Tech stack

Dancer2DBISQLite