Giter Club home page Giter Club logo

ksana.in's Introduction

ksana.in

✂️ Open source URL shortener, free to use and without ads

Deployment Website Up

Features

  • Fully open source
  • Mobile First UI (best view in your mobile device)
  • Full authentication flow
    • Login (with Email or third parties: Google, GitHub and Twitter)
    • Register manual using email
    • Forget Password and set new password
  • Simple hit stats on every short URL
  • Share the link using Native Share API for mobile device and fallback to WA, Twitter and Facebook share.
  • Copy the link using new Clipboard API, fallback to old school copy-to-clipboard mechanism

Screenshots

Homepage Homepage Homepage

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

  • on Authentication setting, change Site URL to /callback. e.g: https://ksana.in/callback, for development just set it to http://localhost:3000/callback
  • To support Google Login, in Authentication setting page, set the Google Client ID and Google Secret
  • Increase JWT expiry time to 604800 for longer session. It's on on Authentication setting menu

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

ksana.in's People

Contributors

bramaudi avatar danangekal avatar dependabot[bot] avatar imgbot[bot] avatar imgbotapp avatar irfan-maulana-tkp avatar kodiakhq[bot] avatar mazipan avatar razanfawwaz avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ksana.in's Issues

Rewrite to TypeScript

For better dev experience, need to rewrite into TypeScript

  • Setup TS - Done in #8
  • Migrate the config file next.config.js and wb.config.js to TS
  • Add more Typings
  • Cleanup all anys

Blog - help to write article

This project need more content to help the SEO.
For now, we generate content in a blog post.

Help to write articles in Indonesian Language.

The topic will be around these keywords

  • URL shortener

Wrong theme switcher icon

When the theme was light, it should show the Moon Icon.
And when the theme as Dark, it should show the Sun Icon

[UI] Unexpected UI for kebijakan privasi and ketentuan layanan page

Describe the bug
I found that two pages are having unexpected styling, they are kebijakan privasi and ketentuan layanan page

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://ksana.in/'
  2. Click on 'ketentuan layanan' or 'kebijakan privasi' on footer menus
  3. Scroll down to 'middle of pages'
  4. See error

Expected behavior
A clear and readable page content.

Screenshots
If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

  • OS: macOS
  • Browser chrome
  • Version

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add user & link counter in homepage

Add counter how many user already registered and how many shortlink already created in homepage to show the growth and the positioning.

  • Urls - done in #19
  • User -- still not found any docs to select the user count

Theme not persistence

When we switch the theme, seems the theme was not persistence.
If we try to do a hard reload, it will be reset again to the default one.

Add loader on the process

At least I found 2 process that should show the progress:

  • On click Install pwa button
  • On click share on Mobile Web

Maybe set some static timeout, just to show there is a process executed

Add Logo json-ld

Add JSON-LD for logo, you can insert it on MetaHead component.

Utilize the next/head to insert meta data

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Organization",
      "url": "https://ksana.in",
      "logo": "https://ksana.in/images/square/ksana-192x192.png"
    }
    </script>

Reference: https://developers.google.com/search/docs/data-types/logo

Dynamic short URL

Description

Add dynamic URL type, so we can go to specified URL path dynamically.
Example:

  • URL: somelongdomainname.com/{param}/view
  • Shorten: ksana.in/slug/blahblah
  • Destination: somelongdomainname.com/blahblah/view

Not sure if this are make sense and possible, but pretty sure this will be useful.

Implementation Model

  • Add type field (enum: normal, dynamic) or add dynamic field (bool)
  • If type is dynamic then the access URL should have 2 parameters: ksana.in/slug/paramvalue otherwise it will 404 or something
  • If type is dynamic then replace {param} with given param in this case blahblah before redirecting

If we agree to add this feature i would happy to contribute.

Reset password didn't redirected

After request to reset password, it will give you a dialog box with a success message.

Unfortunately, when we click the "close" button, it didn't do anything except close the dialog box.

Expected behaviour:

  • On request reset password: redirect to home (/)
  • On set new password: redirect to login page

Add new onClose parameter when call showAlert from AlertContext

gagal sign in

izin admin, saat login/sign in dengan google selalu redirect ke home page lagi, sehingga tdk bisa login/sign in. mohon bantuannya, terimakasih

Share on desktop

Currently we utilize the Web Share API which is not available on most of desktop browsers.

Need to add manual way to share URL when accessing from desktop device.

Maybe looking for some react-social-share, is it available?

SEO Mapping

Collection of task related SEO

Available pages inside:

  • Home
  • Sign in
  • Sign up
  • Forget password
  • Set new password (only accessible after got the token from forget password)
  • Dashboard (only for login user -- should not accessible by Search Not)
  • Tentang
  • Privacy Policy
  • Terms of service

General task for all pages:

  • generate static sitemap.xml
  • set index or noindex meta based on accessibility
  • set breadcrumb for better navigation, is it needed?
  • set different title and description for each page

Title and description

Page: Home

  • Title: TBD
  • Description: TBD

Page: Sign in

  • Title: TBD
  • Description: TBD

Page: Sign up

  • Title: TBD
  • Description: TBD

Page: Forget password

  • Title: TBD
  • Description: TBD

Page: Tentang

  • Title: TBD
  • Description: TBD

Page: Privacy Policy

  • Title: TBD
  • Description: TBD

Page: Terms of service

  • Title: TBD
  • Description: TBD

Editable Destination URL

Description

I see the current edit mode only editing the slug, is the destination URL intended to be immutable? If yes, why?
Well when I want to fix my previous link I would prefer to edit than create a new one, (e.g. changing my Invidious instance domain in a dynamic link)

Setup PWA

Create manifest.json
POC about screenshots on manifest
Prepare icons
Add service worker

  • Manifest.json
  • Installable
  • Custom Install Launcher
  • Basic cache static file: JS, CSS, Images

Add splitbee event on user action

Splitbee have ability to send a custom event, we need to utilize this feature.

At least for these actions:

  • User success registration
  • User login
  • User ask reset password

Setup pre-commit script

Need to install husky + lint-staged, adding pre-commit script so will automatically git add all the formatted code before committing.

Authentication page

Hi, where do I find the Authentication page? Would like to enable Google Twitter and Github sign in.

Thanks

Reduce Supabase SDK usage on Client Side

We still use many Supabase client directly to do a select, insert, update, delete data.

Need to wrap it into our own backend, it's inside api/ folder.

Create a helper (if it's mutation) inside libs/supabase and change the usage of Supabase SDK on the React component to this helpers

Move the callback url

Currently the callback is going to the homepage, need to setup Supabase to pointing into different page so we can reduce unnecessary logic on the homepage

dynamic sitemap.xml

Currently, we just hardcode the sitemap on public directory with hardcoded last-update value.

We need to use a script to be run in every build, so it will generate a new timestamp when we deploy new changes.

Static Blog for ksana.in

To support #22

  • Content using markdown, inside _posts directory
  • Markdown file format _post/YYYY-MM-DD-slug.md
  • Blog under slug /blog/*
  • Detail post in /blog/[slug]

Basic Features:

  • Post tag/category
  • Pagination

I have no preference for the UI, you can work as you want

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.