A collaborative code snippet manager built with the MERN stack. Create, edit, and share code snippets with smart search functionality and collaborative editing features.
- 🔐 Authentication: JWT-based auth with Google OAuth support
- 👥 Anonymous Users: Create and edit snippets without registration
- 🤝 Collaborative Editing: Public snippets can be edited by anyone (Wikipedia-style)
- 🔍 Smart Search: Search by title - opens existing or creates new snippets
- 🎨 Modern UI: Built with React, Tailwind CSS, and Vite
- 📱 Responsive Design: Works on all devices
- 🔒 Privacy Controls: Public and private snippet options
- 📧 Email & SMS Verification: OTP verification system
- 🌐 Google OAuth Integration: Easy social login
- JWT-based authentication
- client/ — React + Vite + Tailwind frontend
- server/ — Node.js + Express backend with MongoDB (Mongoose)
cd server
cp .env.example .env
# Edit .env with your values
npm install
npm run dev
cd client
cp .env.example .env
# Edit .env with your Google Client ID
npm install
npm run dev
To enable email verification, you need to set up Gmail SMTP:
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password:
- Go to Google Account settings
- Security → 2-Step Verification → App passwords
- Generate a password for "Mail"
- Update your
.env
file:EMAIL_USER=your-email@gmail.com EMAIL_APP_PASSWORD=your-generated-app-password
The app uses MSG91 for SMS verification, which provides free credits for Indian numbers.
- Sign up at MSG91.com
- Verify your email and complete the registration
- Go to API section in your dashboard
- Copy your Auth Key
- Update your
.env
file:MSG91_AUTH_KEY=your-msg91-auth-key-here MSG91_SENDER_ID=CODEIT
- New accounts get 100-500 free SMS
- Cost after free credits: ~₹0.18-0.25 per SMS
- Perfect for testing and small applications
Once configured, test phone verification with Indian numbers (+91XXXXXXXXXX).
PORT
: Server port (default: 5000)MONGO_URI
: MongoDB connection stringJWT_SECRET
: Secret key for JWT tokensEMAIL_USER
: Gmail address for sending emailsEMAIL_APP_PASSWORD
: Gmail app passwordFRONTEND_URL
: Frontend URL for password reset linksMSG91_AUTH_KEY
: MSG91 auth key for SMS verificationMSG91_SENDER_ID
: MSG91 sender ID (default: CODEIT)
VITE_API_URL
: Backend API URLVITE_GOOGLE_CLIENT_ID
: Google OAuth Client ID
This scaffold creates route and controller stubs. Implementation and auth logic not added yet.