https://github.com/anchaldevbytes/lnk
A url shortner
https://github.com/anchaldevbytes/lnk
Last synced: about 2 months ago
JSON representation
A url shortner
- Host: GitHub
- URL: https://github.com/anchaldevbytes/lnk
- Owner: AnchalDevBytes
- Created: 2024-09-27T11:35:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-23T07:13:52.000Z (over 1 year ago)
- Last Synced: 2025-03-20T07:27:37.264Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://lnk-kappa.vercel.app
- Size: 300 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LNK: A Fullstack URL Shortener Application
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.
## Features
- **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.
## Screenshots

## Tech Stack
- **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)
## Installation and Setup
### Prerequisites
- Node.js (v20 or later)
- PostgreSQL
### Backend Setup
1. **Fork and then Clone the repository:**
```bash
git clone https://github.com/AnchalDevBytes/lnk.git
cd lnk
```
2. **Install dependencies: frontend & backend**
```bash
cd lnk-backend
npm install
cd frontend
npm install
```
3. **Set up the database:**
- Create a PostgreSQL and a Prisma accelerate database URL and update the `DATABASE_URL` with prisma accelerate and `DIRECT_URL` with postgresql url, in the `.env` file of backend.
- In the frontend `.env` just paste the backend server url example `http://localhost:8787`
4. **Run database migrations:**
```bash
npx prisma migrate dev --name name_of_migration
npx prisma generate --no-engine
```
5. **Start the backend server:**
```bash
npm run dev
```