LNK is a full-stack URL shortening application that allows users to create, share, and track shortened URLs. The application features a frontend for user interaction, a backend for API handling, and analytics tracking for each shortened URL.
- URL Shortening: Create short URLs for long links.
- Redirection: Automatically redirect users to the original URL when visiting the short link.
- Analytics: View detailed statistics for each shortened URL, including the number of clicks and visit history.
- Copy to Clipboard: Easily copy short URLs to the clipboard for sharing.
- Frontend: Next.js, Tailwind CSS, React, Axios, React-Toastify
- Backend: Hono.js, Prisma ORM, Cloudflare Workers
- Database: PostgreSQL with Prisma
- Deployment: Vercel (Frontend), Cloudflare (Backend)
- Node.js (v20 or later)
- PostgreSQL
-
Fork and then Clone the repository:
git clone https://github.com/AnchalDevBytes/lnk.git cd lnk
-
Install dependencies: frontend & backend
cd lnk-backend npm install cd frontend npm install
-
Set up the database:
- Create a PostgreSQL and a Prisma accelerate database URL and update the
DATABASE_URL
with prisma accelerate andDIRECT_URL
with postgresql url, in the.env
file of backend. - In the frontend
.env
just paste the backend server url examplehttp://localhost:8787
- Create a PostgreSQL and a Prisma accelerate database URL and update the
-
Run database migrations:
npx prisma migrate dev --name name_of_migration npx prisma generate --no-engine
-
Start the backend server:
npm run dev