Skip to content

shutuplex/lexsnip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LEXSNIP

LEXSNIP Logo

A modern, IDE-like code sharing workspace powered by AI.



About The Project

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.


✨ Key Features

  • 🗂️ 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 .zip file instantly.

  • 🔗 One-Click Sharing
    Generate a persistent shareable URL for your workspace.


🛠️ Tech Stack

Frontend

  • React (Vite)
  • Tailwind CSS
  • PrismJS
  • React Simple Code Editor
  • JSZip & FileSaver.js
  • React Router DOM

Backend

  • Node.js
  • Express.js
  • MongoDB & Mongoose
  • Google Generative AI SDK (@google/generative-ai)

🚦 Getting Started

Follow these steps to run the project locally.


📌 Prerequisites

  • Node.js (v18+ recommended)
  • MongoDB Atlas account
  • Google AI Studio API Key (Gemini)

⚙️ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/yourusername/lexsnip.git
cd lexsnip

🔧 Backend Setup

cd backend
npm install

Create a .env file in the backend folder:

PORT=5000
MONGO_URI=your_mongodb_connection_string_here
GEMINI_API_KEY=your_google_gemini_api_key_here

Start the backend:

npm run dev
# or
node server.js

🎨 Frontend Setup

cd frontend
npm install

Create a .env file in the frontend folder:

VITE_BACKEND_URL=

Start the frontend:

npm run dev

🌍 Deployment

🔹 Backend (Hostinger VPS / Node Hosting)

  1. Push backend code to GitHub
  2. Configure CORS in server.js:
app.use(cors({
  origin: 'https://your-frontend-domain.vercel.app'
}));
  1. Deploy on Hostinger:
npm install -g pm2
pm2 start server.js --name "lexsnip-backend"
  1. Add environment variables on server:
  • MONGO_URI
  • GEMINI_API_KEY
  • PORT

🔹 Frontend (Vercel)

  1. Push frontend to GitHub
  2. 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 🚀


📂 Project Structure

LEXSNIP/
├── backend/
│   ├── models/
│   │   └── Snippet.js
│   ├── .env
│   └── server.js
│
└── frontend/
    ├── src/
    │   ├── pages/
    │   │   ├── CreateSnippet.jsx
    │   │   └── SnippetView.jsx
    │   ├── App.jsx
    │   └── main.jsx
    ├── .env
    └── tailwind.config.js

💡 Usage

  1. Open the app in your browser

  2. Use the sidebar to:

    • ➕ Add files
    • ✏️ Rename files
    • 📂 Navigate between files
  3. Write code in the live editor

  4. Click Share Workspace to generate a URL

  5. Use:

    • ✨ AI Chat → for explanations/debugging
    • ⬇️ Download ZIP → save project locally

🤝 Contributing

Contributions are welcome!

# Fork the repo
git checkout -b feature/AmazingFeature
git commit -m "Add AmazingFeature"
git push origin feature/AmazingFeature

Then open a Pull Request


📜 License

Distributed under the MIT License.
See LICENSE for more information.

About

A simple code Pastebin with ai chat integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages