CodeX is a real-time collaborative code editor with AI-powered code review capabilities. It allows multiple developers to work together on the same codebase simultaneously, with features like live chat, real-time code synchronization, and intelligent code analysis using Google's Gemini AI.
CodeX/
βββ Backend/ # Node.js + Express server
β βββ package.json
β βββ server.js
β βββ src/
β βββ app.js
β βββ config/
β β βββ config.js
β βββ controllers/
β β βββ auth.controllers.js
β β βββ project.controllers.js
β βββ db/
β β βββ db.js
β βββ middlewares/
β β βββ authMiddleware.js
β βββ models/
β β βββ message.model.js
β β βββ project.model.js
β β βββ team.model.js
β βββ routes/
β β βββ auth.routes.js
β β βββ project.routes.js
β βββ services/
β βββ ai.service.js
β βββ auth.service.js
β βββ project.service.js
βββ Frontend/ # React + Vite application
β βββ package.json
β βββ vite.config.js
β βββ index.html
β βββ eslint.config.js
β βββ src/
β βββ App.jsx
β βββ main.jsx
β βββ index.css
β βββ api/
β β βββ config.jsx
β βββ components/
β β βββ layout/
β β β βββ Navigation.jsx
β β β βββ Layout.jsx
β β β βββ Sidebar.jsx
β βββ routes/
β β βββ Routes.jsx
| |ββ store/
β | βββ store.js # configureStore + middleware
β | βββ socketMiddleware.js # socket.io client + event handling
β | βββ slices/
β | βββ socketSlice.js # connection state (connected/error)
β | βββ projectSlice.js # project data + chat messages
β | βββ authSlice.js
β | βββ uiSlice.js
β βββ views/
β βββ NotFound.jsx
β βββ auth/
β β βββ Login.jsx
β β βββ Register.jsx
β βββ create-project/
β β βββ CreateProject.jsx
β |ββββ home/
| | βββ project/
| | βββ Project.jsx
| | βββ components/
| | βββ ChatSection.jsx # uses Redux (messages + socket actions)
| | βββ CodeEditor.jsx
| | βββ ReviewPanel.jsx
β βββ Dashboard.jsx
β βββ Landing.jsx
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- Socket.io - Real-time bidirectional communication
- MongoDB - NoSQL database with Mongoose ODM
- Google Gemini AI - AI-powered code review service
- CORS - Cross-origin resource sharing
- React 19 - Modern React with latest features
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Monaco Editor - Professional code editor (VS Code-like)
- Socket.io Client - Real-time communication
- React Router DOM - Client-side routing
User β Create Project β Backend API β MongoDB β Project Created
Developer A writes code β Socket.io β Developer B sees changes instantly
Developer B sends message β Socket.io β Developer A receives message
Developer requests review β AI Service β Gemini AI β Code analysis β Review displayed
- POST
/create- Create a new project - GET
/get-all- Retrieve all projects
chat-history- Get chat messages for a projectchat-message- Send/receive chat messagescode-change- Sync code changes across usersget-project-code- Retrieve project codeget-review- Request AI code review
/- Home page (project list)/create-project- Create new project form/project/:id- Individual project workspace/login- User login/register- User registration*- NotFound page
{
name: String (required),
code: String (default: ""),
review: String (default: ""),
timestamps: true
}{
project: ObjectId (reference to project),
text: String (message content),
timestamps: true
}- Node.js (v18 or higher)
- MongoDB database
- Google Gemini AI API key
cd Backend
npm install
# Create .env file with GOOGLE_API_KEY
npm startcd Frontend
npm install
npm run devCreate a .env file in the Backend directory:
GOOGLE_API_KEY=your_gemini_api_key_here
MONGODB_URI=your_mongodb_connection_string- Live Code Sync: Multiple developers can edit code simultaneously
- Instant Updates: Changes appear in real-time across all connected users
- Project Rooms: Each project has its own isolated collaboration space
- Intelligent Analysis: Google Gemini AI analyzes code quality
- Best Practices: Suggests improvements and best practices
- Code Optimization: Identifies potential issues and optimizations
- Monaco Editor: Industry-standard code editor (same as VS Code)
- Syntax Highlighting: Support for multiple programming languages
- Auto-completion: Intelligent code suggestions
- Live Chat: Real-time messaging within projects
- Message History: Persistent chat logs for each project
- User Presence: See who's currently working on the project
- User navigates to
/create-project - Enters project name
- Backend creates MongoDB document
- User is redirected to project workspace
- Multiple users join the same project
- Each user connects via Socket.io
- Code changes are broadcasted to all users
- Chat messages are synchronized in real-time
- Developer clicks "Get Review" button
- Current code is sent to Gemini AI service
- AI analyzes code and provides feedback
- Review is displayed in markdown format
- Microservices architecture with separate frontend/backend
- MongoDB for flexible data storage
- Socket.io for efficient real-time communication
- Modern React with latest features
- Hot reloading with Vite
- Professional code editor experience
- Real-time collaboration without page refreshes
- Google Gemini AI for intelligent code analysis
- Structured feedback with actionable improvements
- Professional-grade code review capabilities
- Instant code synchronization
- Live chat functionality
- Real-time user presence
- Efficient WebSocket communication
- Deploy to platforms like Render, Heroku, or AWS
- Set environment variables for production
- Ensure MongoDB connection is accessible
- Build with
npm run build - Deploy static files to Vercel, Netlify, or any static hosting
- Configure API endpoints for production backend
- CORS configuration for cross-origin requests
- Input validation on backend APIs
- Secure API key storage in environment variables
- MongoDB injection protection with Mongoose
- User authentication and authorization
- Project sharing and permissions
- Multiple programming language support
- Git integration for version control
- Advanced AI features (code generation, debugging)
- Team management and collaboration tools
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- B.Tech in Computer Science - RGPV, Bhopal (2022-2025) | CGPA: 7.3/10
- Polytechnic Diploma - Computer Science (2019-2022) | CGPA: 7.1/10
Frontend: React.js, Next.js, Redux, Tailwind CSS, Bootstrap, Framer Motion, Recharts
Backend: Node.js, Express.js, MongoDB, MySQL, JWT, Socket.io, Redis
DevOps: Docker, Git, Postman, Vercel, Render, Cloudinary
- MERN Full Stack Development
- Core Java
- Data Structures & Algorithms
- DBMS with SQL
Happy Coding with CodeX! ππ»