AI-Powered Code Analysis and Activity Tracking Platform
Syntax Sentry is an advanced Chrome extension and web platform designed to detect and analyze potential cheating behaviors in coding assessments, particularly on platforms like LeetCode. By tracking user activity, code modifications, and behavioral patterns, it ensures fair competition and maintains academic integrity.
- Real-time Activity Monitoring: Tracks user interactions including keystrokes, copy/paste events, tab switches, and code submissions
- AI-Powered Analysis: Advanced machine learning models detect suspicious patterns and AI-generated code
- Behavioral Pattern Detection: Analyzes typing patterns, timing intervals, and user behavior to identify potential cheating
- Multi-Platform Support: Currently optimized for LeetCode with extensible architecture for other coding platforms
- Activity Dashboard: Comprehensive view of all user activities with filtering and search capabilities
- Grouped View: Organize activities by username and problem for better analysis
- Real-time Updates: Live monitoring of user activities and AI analysis results
- Suspicion Scoring: AI-generated suspicion scores with detailed breakdowns
- Room Management: Create and manage activity monitoring rooms for group assessments
- Copy/Paste Detection: Identifies rapid copy-paste behaviors and analyzes copied content
- Keystroke Analysis: Detects unnatural typing patterns and timing anomalies
- Tab Activity Monitoring: Tracks focus changes and time spent away from coding environment
- Code Generation Detection: Identifies AI-generated code with confidence percentages
- Behavioral Scoring: Comprehensive scoring system based on multiple suspicious factors
- Framework: Next.js 14 with TypeScript
- UI Components: Custom components built with Radix UI and Tailwind CSS
- State Management: React hooks and context for state management
- Animations: Framer Motion for smooth user interactions
- Theme Support: Dark/light mode with system preference detection
- API Endpoints: RESTful API for activity logging and data retrieval
- Database Integration: MongoDB with Mongoose ODM
- Real-time Processing: Asynchronous AI analysis triggering
- CORS Support: Cross-origin resource sharing for Chrome extension integration
- Key Analysis (
keymain.py
): Analyzes keystroke patterns and timing - Copy Analysis (
copymain.py
): Detects and analyzes copy operations - Paste Analysis (
paste.py
): Evaluates pasted content for suspicious patterns - Tab Analysis (
tab.py
): Monitors tab switching and focus behavior
- Activities Collection: Stores user interaction events with detailed metadata
- AI Responses Collection: Stores AI analysis results and suspicion scores
- Rooms Collection: Manages group monitoring sessions
- Node.js 18+
- MongoDB Atlas account
- Python 3.8+ (for AI analysis scripts)
-
Clone the repository
git clone https://github.com/officialSyntaxSentry/extension-web.git cd extension-web
-
Install dependencies
npm install
-
Environment Configuration Create a
.env.local
file in the root directory:MONGODB_URI=your_mongodb_connection_string BASE_URL=http://localhost:3000 FASTAPI_URL=your_fastapi_endpoint_url
-
Database Setup
- Set up MongoDB Atlas cluster
- Create collections:
activities
,airesponses
,rooms
- Update connection string in environment variables
-
Run the development server
npm run dev
- Access the application Open http://localhost:3000 in your browser
The system uses configurable thresholds for detecting suspicious behavior:
# Key Analysis Thresholds
FAST_TYPING_THRESHOLD_MS = 50
LONG_GAP_THRESHOLD_MS = 15000
RAPID_PASTE_CTRL_V_THRESHOLD_MS = 300
# Copy Analysis Weights
WEIGHTS = {
'length_very_short': 0,
'length_medium': 5,
'length_long': 15,
'length_very_long': 25,
'code_keywords': 20,
'code_structure': 15,
'specific_solution_keywords': 35
}
The system tracks various event types:
key_press
: Individual keystroke eventscopy
: Content copy operationspaste
: Content paste operationssubmission
: Code submission eventswindow_blurred
/window_focused
: Window focus changestab_activated
/tab_deactivated
: Tab switching events
POST /api/activity
- Log new user activityGET /api/activity
- Retrieve activities with pagination and filtering
POST /api/airesponse
- Trigger AI analysis for specific activityPOST /api/airesponse/check
- Check AI analysis status for multiple activities
GET /api/users/[username]
- Get user-specific activity dataGET /api/users/search
- Search users by username
GET /api/room
- List and search roomsPOST /api/room
- Create new monitoring roomGET /api/room/[roomid]
- Get room detailsPOST /api/room/addUsers
- Add users to room
- Create Monitoring Room: Set up a room for specific coding assessments
- Add Participants: Invite students to join the monitoring room
- Monitor Activities: Use the dashboard to track real-time activities
- Review Analysis: Examine AI-generated suspicion scores and detailed reports
- Export Data: Download activity logs for further analysis
- Install Chrome Extension: Download and install the Syntax Sentry extension
- Join Room: Enter room code provided by instructor
- Normal Coding: Continue with regular coding practices
- View Results: Access personal activity reports (if enabled)
- Data Minimization: Only collects activity data relevant to cheating detection
- Secure Storage: All data encrypted and stored in secure MongoDB Atlas
- No Personal Information: System doesn't store sensitive personal data
- Transparent Analysis: AI analysis methods and scoring are documented
- User Control: Users can request data deletion and access reports
-
Build the application
npm run build
-
Deploy to Vercel/Netlify
- Connect your GitHub repository
- Set environment variables
- Deploy automatically on push
-
Configure MongoDB Atlas
- Set up production cluster
- Configure IP whitelist
- Update connection strings
The Chrome extension is available at: GitHub Repository
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add 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.
- Documentation: Visit our docs section
- Issues: Report bugs and request features on GitHub Issues
- Contact: Reach out via our contact page
- Support for additional coding platforms (HackerRank, CodeChef)
- Advanced machine learning models for better detection
- Real-time collaboration features
- Mobile app for monitoring
- Integration with learning management systems
- Advanced reporting and analytics dashboard
- Built with Next.js, React, and TypeScript
- UI components powered by Radix UI and Tailwind CSS
- Database powered by MongoDB Atlas
- AI analysis implemented in Python
- Icons by Lucide React
Syntax Sentry - Making coding assessments fair, transparent, and secure for everyone.
Currently in Alpha - Join our waitlist to be among the first to experience the platform!