A simple URL shortener with QR code generation and click tracking.
Built as a CloudFALL project to replace paid link-shortening services like Bitly.
- 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
- Frontend: React (Vite)
- Backend: Express (Node.js)
- Database: PostgreSQL
- Package Manager: pnpm
- Deployment: Vercel (frontend) + Render (backend + database)
snaplink/ ├── client/ React frontend ├── server/ Express backend ├── package.json Root package ├── pnpm-workspace.yaml ├── README.md └── LICENSE
- Node.js 22 or higher
- pnpm installed
- A PostgreSQL database (free options: Neon, Aiven, or Render)
-
Clone the repo: git clone https://github.com/omarhossdev/snaplink.git cd snaplink
-
Install dependencies: pnpm install
-
Set up environment variables in
server/.env: DATABASE_URL=your_postgres_connection_string PORT=3000 -
Run the development servers: pnpm dev
POST /api/links- Create a short linkGET /:slug- Redirect to the original URL and count the clickGET /api/links- List all links (for the dashboard)
Table: links
id(serial, primary key)slug(text, unique)original_url(text)clicks(integer, default 0)created_at(timestamp)
MIT