Home

Awesome

ksana.in

<img alt="ksana.in" src="public/images/orange/ksana.png" height="80"/>

✂ī¸ Open source URL shortener, free to use and without ads

Deployment Website Up

Features

Screenshots

<table> <tbody> <tr> <td> <img alt="Homepage" src="screenshots/mobile-home.png" /> </td> <td> <img alt="Homepage" src="screenshots/mobile-login.png" /> </td> <td> <img alt="Homepage" src="screenshots/mobile-dashboard.png" /> </td> </tr> </tbody> </table>

Installation

Copy file .env.local.example to .env.local and change value with your own supabase url and anonymous key. You can get it after register and create your own project on Supabase.io.

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

Creating table on Supabase

Go to the SQL tab and execute this query on the editor.

create table urls (
  id bigint generated by default as identity primary key,
  user_id uuid references auth.users not null,
  real_url text check (char_length(real_url) > 1),
  slug text check (char_length(slug) > 1),
  hit integer default 0,
  is_dynamic smallint default 0,
  inserted_at timestamp with time zone default timezone('utc'::text, now()) not null,
  updated_at timestamp with time zone default timezone('utc'::text, now()) not null
);

Click RUN to execute the query

Creating triggers on Supabase

Go to the SQL tab and execute this query on the editor.

Add triggers for "updated_at" field, copy this code on the same SQL editor

create extension if not exists moddatetime schema extensions;

-- this trigger will set the "updated_at" column to the current timestamp for every update
create trigger handle_updated_at before update on public.urls
  for each row execute procedure moddatetime (updated_at);

Click RUN to execute the query

Creating View on Supabase

Go to the SQL tab and execute this query on the editor.

create view distinct_users as
    select distinct(user_id) from public.urls;

Click RUN to execute the query

Additional settings for Authentication

Add environment variables on Vercel

You can found all required environment variables on .env.local.example

Register you own Splitbee

Ksana.in using Splitbee for Analytic, if you plan to deploy it by yourself, you might need to register your own Splitbee account.

Can I deploy to my own domain?

The code is open for learning purpose. But in case you didn't like the default domain (ksana.in), feel free to deploy to your own domain. Since Ksana.in is using a free plan from Supabase, it have many limitation in term of size. If you plan to use it in the bigger frequency, I suggest to deploy it with your own Supabase plan.

The Apps based on Ksana.in's codebase

Credits

Support me


Copyright Šī¸ 2021 by Irfan Maulana