Pastekaro is a minimalist, modern, and powerful pastebin application built with Next.js. It features a unique dual-mode architecture that caters to both anonymous users looking for quick text sharing and power users who want persistent organization.
Traditional pastebins often force a choice: either they are too simple (you lose track of your pastes, no editing, no organization) or they are too complex (requiring accounts to do anything, cluttered UIs).
Pastekaro solves this by offering a frictionless workflow:
- The Fast Path: Anyone can drop text, set expiry constraints (time or views), and instantly get a shareable link. No sign-up required.
- The Power Path: Logged-in users get a dedicated dashboard to save, edit, and organize their pastes into thematic collections. They can edit an existing paste to fix typos without the URL ever changing, solving the "I shared a broken link" problem.
- Zero-Friction Creation: Paste text and get a link instantly.
- Auto-Destruct (TTL): Set a Time-to-Live (e.g., 3600 seconds) after which the paste automatically deletes itself.
- Burn After Reading: Set a Maximum View count (e.g., 5 views). After the 5th view, the paste self-destructs.
- Fast Storage: Powered by Vercel KV (Redis) for ultra-low latency reads and native TTL support.
- User Accounts: Secure authentication powered by NextAuth (custom Credentials provider).
- Persistent Storage: Pastes saved to the account are stored permanently in PostgreSQL.
- Rich Dashboard: A comprehensive centralized view of all your pastes and collections.
- Editable Pastes: Fix typos or update code! Logged-in users can edit paste content, title, and constraints while preserving the original URL.
- Collections (Packages):
- Group related pastes into named Collections.
- Set Collections as Public (🌍) or Private (🔒).
- Share a single link to a Collection (
/c/[id]) so others can view all associated pastes. - Manage ordering: easily drag or move pastes up and down within a collection.
- Add new pastes directly from inside the collection manager.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database (Relational): Vercel Postgres (for Users, Collections, saved Pastes)
- Database (Key-Value): Vercel KV / Redis (for anonymous temporary pastes)
- Authentication: NextAuth.js (v4) with JWT strategy and bcrypt password hashing
- ID Generation:
nanoidfor short, URL-friendly IDs
- Node.js 18+ installed
- Vercel account (for Postgres & KV databases)
- Vercel CLI installed (
npm i -g vercel)
-
Clone the repository
git clone <your-repo-url> cd pastebin-lite
-
Install dependencies
npm install
-
Set up Vercel Environment (Postgres, KV, Auth)
vercel login vercel link vercel env pull .env.local
Make sure you have added
NEXTAUTH_SECRETandNEXTAUTH_URL=http://localhost:3000to your local.env.localfile. -
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
When deploying to Vercel, ensure you have set all required environment variables in your Vercel Project Settings:
POSTGRES_URL(Auto-configured if you use Vercel Storage)REDIS_URL/KV_URL(Auto-configured if you use Vercel Storage)NEXTAUTH_SECRET(Runopenssl rand -base64 32to generate one)NEXTAUTH_URL(e.g.,https://pastekaro.vercel.app)
The app exposes a robust API to power its client-side interactions:
- Auth:
/api/auth/signup, NextAuth routes - Anonymous Pastes:
POST /api/pastes,GET /api/pastes/[id] - Authenticated Pastes:
GET /api/pastes/my,GET/PUT/DELETE /api/pastes/my/[id] - Collections:
GET/POST /api/collections,GET/PUT/DELETE/PATCH /api/collections/[id] - Public View:
GET /api/collections/[id]/public
MIT