A modern, full-stack web application for real-time code collaboration, compilation, and sharing. Write, compile, run, and share code in Python, Java, and more with real-time collaboration features.
- Real-time Code Editor - Monaco Editor (VS Code's editor) integration
- Multi-language Support - Python, Java, and more
- Code Compilation & Execution - Run code directly in the browser
- User Authentication - Secure login/signup with Supabase
- Code Sharing - Share code snippets with unique URLs
- File Management - Save and manage your code files
- Beautiful UI - Modern, responsive design with TailwindCSS & Material-UI
- Real-time Collaboration - Work together on code in real-time
- React 18 - UI framework
- Vite - Build tool and dev server
- Monaco Editor - Code editor component
- TailwindCSS - Styling
- Material-UI - UI components
- React Router - Navigation
- Supabase - Authentication & Database
- Node.js - Runtime environment
- Express - Web framework
- Python 3 - Python code execution
- Java JDK - Java code compilation & execution
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher) - Download
- Python 3 - Download
- Java JDK - Download
- Supabase Account - Sign up
node --version # Should show v16 or higher
python3 --version # Should show Python 3.x
java --version # Should show Java version
javac --version # Should show Java compiler versiongit clone <your-repo-url>
cd SnipShare- Create a new project at supabase.com
- Go to Settings โ API
- Copy your credentials and update
.envfile:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_KEY=your_supabase_anon_key
VITE_SERVICE_ROLE=your_service_role_key# Install frontend dependencies
npm install
# Install backend dependencies
cd backend
npm install
cd .../start-dev.shThis will start both frontend and backend servers automatically.
# Terminal 1 - Backend API
cd backend
npm start
# Terminal 2 - Frontend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Health Check: http://localhost:3000/health
SnipShare/
โโโ backend/ # Backend API server
โ โโโ src/
โ โ โโโ server.js # Main server (Python + Java APIs)
โ โ โโโ python-server.js # Standalone Python API
โ โ โโโ java-server.js # Standalone Java API
โ โโโ package.json
โ โโโ .env
โ โโโ README.md
โโโ src/ # Frontend source code
โ โโโ PAGES/ # Page components
โ โ โโโ Home.jsx
โ โ โโโ Login.jsx
โ โ โโโ Signup.jsx
โ โ โโโ UserFiles.jsx
โ โโโ components/ # Reusable components
โ โ โโโ Navbar.jsx
โ โ โโโ TextEditors.jsx
โ โ โโโ Features.jsx
โ โ โโโ ...
โ โโโ utils/ # Utility functions
โ โโโ App.jsx # Main app component
โ โโโ main.jsx # Entry point
โ โโโ config.js # Configuration
โโโ public/ # Static assets
โโโ .env # Environment variables
โโโ .env.example # Environment template
โโโ package.json
โโโ vite.config.js
โโโ start-dev.sh # Development startup script
โโโ README.md
# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_KEY=your_supabase_anon_key
VITE_SERVICE_ROLE=your_service_role_key
# Backend API Endpoints
VITE_PYTHON_API=http://localhost:3000/api/python/execute
VITE_JAVA_API=http://localhost:3000/api/java/executePORT=3000
FRONTEND_URL=http://localhost:5173POST http://localhost:3000/api/python/execute
Content-Type: application/json
{
"code": "print('Hello, World!')",
"input": ""
}
POST http://localhost:3000/api/java/execute
Content-Type: application/json
{
"code": "public class Main { public static void main(String[] args) { System.out.println(\"Hello\"); } }",
"input": ""
}
# Health check
curl http://localhost:3000/health
# Test Python execution
curl -X POST http://localhost:3000/api/python/execute \
-H "Content-Type: application/json" \
-d '{"code":"print(\"Hello from Python\")"}'
# Test Java execution
curl -X POST http://localhost:3000/api/java/execute \
-H "Content-Type: application/json" \
-d '{"code":"public class Main { public static void main(String[] args) { System.out.println(\"Hello from Java\"); } }"}'- Rate Limiting - 100 requests per 15 minutes per IP
- CORS Protection - Configured for frontend origin
- Helmet Security - HTTP security headers
- Execution Timeout - 10-second limit per execution
- Temporary File Cleanup - Automatic cleanup after execution
- Supabase Auth - Secure authentication and authorization
- Execution time limited to 10 seconds
- Output size limited to 1MB
- No network access restrictions (security consideration for production)
- Memory tracking not implemented
- Docker containerization for better isolation
- Support for more languages (C++, JavaScript, Go, Rust)
- WebSocket for real-time output streaming
- Code versioning and history
- Collaborative editing with multiple cursors
- Code templates and snippets library
- Syntax highlighting themes
- Export code to GitHub Gist
- Ensure Python 3 and Java JDK are installed
- Check if port 3000 is available
- Verify backend dependencies are installed:
cd backend && npm install
- Ensure backend is running on port 3000
- Check
.envfile has correct API URLs - Verify CORS settings in backend
- Verify Supabase credentials in
.env - Check Supabase project is active
- Ensure correct API keys are used
- Verify Python 3 is installed:
python3 --version - Verify Java JDK is installed:
java --version && javac --version - Check backend logs for errors
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions, please open an issue on GitHub.