5 min read

Voucher, Coupon, Loyalty and Gift Card Management Made Easy with VoucherVault

Presenting VoucherVault - a selfhostable Django web application to manage your vouchers, coupons, loyalty and gift cards. Store them digitally in your web vault and get notified via Apprise URLs about items that will soon expire.
Voucher, Coupon, Loyalty and Gift Card Management Made Easy with VoucherVault
Photo by Julia Morales / Unsplash

Picture this: It's your birthday and you unwrap a beautifully wrapped present to find a gift card inside. You feel a surge of appreciation and excitement, eagerly anticipating the perfect moment to redeem it. You carefully place the gift card in your cupboard, intending to use it soon. Days turn into months, and months into years, and in the hustle and bustle of life, the gift card slips from your memory. One day, while tidying up your cupboard, you stumble upon it again — only to realize it's already expired. What a waste!

Or you're out with friends and spontaneously decide to hit the cinema. You remember a gift card that would make the outing even better. However, the gift card with its redeem code sits at home and therefore is not available. You have no choice but to pay out of pocket, promising yourself you'll use the gift card next time. But next time, you might face the same issue...

What if I tell you that there is a simple solution to this problem?

Enter VoucherVault, a Django-based web application designed to help you manage your coupons, vouchers, and gift cards seamlessly. With VoucherVault, you'll never misplace or forget a gift card again. It allows you to store your coupons, vouchers and gift cards digitally, ensuring they're always handy when you need them. Additionally, with the ability to send out notifications to you in case an item in you vault is soon expiring. Nice!

And the best part: it is open-source and free to selfhost.

Installation

With Docker already installed on your server, spawning up VoucherVault only takes a few minutes. May reach out to the official GitHub repo to check out the installation instructions or obtain more information about the project.

GitHub - l4rm4nd/VoucherVault: Django web application to store and manage vouchers, coupons and gift cards digitally.
Django web application to store and manage vouchers, coupons and gift cards digitally. - l4rm4nd/VoucherVault

Anyways, you can just use the provided docker-compose.yml from the GitHub repo, which includes everything you need.

services:

  vouchervault:
    image: l4rm4nd/vouchervault:1.5.x
    container_name: vouchervault
    environment:
      - DOMAIN=vouchervault.example.com # your FQDN or IP; used to define ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
      - SECURE_COOKIES=False # set to True if you use a reverse proxy with tls; enables secure cookie flag and hsts
      - EXPIRY_THRESHOLD_DAYS=90 # send notifications xx days prior expiry; default is 30
      - TZ=Europe/Berlin # defines the timezone
    restart: unless-stopped
    expose:
      - 8000
    ports:
      - 8000:8000
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - ./volume-data/database:/opt/app/database

  redis:
    container_name: vouchervault-redis
    image: redis:7.2-alpine
    restart: unless-stopped     

docker-compose.yml

The VoucherVault stack can be easily spawned up using Docker Compose:

# create dir for persisted data
mkdir -p ./volume-data/database

# adjust permissions
sudo chown -R www-data: volume-data/*

# spawn the stack
docker compose up -d
💡
Combine with a reverse proxy to establish an encrypted communication channel and secure VoucherVault instance. If so, ensure to define the environment variable `DOMAIN` with your FQDN.

Usage

Let's focus on the usage of VoucherVault.

Obtain Login Credentials

Once the Docker container is successfully started, you can find auto-generated login credentials for the admin user in the container logs.

You can obtain them easily using the following command:

docker compose logs -f

Afterwards, just browse the VoucherVault instance that is available on http://127.0.0.1:8000 per default or via your custom HTTP(S) domain name.

⚠️
If you have changed the port mappings, adjust accordingly and adjust the PORT environment variable too for proper CSRF validation checks.

After that, the web application should be intuitive to get you started. Create your first coupon, voucher, loyalty or gift card item and do not forget to configure your Apprise URLs for expiry notifications in the profile section.

Configure Apprise URLs

In order to receive expiry notifications, you have to configure Apprise URLs. Just login with your user account and check out your user profile at the top right.

There you will find a reference to configure the notification settings.

Once one or multiple Apprise URLs were configured, hit the test button and ensure that you are receiving notifications successfuly. After that, you are ready to go.

GitHub - caronc/apprise: Apprise - Push Notifications that work with just about every platform!
Apprise - Push Notifications that work with just about every platform! - caronc/apprise

Adjust Periodic Expiry Checks

The interval, how often items are checked against a potential expiry, is pre-defined (weekly, every Monday at 9 AM) in the Django admin area. Django-Celery-Beat as well as a Redis instance are used for periodic task execution.

If you want to adjust the crontab interval, please head over to the admin area at /admin/django_celery_beat/periodictask/1/change/ (Periodic Tasks > Periodic Expiry Check > Crontab Schedule) and adjust to your liking. It's a basic cronjob syntax.

Unsure how to configure it properly? Check out the following excellent site:

Crontab.guru - The cron schedule expression generator
An easy to use editor for crontab schedules.

Configure OIDC Single-Sign-On

VoucherVault supports OIDC since release version 1.1.0.

The OIDC configuration is defined via environment variables. You can find those explained in detail here.

Combine VoucherVault with an Identity Provider like Authentik, Authelia or Keycloak and enjoy the hassle-free onboarding of your application users.

Screenshots

Interested how the frontend and Django web application looks like?

You don't have to spawn it up yourself right now. I've got you covered with some sample screenshots:

VoucherVault Dashboard
VoucherVault Inventory
VoucherVault Item Details