a simple gleam link shortener using a lustre server component and sqlight + cake. has user-friendly, readable slugs
Gleam 71.0%
Dockerfile 4.6%
CSS 4.2%
HTML 3.3%
Nix 1.5%
Shell 0.8%
Other 14.6%
13 1 0

Clone this repository

https://tangled.org/lekkice.moe/glortener https://tangled.org/did:plc:dgzvruva4jbzqbta335jtvoz/glortener
git@knot.tangled.wizardry.systems:lekkice.moe/glortener git@knot.tangled.wizardry.systems:did:plc:dgzvruva4jbzqbta335jtvoz/glortener

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

glortener#

home page screenshot

a simple gleam link shortener using a lustre server component and sqlight + cake. user-friendly slugs can be generated automatically, or you can input them manually.

Package Version Hex Docs

development#

devenv shell                  # enter devenv shell to install all the required packages
dbmate up                     # create sqlite db and run migrations
gleam run -m tailwind/install # install tailwind cli
gleam run -m tailwind/run     # build CSS
gleam run                     # run the project

deployment#

the project needs the following environment variables defined:

  • SECRET_KEY_BASE: needed by web server for signing and encryption
  • DATABASE_URL: path to the sqlite database. it should include the sqlite: prefix if you intend to use dbmate
  • BASE_URL: the base URL, where you plan to serve the application from

since this application is intended to be minimal, i suggest handling authentication at the network level:

  • the /create route should be protected to prevent unauthorized users from creating or deleting links
  • the /:slug routes should be publicly accessible, so they can be shared with anyone

contributing#

contributions are welcome! if you have suggestions, bug reports, or want to add new features, please feel free to:

  1. open an issue to discuss your ideas.
  2. fork the repository and submit a pull request.

acknowledgements#