A modern, real-time code sharing platform built with Next.js 14 and Prisma. Share code snippets instantly with syntax highlighting for multiple programming languages.
- Real-time code sharing
- Syntax highlighting for multiple languages
- Mobile-responsive design
- Anonymous or named paste creation
- Recent pastes feed
- Custom paste URLs
- Dark mode interface
- Next.js 14 - React framework with App Router
- TailwindCSS - Utility-first CSS framework
- Monaco Editor - Code editor that powers VS Code
- TypeScript - Type-safe JavaScript
- Prisma - Next-generation ORM
- PostgreSQL - Relational database
- Next.js API Routes - API endpoints
- Vercel - Deployment platform
- Database hosting options:
Create a .env
file in the root directory:
with the following variables:
DATABASE_URL="YOUR_DATABASE_URL" ADMIN_PASSWORD="YOUR_ADMIN_PASSWORD"
- Clone the repository:
git clone https://github.com/yourusername/codepaste.git
cd codepaste
- 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.
prisma model Paste { id String @id @default(cuid()) content String language String @default("plaintext") title String? authorName String @default("Anonymous") createdAt DateTime @default(now()) }
- Server-side rendering for better SEO
- Optimized database queries
- Efficient caching strategy
- Fast page loads with Next.js App Router
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
- Plain Text
- JavaScript
- TypeScript
- Python
- Java
- HTML
- CSS
- Zero-second revalidation using
export const revalidate = 0
- Client-side refresh after paste creation
- Optimistic updates for better UX
- Monaco Editor integration with multiple language support
- Custom theme and settings
- Auto-indent and syntax highlighting
- Prisma ORM for type-safe database operations
- PostgreSQL for reliable data storage
- Efficient connection pooling in production
- Responsive design using TailwindCSS
- Dark mode optimized interface
- Clean and intuitive layout
- Mobile-first approach
- Next.js team
- Prisma team
- Monaco Editor team
- Vercel for hosting
Abdul shaikh - @abduldotexe
Link tree: Portfolio