A modern code snippet sharing platform. Share code with output and syntax highlighting with ease.
- Authentication: Sign in with Google or GitHub (via Firebase Auth)
- Create & Share Snippets: Write, run, and share code snippets in JavaScript, Python, Java, and C++
- Syntax Highlighting: Monaco Editor and Prism for beautiful code display
- Run Code: Execute code snippets using the Piston API
- User Dashboard: View, manage, and delete your snippets
- Demo Functionality: Interactive demo page showcasing platform features with pre-created examples
- Responsive UI: Built with Next.js App Router and Tailwind CSS
- Theming: Light/dark mode support
- Next.js 14 (App Router)
- React 18
- Tailwind CSS
- Firebase (Auth, Firestore)
- Monaco Editor
- Piston API for code execution
- Node.js 18+
- npm or pnpm (choose one, do not use both lockfiles)
- Clone the repository:
git clone https://github.com/Auxilus08/SnipShare.git cd SnipShare - Install dependencies:
npm install # or pnpm install - Copy
.env.exampleto.env.localand fill in your Firebase credentials:cp .env.example .env.local
These are used in lib/firebase.js:
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
npm run dev
# or
pnpm devVisit http://localhost:3000 in your browser.
- Sign in with Google or GitHub
- View demos to explore platform features
- Create a new snippet from the dashboard
- Write and run code in supported languages
- Share your snippet with others
- Manage your snippets from your profile
SnipShare includes a comprehensive demo system to showcase platform features:
- Demo Page (
/demo): Interactive gallery of demo snippets - Demo Snippets: Pre-created examples in JavaScript, Python, Java, and C++
- Admin Interface (
/admin/demo): Easy management of demo content - API Endpoint (
/api/demo): Server-side demo snippet creation
For detailed documentation, see DEMO_FUNCTIONALITY.md.
- For Firebase Auth with Google/GitHub, set the callback/redirect URL to:
http://localhost:3000/(for local development)- Or your deployed domain root
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.