A simple, lightweight pastebin application for creating and sharing text pastes with optional expiration and view limits.
- Next.js 14.2.15: React framework for full-stack web development
- React 18: UI library for building interactive interfaces
- TypeScript 5: Typed JavaScript for better code quality
- Prisma 5.0.0: ORM for database management with SQLite
- nanoid: Library for generating unique paste IDs
- ESLint: Code linting tool
- Create and share text pastes
- Optional time-to-live (TTL) for automatic expiration
- Optional maximum view count before deletion
- Unique URLs for each paste
- RESTful API for programmatic access
-
Clone the repository:
git clone <repository-url> cd pastebin-lite
-
Install dependencies:
npm install
-
Set up the database:
npx prisma generate npx prisma db push
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Visit the homepage to create a new paste.
- Enter your text, set optional TTL and max views.
- Share the generated URL.
GET /api/healthz: Health checkPOST /api/pastes: Create a new pasteGET /api/pastes/[id]: Retrieve a paste by ID
npm run dev: Start development servernpm run build: Build for productionnpm run start: Start production servernpm run lint: Run ESLintnpm run db:generate: Generate Prisma clientnpm run db:push: Push database schema
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.