Welcome to the Online Code IDE! This platform allows users to write, test, and run code in an online, collaborative, and user-friendly environment. Currently, it supports HTML, CSS, and JavaScript, with real-time collaboration features powered by Socket.IO.
- Real-Time Collaboration: Collaborate with other developers and work on projects together, seeing live code updates as you type.
- Custom Code Editor: Fully customized code editor with syntax highlighting, line numbers, and tab indentation.
- Syntax Highlighting: Beautiful color-coded syntax for HTML, CSS, and JavaScript.
- Live Preview: Instantly see your HTML, CSS, and JavaScript output in real-time.
- Theme Support: Toggle between light and dark themes for comfortable coding.
- Version History: Track and view previous versions of your code.
- Code Analysis: Built-in lexical analyzer to tokenize and analyze your code.
- User Authentication: Secure login and signup with JWT-based authentication.
- Project Management: Create, save, and manage multiple projects.
- Invite Collaboration: Share project invite codes to collaborate with team members.
- Auto-Save: Automatic project saving with Ctrl+S support.
- React.js 18.3.1: Modern UI library
- Vite 5.4.10: Fast build tool and dev server
- TailwindCSS 3.4.14: Utility-first CSS framework
- Custom Code Editor: Built-in syntax highlighting and editor features
- Socket.IO Client 4.8.1: Real-time bidirectional communication
- React Router DOM 6.28.0: Client-side routing
- React Hot Toast 2.4.1: Beautiful toast notifications
- React Icons 5.3.0: Popular icon library
- Node.js & Express.js 4.21.1: Server framework
- Socket.IO 4.8.1: Real-time collaboration
- MongoDB & Mongoose 8.8.0: Database and ODM
- JWT (jsonwebtoken 9.0.2): Authentication
- bcryptjs 2.4.3: Password hashing
- dotenv 16.4.5: Environment variable management
- CORS: Cross-origin resource sharing
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- npm or yarn package manager
git clone https://github.com/0xYujan/Online-Code-IDE.git
cd Online-Code-IDE- Navigate to the backend directory:
cd backend- Install backend dependencies:
npm install- Create a
.envfile in thebackenddirectory with the following variables:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
PORT=3000- Start the backend server:
npm startThe backend server will run on http://localhost:3000
- Open a new terminal and navigate to the frontend directory:
cd frontend- Install frontend dependencies:
npm install- Start the frontend development server:
npm run devThe frontend will run on http://localhost:5173
Open your browser and navigate to http://localhost:5173 to start using the Online Code IDE!
- Navigate to the signup page
- Enter your name, email, and password
- Click "Sign Up" to create your account
- Go to the login page
- Enter your credentials
- Click "Login" to access your dashboard
- From the home page, click "Create New Project"
- Enter a project name
- Start coding in the Monaco editor
- Open your project
- Click the "Invite" button in the navbar
- Copy the project invite code
- Share the code with your collaborators
- They can join using the invite code
- Live Code Updates: See your collaborators' code changes in real-time
- User Presence: View who's currently working on the project
- Instant Preview: See output updates immediately in the preview pane
- Tab Switching: Switch between HTML, CSS, and JavaScript tabs
- Theme Toggle: Click the sun/moon icon to switch themes
- Expand View: Click the expand icon to maximize the editor
- Version History: Click the history icon to view previous versions
- Code Analysis: Click the code icon to analyze your code with the lexical analyzer
- Auto-Save: Press Ctrl+S to manually save, or changes auto-save periodically
Online-Code-IDE/
βββ backend/
β βββ bin/
β β βββ www # Socket.IO server configuration
β βββ models/
β β βββ userModel.js # User schema
β β βββ projectModel.js # Project schema
β βββ routes/
β β βββ index.js # API routes
β β βββ users.js # User routes
β βββ app.js # Express app configuration
β βββ server.js # Server entry point
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.jsx
β β β βββ EditiorNavbar.jsx
β β β βββ CodeAnalysis.jsx
β β β βββ VersionHistory.jsx
β β β βββ Collaboration.jsx
β β βββ pages/
β β β βββ Home.jsx
β β β βββ Login.jsx
β β β βββ SignUp.jsx
β β β βββ Editior.jsx
β β βββ utils/
β β β βββ lexicalAnalyzer.js
β β βββ socket.js # Socket.IO client configuration
β β βββ App.jsx
β β βββ main.jsx
β βββ package.json
β βββ vite.config.js
β
βββ README.md
- Ensure MongoDB is running locally or your MongoDB Atlas connection string is correct
- Check if your IP address is whitelisted in MongoDB Atlas
- Backend (Port 3000): Change the PORT in
.envfile - Frontend (Port 5173): Vite will automatically use the next available port
- Ensure both backend and frontend servers are running
- Check CORS configuration in backend if accessing from different domains
- Verify the socket URL in frontend matches your backend URL
- Ensure
react-iconsis properly installed:npm install react-icons - Clear browser cache and restart the dev server
- Real-time collaborative editing
- HTML, CSS, JavaScript support
- Monaco Editor integration
- User authentication
- Project management
- Version history
- Code analysis (Lexical analyzer)
- Support for additional programming languages (Python, Java, C++)
- File upload and import functionality
- Code execution in sandboxed environments
- Enhanced collaboration tools (cursor tracking, chat)
- AI-powered code suggestions
- Mobile responsive design improvements
- Export projects as zip files
- Syntax error highlighting
- Multiple file support per project
Contributions are welcome! If you have any ideas or improvements, feel free to fork the repo and submit a pull request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a pull request
- Follow existing code formatting
- Write clear commit messages
- Add comments for complex logic
- Test your changes before submitting
- Socket.IO - Real-time bidirectional event-based communication
- React Icons - Popular icon library
- TailwindCSS - Utility-first CSS framework
- Vite - Next generation frontend tooling
This project is licensed under the MIT License - see the LICENSE file for details.