Arkaprabha Chakraborty f9863d9dfb fix: patch version 2.1
2026-02-13 00:17:17 +05:30
2026-02-13 00:17:17 +05:30
seo
2025-12-14 06:45:34 +05:30
2026-02-13 00:17:17 +05:30
2024-08-06 01:16:01 +05:30
2024-08-07 12:50:31 +05:30
2026-02-13 00:01:00 +05:30

reduce.png

Reduce

A minimal URL shortener with user accounts, custom short codes, and password-protected links.

Features

  • Shorten URLs — works anonymously or logged-in
  • User accounts — register / login with username & password (JWT)
  • Custom short codes — choose your own slug (logged-in users)
  • Protected links — require authentication before redirect (uses account credentials or custom)
  • Dashboard — view, edit, and delete your links
  • Click tracking — see how many times each link was visited
  • QR codes — generated for every shortened URL

Production

Tech Stack

Layer Stack
Backend Go · Echo · GORM · SQLite
Frontend React · TypeScript · Tailwind
Auth JWT (72 h expiry) · bcrypt

API

Auth

Method Path Auth Description
POST /auth/register Create account
POST /auth/login Get JWT token
GET /auth/me JWT Current user info
Method Path Auth Description
POST /shorten Optional Create short link
GET /:code Resolve short code
POST /:code/verify Verify credentials for protected link
Method Path Auth Description
GET /links JWT List your links
PUT /links/:id JWT Update a link
DELETE /links/:id JWT Delete a link

Quick Start

Backend

cd backend
# Edit .env and set a secure JWT_SECRET:
# openssl rand -base64 32
go run .

Frontend

cd frontend
npm install
npm run dev

Docker

JWT_SECRET=$(openssl rand -base64 32) docker compose up --build

Database

SQLite with two tables:

  • users — id, username, password (bcrypt), timestamps
  • links — id, user_id (nullable), code (unique), long_url, is_custom, requires_auth, access_username, access_password (bcrypt), click_count, timestamps

When a logged-in user creates a protected link, they can choose:

  • Use account credentials — visitors must enter the owner's username/password
  • Custom credentials — set specific username/password for this link only

Contributing

Contributions welcome — feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Description
No description provided
Readme MIT 188 KiB
Languages
TypeScript 67.5%
Go 29.2%
HTML 1.8%
Makefile 0.7%
JavaScript 0.4%
Other 0.4%