SyncRunCode is a modern, full-featured real-time collaborative code compiler and IDE built with React, Vite, Tailwind CSS, Node.js, and MongoDB. Features real-time collaboration, multi-language support, and seamless deployment to Render (backend) and Vercel (frontend).
π Try SyncRunCode now!
- Frontend: https://sync-run-code.vercel.app/
- Backend API: https://syncruncode.onrender.com
- Visit: https://sync-run-code.vercel.app/
- Register a new account or use existing credentials
- Start coding in any supported language
- Create projects and collaborate in real-time
- Access admin dashboard (if you have admin privileges)
- Multi-Language Support: JavaScript, Python, Java, C++, C, TypeScript with syntax highlighting
- Real-time Code Execution: Instant compilation and execution with timeout protection
- Monaco Editor Integration: Professional code editor with IntelliSense, auto-completion, and themes
- Project Management: Create, save, organize, and manage code projects with version control
- Real-time Collaboration: Live code sharing and collaborative editing via WebSocket
- User Authentication: Secure JWT-based registration and login system
- Responsive Design: Fully responsive interface that works on all devices
- Code Formatting: Built-in code formatter for JavaScript, Python, and JSON
- File Operations: Upload, download, and manage code files
- Execution History: Track and review past code executions
- Customizable Editor: Adjustable font size, tab size, themes, and editor preferences
- Project Sharing: Public/private project visibility settings
- Search & Filter: Advanced project search with language and date filtering
- Profile Management: User profile settings and preferences
- Health Monitoring: Built-in health check endpoints for monitoring
- Modern UI/UX: Beautiful gradient backgrounds, smooth animations, and responsive design
- Mobile-First Design: Fully optimized for mobile devices with touch-friendly interactions
- Admin Dashboard: Comprehensive overview of platform statistics with modern UI
- User Management: Create, edit, delete, and manage user accounts
- Project Management: Monitor and manage user projects
- Analytics & Reports: Detailed analytics on users, projects, and executions
- System Monitoring: Real-time system health and performance monitoring
- Role-Based Access Control: Granular permissions for different admin levels
- Super Admin: Full system access with ability to create other admins
- Beautiful Admin Interface: Modern gradient designs and responsive admin panels
- π¨ Modern Design System: Beautiful gradient backgrounds and glass-morphism effects
- π± Mobile-First Approach: Fully responsive design optimized for all screen sizes
- π Smooth Animations: Hover effects, transitions, and micro-interactions
- π― Enhanced User Experience: Touch-friendly elements and intuitive navigation
- π Color-Coded Elements: Language badges, status indicators, and visual hierarchy
- π« Interactive Components: Animated cards, buttons, and form elements
- Professional Layout: Clean, modern interface with proper spacing
- Enhanced Visual Hierarchy: Better typography and component organization
- Hover Effects: Subtle animations and visual feedback
- Gradient Backgrounds: Beautiful color schemes throughout the application
- Tab-Based Navigation: Mobile-optimized navigation for better usability
- Touch-Friendly Elements: Larger buttons and touch targets
- Responsive Grids: Adaptive layouts that work on all screen sizes
- Optimized Typography: Readable text sizes and proper line heights
- React 18 - Modern UI library with hooks and context
- Vite - Lightning-fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework with custom components and gradients
- React Router v6 - Client-side routing with protected routes
- Monaco Editor - Professional code editor (VS Code engine)
- Socket.io Client - Real-time WebSocket communication
- React Hot Toast - Beautiful notification system
- Framer Motion - Smooth animations and transitions
- React Icons - Comprehensive icon library
- Axios - HTTP client for API communication
- Modern CSS - Gradient backgrounds, backdrop blur, and responsive design
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database with Mongoose ODM
- Socket.io - Real-time bidirectional communication
- JWT - JSON Web Token authentication
- Bcryptjs - Password hashing and security
- Express Validator - Input validation middleware
- Helmet - Security headers middleware
- Rate Limiting - API request throttling
- CORS - Cross-origin resource sharing
- Render - Backend hosting
- Vercel - Frontend hosting
- Node.js (v18 or higher)
- MongoDB (for local development)
-
Clone the repository
git clone https://github.com/saurav-kumar-sah-dev/SyncRunCode.git cd SyncRunCode -
Install dependencies
# Install root dependencies npm install # Install client dependencies cd client && npm install # Install server dependencies cd ../server && npm install
-
Set up environment variables
# Copy example files cp server/env.example server/.env cp client/env.example client/.env # Edit both .env files with your settings
-
Start MongoDB (local development)
# Using MongoDB service sudo systemctl start mongod # Or using Docker docker run -d -p 27017:27017 --name mongodb mongo:latest
-
Create Super Admin (Optional)
cd server npm run create-superadminThis creates a super admin user with default credentials.
β οΈ SECURITY: Change the password immediately after first login!π‘ TIP: Use environment variables for custom admin credentials:
ADMIN_USERNAME=your-admin-username ADMIN_EMAIL=your-admin@email.com ADMIN_PASSWORD=your-secure-password npm run create-superadmin
-
Start the application
# Start both frontend and backend npm run dev # Or start them separately: # Terminal 1 - Backend cd server && npm run dev # Terminal 2 - Frontend cd client && npm run dev
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Admin Dashboard: http://localhost:3000/admin (admin users only)
- Backend: β Successfully deployed on Render
- Frontend: β Successfully deployed on Vercel
- Database: β MongoDB Atlas connected
- Domain: β Custom domain configured
- SSL: β HTTPS enabled
- Status: π’ LIVE AND WORKING
- Push code to GitHub
- Connect repository to Render
- Deploy with the provided
render.yamlconfiguration - Set environment variables in Render dashboard
- Push code to GitHub
- Connect repository to Vercel
- Deploy with the provided
vercel.jsonconfiguration - Set environment variables in Vercel dashboard
For detailed deployment instructions, see DEPLOYMENT.md.
syncruncode/
βββ client/ # React frontend (Vite + Tailwind)
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ Auth/ # Authentication components
β β β βββ Layout/ # Layout components (Navbar)
β β β βββ UI/ # UI components (LoadingSpinner)
β β βββ pages/ # Page components
β β β βββ Auth/ # Login/Register pages
β β β βββ Compiler.jsx # Main code editor page
β β β βββ Projects.jsx # Project management
β β β βββ Profile.jsx # User profile settings
β β β βββ Home.jsx # Landing page
β β βββ contexts/ # React contexts
β β β βββ AuthContext.jsx # Authentication state
β β β βββ ThemeContext.jsx # Theme preferences
β β β βββ SocketContext.jsx # WebSocket connection
β β βββ config/ # API configuration
β β βββ utils/ # Utility functions
β β βββ App.jsx # Main app component
β β βββ main.jsx # App entry point
β β βββ index.css # Global styles
β βββ public/ # Static assets
β βββ vite.config.js # Vite configuration
β βββ tailwind.config.js # Tailwind configuration
β βββ vercel.json # Vercel deployment config
β βββ package.json # Frontend dependencies
βββ server/ # Node.js backend
β βββ models/ # MongoDB models
β β βββ User.js # User schema
β β βββ Project.js # Project schema
β β βββ Execution.js # Code execution schema
β βββ routes/ # API routes
β β βββ auth.js # Authentication routes
β β βββ projects.js # Project management routes
β β βββ execution.js # Code execution routes
β β βββ health.js # Health check endpoint
β βββ services/ # Business logic
β β βββ CodeExecutor.js # Code execution service
β βββ middleware/ # Express middleware
β β βββ auth.js # JWT authentication middleware
β βββ index.js # Server entry point
β βββ render.yaml # Render deployment config
β βββ package.json # Backend dependencies
βββ DEPLOYMENT.md # Detailed deployment guide
βββ SETUP.md # Quick setup guide
βββ README.md # This file
# Install all dependencies
npm run install-all
# Start development (both frontend and backend)
npm run dev
# Start only backend
npm run server
# Start only frontend
npm run client
# Build for production
npm run build
# Start production server
npm startPOST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user profilePUT /api/auth/profile- Update user profile
GET /api/projects- Get user's projects (with pagination, search, filtering)GET /api/projects/public- Get public projectsGET /api/projects/:id- Get specific projectPOST /api/projects- Create new projectPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete project
POST /api/execution/run- Execute codeGET /api/execution/history- Get execution historyGET /api/execution/:id- Get specific execution detailsDELETE /api/execution/:id- Delete execution record
GET /api/health- Health check endpoint
GET /api/admin/dashboard- Admin dashboard statisticsGET /api/admin/users- Get all users (with pagination, search, filtering)GET /api/admin/users/:id- Get specific user detailsPUT /api/admin/users/:id- Update user (role, permissions, status)DELETE /api/admin/users/:id- Delete userGET /api/admin/projects- Get all projects (admin view)DELETE /api/admin/projects/:id- Delete projectGET /api/admin/analytics/users- User analytics and reportsGET /api/admin/analytics/projects- Project analytics and reportsGET /api/admin/analytics/executions- Execution analytics and reportsGET /api/admin/system/health- System health monitoringPOST /api/admin/create-superadmin- Create super admin (superadmin only)
- Modify
client/tailwind.config.jsfor theme customization - Update
client/src/index.cssfor global styles - Use Tailwind utility classes throughout components
- Add new routes in
server/routes/ - Create new models in
server/models/ - Add middleware in
server/middleware/
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/syncruncode
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRE=7d
CORS_ORIGIN=http://localhost:3000
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
EXECUTION_TIMEOUT=5000
MAX_FILE_SIZE=10485760# API Configuration
VITE_API_URL=http://localhost:5000
VITE_SOCKET_URL=http://localhost:5000
# Application Configuration
VITE_APP_NAME=SyncRunCode
VITE_APP_VERSION=1.0.0
VITE_DEFAULT_THEME=dark
VITE_ENABLE_DARK_MODE=true
VITE_EDITOR_THEME=vs-dark
VITE_EDITOR_FONT_SIZE=14
VITE_EDITOR_TAB_SIZE=2
VITE_ENABLE_ANALYTICS=false
VITE_ENABLE_DEBUG=false
VITE_ENABLE_HTTPS=false- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- JWT Authentication with secure token management
- Role-Based Access Control (RBAC) with granular permissions
- Password Hashing using bcrypt with salt
- Rate Limiting to prevent API abuse
- Input Validation and sanitization
- CORS Protection for cross-origin security
- Helmet Security Headers for additional protection
- Sandboxed Code Execution with timeout protection
- Change default admin password after first login
- Use strong JWT secrets in production
- Configure secure MongoDB connection
- Enable HTTPS/SSL certificates
- Set up proper CORS origins
- Monitor system logs regularly
- Keep dependencies updated
For detailed security guidelines, see SECURITY.md.
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use - Use in commercial projects
- β Modification - Modify and adapt the code
- β Distribution - Share and distribute copies
- β Private use - Use in private projects
- β Patent use - Use patented components
Attribution required: Include the original copyright notice and license text in any substantial portions of the software.
- Multi-language Support: JavaScript (Node.js), Python, Java (JDK), C++ (GCC), C (GCC), TypeScript
- Sandboxed Execution: Secure code execution with timeout protection
- Compiler Detection: Automatic detection of required compilers
- Error Handling: Comprehensive error reporting and debugging
- Memory Management: Resource monitoring and cleanup
- WebSocket Integration: Live code sharing between users
- Room-based System: Project-specific collaboration rooms
- Conflict Resolution: Smart handling of simultaneous edits
- User Presence: Real-time user activity indicators
- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcrypt-based password security
- Rate Limiting: API request throttling and abuse prevention
- Input Validation: Comprehensive input sanitization
- CORS Protection: Cross-origin request security
- Helmet Security: Security headers and protection
-
MongoDB Connection Error
- Ensure MongoDB is running locally or use MongoDB Atlas
- Check connection string in
.envfile - Verify network connectivity
-
Code Execution Failures
- Install required compilers (see COMPILER_SETUP.md for detailed instructions)
- Check file permissions for temporary directories
- Verify execution timeout settings
-
Build/Deployment Issues
- Ensure Node.js version compatibility (v18+)
- Check environment variables are properly set
- Verify all dependencies are installed
-
Real-time Features Not Working
- Check WebSocket connection in browser dev tools
- Verify Socket.io configuration
- Ensure firewall allows WebSocket connections
- Check the console for detailed error messages
- Review the SETUP.md for detailed setup instructions
- Consult COMPILER_SETUP.md for compiler installation guide
- Consult DEPLOYMENT.md for deployment guidance
- Verify all environment variables are correctly configured
- Languages: JavaScript (96.9%), CSS (2.4%), Other (0.7%)
- Topics: react, nodejs, javascript, python, java, jwt, express, admin, mongodb, compiler, cpp, websocket, collaboration, auth, socketio, tailwindcss, vite
- License: MIT License
- Stars: β Star this repository if you find it helpful!
- GitHub Repository: https://github.com/saurav-kumar-sah-dev/SyncRunCode
- Live Demo: https://sync-run-code.vercel.app
- Backend API: https://syncruncode.onrender.com
Happy Coding! π
SyncRunCode - Where Code Syncs and Runs
Built with β€οΈ for developers worldwide