A personal code snippet manager built with Next.js, TypeScript, and PostgreSQL. Save, tag, and search your code snippets with syntax highlighting for 15+ languages. Think Gist but for your own use — fast, private, and yours.
- Framework: Next.js 16 (App Router), TypeScript
- Styling: Tailwind CSS + shadcn/ui (dark theme)
- Database: PostgreSQL via Prisma ORM
- Auth: NextAuth v5 (Google OAuth)
- Syntax Highlighting: react-syntax-highlighter (Prism)
- Deployment: Vercel + Supabase
- Sign in with Google
- Create snippets with title, language, and tags
- Syntax-highlighted preview cards
- Real-time search across title, tags, and code content
- Full snippet view with copy-to-clipboard
- Edit and delete snippets
git clone <your-repo>
cd codeshelf
npm installcp .env.example .env.localFill in the values in .env.local:
| Variable | Where to get it |
|---|---|
DATABASE_URL |
Supabase → Project Settings → Database → Connection string (Transaction pooler). Add ?pgbouncer=true&connection_limit=1 |
NEXTAUTH_SECRET |
Run: openssl rand -base64 32 |
GOOGLE_CLIENT_ID |
Google Cloud Console → APIs & Services → Credentials |
GOOGLE_CLIENT_SECRET |
Same as above |
For Google OAuth, set the authorized redirect URI to:
http://localhost:3000/api/auth/callback/google (dev) and your production URL.
npx prisma migrate dev --name initnpm run devVisit http://localhost:3000.
- Push to GitHub
- Import repo on vercel.com
- Add all environment variables in Vercel project settings
- Deploy