LEXSNIP is a powerful, full-stack alternative to traditional pastebins. Instead of sharing a single flat text file, LEXSNIP provides a multi-file workspace with good user interface.
Users can write, organize, and share complete projects using a single link.
It also includes an integrated AI Assistant powered by Google Gemini, enabling real-time explanations, debugging, and code insights directly within the shared workspace.
-
🗂️ Multi-File Workspaces
Create, rename, edit, and organize multiple files in one session. -
🤖 Interactive AI Assistant
Ask questions, debug code, and get explanations with context-aware AI. -
📦 ZIP Downloads
Download the entire workspace as a.zipfile instantly. -
🔗 One-Click Sharing
Generate a persistent shareable URL for your workspace.
- React (Vite)
- Tailwind CSS
- PrismJS
- React Simple Code Editor
- JSZip & FileSaver.js
- React Router DOM
- Node.js
- Express.js
- MongoDB & Mongoose
- Google Generative AI SDK (
@google/generative-ai)
Follow these steps to run the project locally.
- Node.js (v18+ recommended)
- MongoDB Atlas account
- Google AI Studio API Key (Gemini)
git clone https://github.com/yourusername/lexsnip.git
cd lexsnipcd backend
npm installCreate a .env file in the backend folder:
PORT=5000
MONGO_URI=your_mongodb_connection_string_here
GEMINI_API_KEY=your_google_gemini_api_key_hereStart the backend:
npm run dev
# or
node server.jscd frontend
npm installCreate a .env file in the frontend folder:
VITE_BACKEND_URL=Start the frontend:
npm run dev- Push backend code to GitHub
- Configure CORS in
server.js:
app.use(cors({
origin: 'https://your-frontend-domain.vercel.app'
}));- Deploy on Hostinger:
npm install -g pm2
pm2 start server.js --name "lexsnip-backend"- Add environment variables on server:
- MONGO_URI
- GEMINI_API_KEY
- PORT
- Push frontend to GitHub
- Import project into Vercel
Build Settings:
- Framework: Vite
- Build Command: npm run build
- Output Directory: dist
Environment Variable:
VITE_BACKEND_URL=https://your-backend-domain.com
Click Deploy 🚀
LEXSNIP/
├── backend/
│ ├── models/
│ │ └── Snippet.js
│ ├── .env
│ └── server.js
│
└── frontend/
├── src/
│ ├── pages/
│ │ ├── CreateSnippet.jsx
│ │ └── SnippetView.jsx
│ ├── App.jsx
│ └── main.jsx
├── .env
└── tailwind.config.js
-
Open the app in your browser
-
Use the sidebar to:
- ➕ Add files
- ✏️ Rename files
- 📂 Navigate between files
-
Write code in the live editor
-
Click Share Workspace to generate a URL
-
Use:
- ✨ AI Chat → for explanations/debugging
- ⬇️ Download ZIP → save project locally
Contributions are welcome!
# Fork the repo
git checkout -b feature/AmazingFeature
git commit -m "Add AmazingFeature"
git push origin feature/AmazingFeatureThen open a Pull Request
Distributed under the MIT License.
See LICENSE for more information.
