Skip to content

kumpmati/pieni.link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pieni

A modern, minimal URL shortener

Yet another URL shortener

Pieni.link is a simple sideproject, originally built to test out the development speed with the following stack: SvelteKit, Drizzle ORM, Lucia and shadcn-svelte.

The pieni.link website is hosted on Netlify, and uses Neon for the PostgreSQL database.

Features

  • URL shortener (give long URL, get short URL in return)
    • Custom URLs
    • Basic per-link usage tracking
    • Password-protected links (TODO)
    • Temporary links
  • API
    • API Keys
    • Link API
    • Link visits API
    • User API
  • User accounts with roles (admin / member)
    • New users are invite-only (managed by admin users)

Deployment

There are two ways to deploy Pieni yourself:

Using Docker

  • A server or service that can run Docker (AWS / DigitalOcean / etc.)
  • Google OAuth credentials
  1. Copy the contents of .env.example to a file called .env, then fill all the environment variables according to the comments in the file.
  2. Run docker compose up --build -d

Serverless

You need the following:

  • A service that supports hosting SvelteKit projects (Vercel / Netlify / AWS / etc.)
  • An external PostgreSQL database (example: Neon)
  • Google OAuth credentials

TODO: netlify / vercel guide

Development

Prerequisites:

  • Git
  • Node.js (20 or above)
  • PostgreSQL (15)

Setup

Install dependencies

npm install

Copy the contents of .env.example to a file called .env, then fill all the environment variables according to the comments in the file.

cp .env.example .env

Run the development server

npm run dev
# navigate to http://localhost:5173