trimrr is a sleek, modern, full-stack URL shortening platform built with React (Vite), Supabase, Tailwind CSS, and Shadcn UI. It lets users shorten URLs, optionally customize them, generate QR codes, and track click analytics including device type and location in real-time.
This project was built from scratch integrating authentication, protected routing, cloud storage for QR images, device and location tracking using external APIs and libraries, and data visualizations via interactive charts.
-
User Authentication:
Email-based signup and login using Supabase Auth. -
Shorten and Manage URLs:
Users can create both random and custom short URLs pointing to any original URL. -
QR Code Generation:
Automatically generate QR codes for every short URL and store them in Supabase Storage Buckets. -
Click Tracking:
Records each time a short URL is visited, logging:- Device type (mobile, desktop, etc.)
- Visitor’s city and country (via
ipapi.co)
-
Analytics Dashboard:
View:- Total clicks
- Top cities by clicks
- Device type distribution (pie and line charts via Recharts)
-
Protected Routes:
Authenticated access only for: -
Dashboard (
/dashboard) -
Individual Link Stats (
/link/:id) -
Copy, Download, Delete
- Copy short URL
- Download QR Code image
- Delete URL (with confirmation)
- Frontend: React (Vite), Tailwind CSS, Shadcn UI
- Backend: Supabase (Database, Auth, Storage)
- Device Detection:
ua-parser-js - Charts: Recharts
- Routing: React Router v6
- State Management: React Context API
- Form Validation: Yup
- Loaders/Spinners:
react-spinners - Click Location:
ipapi.coAPI
- Clone the repository
git clone https://github.com/rajanarahul93/trimrr.git
cd trimrr- Install dependencies
npm install- Setup Supabase
-
Create a free Supabase project.
-
Enable Email Authentication in Supabase settings.
-
Create two tables:
-
urlsid,original_url,short_url,custom_url,user_id,title,qr,created_at
-
clicksid,url_id,city,device,country,created_at
-
-
Create a Supabase Bucket for QR images.
- Update Supabase config
In /src/db/supabase.js:
const supabase = createClient(
"YOUR_SUPABASE_URL",
"YOUR_SUPABASE_ANON_KEY"
);- Run the app
npm run dev-
React project initialized using Vite.
-
Tailwind CSS and Shadcn UI installed for styling and components.
-
Supabase project created with:
urlstable for managing URL entries.clickstable for storing click logs.- Supabase email authentication enabled.
-
Created protected React routes using React Router.
-
Built authentication pages:
/auth(Login/Signup with validation and email auth)
-
Developed a Dashboard displaying user’s short links, search functionality, and click stats.
-
Integrated QR code generation and uploaded to Supabase Buckets.
-
Set up click logging:
- Captures visitor’s city and country via
ipapi.co - Detects device type with
ua-parser-js - Stores analytics in
clickstable.
- Captures visitor’s city and country via
-
Visualized analytics with Recharts (Line chart for location, Pie chart for device type).
-
Enabled copy, download, and delete actions for links.
-
Added loaders, spinners, and error handling for all async operations.
- View and manage your shortened URLs.
- Copy or download QR codes.
- See click statistics (total, by city, by device).
- Delete links.
- Create new short or custom links with title and QR.
- Responsive layout built with Tailwind CSS and Shadcn UI components.
- Clean, minimalistic dashboard with intuitive navigation.
- Real-time feedback on actions (spinners, loaders, error messages).
Made by Rahul