AI-powered code review with real-time collaboration and bug prediction π
git clone https://github.com/Umeshinduranga/revit.git
cd revit/frontend
npm install
npm startThen open http://localhost:3000 in your browser!
This is a web-based platform designed to revolutionize how developers collaborate on code reviews. It builds on traditional tools like GitHub Pull Requests by integrating machine learning for proactive bug detection, real-time editing, and privacy-focused federated learning. Whether you're a team debugging a complex merge or a solo developer simulating runtime errors, CodeForge saves time and reduces errors.
- Real-Time Collaborative Editing: Edit code simultaneously with teammates using Monaco Editor (the same as VS Code) and Socket.io for instant syncing.
- GitHub Integration: Log in with GitHub OAuth and push code directly to your repositories.
- Bug Prediction (Planned): AI models (using TensorFlow.js) simulate code execution to forecast issues like memory leaks or race conditions.
- Federated Learning: Anonymized review data improves AI suggestions without central storage, ensuring privacy.
- AR-Enhanced Diff Views (Future): Visualize code changes in 3D using WebAR for intuitive merges.
- Frontend: React.js with TypeScript, Monaco Editor, Socket.io-client, Axios, React Router.
- Backend: Node.js/Express with TypeScript, Passport.js for OAuth, Socket.io, Octokit for GitHub API.
- Database: MongoDB with Mongoose (configurable for PostgreSQL).
- Other: Docker for containerization, GitHub Actions for CI/CD.
- Node.js (v18+)
- Yarn (recommended for package management)
- GitHub account (for OAuth and testing pushes)
- MongoDB (local or Atlas for cloud)
β‘ NEW: Both frontend and backend now run from a single command!
-
Clone the Repository:
git clone https://github.com/Umeshinduranga/revit.git cd revit -
Navigate to Frontend Directory:
cd frontend -
Install All Dependencies (frontend + backend):
npm install
-
Start Both Servers:
npm start
This single command will start:
- Backend server on http://localhost:5000
- Frontend development server on http://localhost:3000
-
Open Your Browser:
- Visit http://localhost:3000 to use the application
- Backend API available at http://localhost:5000
The .env file is already configured in the frontend/ directory with:
REACT_APP_PORT=3000
SERVER_PORT=5000
MONGODB_URI=mongodb://localhost:27017/codeforge
SESSION_SECRET=mysecretkey123
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_CALLBACK_URL=http://localhost:5000/auth/github/callback
GITHUB_PERSONAL_ACCESS_TOKEN=your_pat_hereTo set up GitHub OAuth:
- Go to https://github.com/settings/applications > New OAuth App
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:5000/auth/github/callback - Copy Client ID and Secret to the
.envfile
From the frontend/ directory:
npm start- Runs both frontend and backend serversnpm run client- Runs only the React development servernpm run server- Runs only the backend servernpm run build- Builds the frontend for productionnpm run build-server- Builds the backend TypeScript files
- Database Setup (Optional for MVP):
- Install MongoDB locally or use MongoDB Atlas (free tier).
- Update
MONGODB_URIin.envif using Atlas.
- β Hot Reloading: Both frontend and backend restart automatically on file changes
- β Real-time Collaboration: Multiple users can edit simultaneously
- β GitHub Integration: Login with GitHub OAuth and push code directly
- β Socket.io: Instant synchronization between users
- Login: Visit http://localhost:3000 and click "Login with GitHub".
- Collaborate: Navigate to "Code Editor" to start editing. Open multiple tabs for real-time sync.
- Push to GitHub: Enter your repo (e.g.,
Umeshinduranga/codeforge-test), file path (e.g.,index.js), and click "Push to GitHub". - Analyze Code (Future Feature): Use the "Analyze Code" button for AI bug checks.
- Log in and open the editor.
- Type:
console.log('Hello World'); - In another tab, see the change instantly.
- Push to
Umeshinduranga/test-repoβcheck GitHub for the newindex.jsfile.
revit/
βββ backend/ # Legacy backend (deprecated)
βββ frontend/ # Main development directory
β βββ src/
β β βββ backend/ # Express server & API
β β β βββ index.ts # Main server with routes and Socket.io
β β β βββ models/ # User schemas (MongoDB)
β β βββ components/
β β β βββ EditorPage.tsx # Code editor with push and analyze
β β βββ App.tsx # Main app with routing
β β βββ index.tsx # React entry point
β βββ .env # Environment variables
β βββ package.json # Combined frontend + backend dependencies
β βββ tsconfig.json # Frontend TypeScript config
β βββ tsconfig.backend.json # Backend TypeScript config
βββ docs/ # Documentation
βββ README.md # This file
- Fork the repository.
- Create a branch (
git checkout -b feature/amazing-feature). - Commit changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Repository: https://github.com/Umeshinduranga/code-review
- Issues: Create a new issue
β Star this repo if it helps you! π