Skip to content
omarhossdevPublic

About

A self-hosted URL shortener with QR codes and click tracking. Built with Express, PostgreSQL, and React.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

SnapLink

A simple URL shortener with QR code generation and click tracking.

Built as a CloudFALL project to replace paid link-shortening services like Bitly.

Features

  • Shorten any long URL into a short link
  • Generate a QR code for each link
  • Track how many times each link was clicked
  • Simple dashboard to view all your links

Tech Stack

  • Frontend: React (Vite)
  • Backend: Express (Node.js)
  • Database: PostgreSQL
  • Package Manager: pnpm
  • Deployment: Vercel (frontend) + Render (backend + database)

Project Structure

snaplink/ ├── client/ React frontend ├── server/ Express backend ├── package.json Root package ├── pnpm-workspace.yaml ├── README.md └── LICENSE

Getting Started

Prerequisites

  • Node.js 22 or higher
  • pnpm installed
  • A PostgreSQL database (free options: Neon, Aiven, or Render)

Installation

  1. Clone the repo: git clone https://github.com/omarhossdev/snaplink.git cd snaplink

  2. Install dependencies: pnpm install

  3. Set up environment variables in server/.env: DATABASE_URL=your_postgres_connection_string PORT=3000

  4. Run the development servers: pnpm dev

API Routes

  • POST /api/links - Create a short link
  • GET /:slug - Redirect to the original URL and count the click
  • GET /api/links - List all links (for the dashboard)

Database Schema

Table: links

  • id (serial, primary key)
  • slug (text, unique)
  • original_url (text)
  • clicks (integer, default 0)
  • created_at (timestamp)

License

MIT

About

A self-hosted URL shortener with QR codes and click tracking. Built with Express, PostgreSQL, and React.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages