Skip to content

URL Shortener is a free tool designed to help users easily shorten long URLs. Our goal is to make URL shortening simple, fast, and efficient. Whether you're a marketer, developer, or anyone who needs to share links, URL Shortener can help you create concise, manageable links.

License

Notifications You must be signed in to change notification settings

harrisonwang/url-shortener

Repository files navigation

URL Shortener

English | 中文

URL Shortener is a free tool designed to help users easily shorten long URLs. Our goal is to make URL shortening simple, fast, and efficient. Whether you're a marketer, developer, or anyone who needs to share links, URL Shortener can help you create concise, manageable links.

About the Author

This website is built by Harrison Wang using Cursor and theme originally by Viggo.

Features

  • Instant URL Shortening: Quickly generate short links for any long URL.
  • Custom Short Links: Create memorable and branded short URLs.
  • Analytics: Track the performance of your shortened links.
  • Secure and Reliable: Ensure safe redirection and link management.
  • Free to Use: No cost associated with creating or managing short links.

Installation and Running

Prepare Supabase Project

Run the following SQL commands in your Supabase project to create the necessary tables:

create table
  public.links (
    id serial not null,
    url text null,
    slug text null,
    ua text null,
    ip text null,
    status integer null,
    created_at timestamp without time zone null default current_timestamp,
    constraint links_pkey primary key (id)
  ) tablespace pg_default;

create table
  public.logs (
    id serial not null,
    url text null,
    slug text null,
    referer text null,
    ua text null,
    ip text null,
    created_at timestamp without time zone null default current_timestamp,
    constraint logs_pkey primary key (id)
  ) tablespace pg_default;

1. Deploy to Vercel

Click the button below to deploy to Vercel:

Deploy with Vercel

Configure the following environment variables:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_KEY

2. Run Docker

2.1. Clone the Repository

git clone https://github.com/harrisonwang/url-shortener.git

2.2. Rename .env.example to .env and set environment variables

mv .env.example .env
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_KEY=

2.3. Run Docker Container

docker compose up -d

2.4. Access the Application

Open your browser and visit http://localhost:3000, you should be able to see the URL short link generator interface.

3. Run Locally

3.1. Clone the Repository

git clone https://github.com/harrisonwang/url-shortener.git

3.2. Install Dependencies

npm i

3.3. Rename .env.example to .env and set environment variables

mv .env.example .env
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_KEY=

3.4. Run the Development Server

npm run dev

About

URL Shortener is a free tool designed to help users easily shorten long URLs. Our goal is to make URL shortening simple, fast, and efficient. Whether you're a marketer, developer, or anyone who needs to share links, URL Shortener can help you create concise, manageable links.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published