urupam

urupam is a lightweight URL shortener built with Perl and Mojolicious, and backed by Redis.

Basic requirements

  • Perl 5.42.0
  • Carton (handles perl deps)
  • Redis

Installation

Classic

Run the installation script:

scripts/install.sh

It will create a urupam user and group, deploy the application in /opt/urupam and create/enable a systemd service. Documentation will be installed in /usr/share/doc/urupam.

The application will listen on :8080.

Using docker

Build the image and use the docker-compose file:

docker build -t urupam .
docker compose up -d

Alternatively, if you already have a running redis instance, you can skip compose and start a standalone container:

docker run --name urupam -p 8080:8080 -d urupam:latest

Hacking

To run the application in development, you'll first need a Redis server. The easiest way is to start one is using Docker:

docker run --name mojo-redis -p 6379:6379 -d redis

Install Perl dependencies with Carton:

carton install

Add your changes and your tests, then start the application with morbo:

carton exec morbo bin/urupam

The application will listen on port 3000 by default.

Running tests

As every perl project, tests are located in the t directory.

To run tests, use the carton command:

carton exec prove -lr t/

To run specific tests (like integration tests), use:

carton exec prove -lr t/integration.t

License

This project is licensed under the GPLv3+ License. See the LICENSE file for details.

Description
Yet another url shortener
Readme GPL-3.0 340 KiB
Languages
Perl 96%
CSS 2.5%
Shell 1.2%
Dockerfile 0.3%