Skip to content

vedants556/LogiCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LogiCode

License Node.js React MySQL

LogiCode is a comprehensive online coding platform designed to help students practice data structure and algorithm problems with real-time feedback, AI-powered assistance, and academic integrity monitoring. The platform provides a LeetCode-style coding environment with advanced proctoring features for educational institutions.

🌟 Highlights

  • Multi-Language Support: C, C++, Python, and Java
  • Real-Time Proctoring: Monitor student activity with comprehensive tracking
  • AI-Powered Hints: Get intelligent help without solution spoilers
  • Advanced Security: Multi-layer protection against spam and abuse
  • Performance Metrics: LeetCode-style execution statistics
  • Modern UI: Clean, responsive design with glassmorphism effects

Table of Contents

Features

πŸš€ Core Features

  • Multi-Language Code Editor: Support for C, C++, Python, and Java with Monaco Editor integration

    • Professional VS Code-style editor with syntax highlighting
    • IntelliSense and auto-completion for all languages
    • Customizable themes and settings
  • LeetCode-Style Testing: Run and test code with multiple test cases before submission

    • Run button: Test against all test cases with detailed feedback
    • Submit button: Validate solution and mark as solved
    • Real-time performance metrics (CPU time, memory usage)
  • Real-Time Code Execution: Powered by Piston API for secure code execution

    • Sandboxed execution environment
    • Support for stdin/stdout
    • Detailed error messages (compilation vs runtime)
  • AI Assistance: Google Gemini integration for intelligent hints without revealing solutions

    • Context-aware hints based on problem description
    • Progressive hint system
    • Never reveals complete solutions
  • Timer-Based Challenges: Auto-submit functionality when time expires

    • Configurable time limits per problem
    • Visual countdown with warnings
    • Automatic submission when time runs out
  • Progress Tracking: Monitor problem-solving statistics and performance metrics

    • Solved problems count
    • Success rate tracking
    • Historical performance data
  • Modern Leaderboard: Competitive rankings with podium display for top performers

    • Glassmorphism design
    • Real-time ranking updates
    • Highlight your current position

πŸ‘¨β€πŸ’Ό Admin Features

  • Question Management: Add and manage coding problems with multi-language support

    • Rich text editor for problem descriptions
    • Support for images and formatted text
    • Difficulty levels and categorization
  • Test Case Validation: Validate test cases before saving to ensure correctness

    • Live test case validation
    • Separate solution and driver code
    • Expected vs actual output comparison
  • Dynamic Language Support: Configure problems for specific programming languages

    • Enable/disable languages per problem
    • Language-specific default code
    • Custom test cases per language
  • User Management: View and manage user accounts

    • Promote users to admin/teacher roles
    • View user statistics and progress
    • Manage permissions

πŸŽ“ Proctoring System (Teacher Role)

  • Real-Time Monitoring: Live dashboard showing active coding sessions

    • See who's coding right now
    • Current problem being solved
    • Session duration and activity
    • Real-time event stream
  • Code Plagiarism Detection: Automatic similarity checking using Levenshtein distance algorithm

    • Configurable similarity threshold (default: 85%)
    • Code normalization (removes whitespace, comments)
    • Side-by-side code comparison
    • Batch checking for all submissions
  • Activity Tracking: Comprehensive monitoring of student behavior

    • Tab switching detection (Medium severity)
    • Copy/paste monitoring (High severity for large pastes >100 chars)
    • DevTools access prevention (High severity)
    • Session duration tracking
    • Right-click attempt logging (Low severity)
  • Event Logging: Comprehensive logs with severity levels

    • 🟒 Low: Window blur, small copy operations, right-click attempts
    • 🟠 Medium: Tab switches, medium paste operations
    • πŸ”΄ High: DevTools access, large pastes, repeated violations
  • Student Analytics: Detailed profiles with activity metrics

    • Individual student profiles
    • Problems solved count
    • Total violations by severity
    • Session history with timestamps
    • Violation trends and patterns
  • Configurable Settings: Customizable thresholds and rules

    • Max tab switches allowed
    • Max copy/paste operations
    • Similarity detection threshold
    • Enable/disable proctoring per problem
    • Global and per-problem settings

Security Features

  • Role-Based Access Control: User, Admin, and Teacher roles
  • JWT Authentication: Secure API endpoints
  • Proctoring Enforcement:
    • Right-click prevention
    • DevTools blocking (F12, Ctrl+Shift+I, Ctrl+Shift+J, Ctrl+U)
    • Tab switching detection
    • Copy/paste tracking
  • Advanced Security Measures:
    • Multi-layer rate limiting (strict, standard, and progressive)
    • Event batching to prevent database spam
    • Automatic suspicious activity detection and blocking
    • Request validation and payload size limits
    • Frontend throttling and deduplication
    • Automated database cleanup jobs

Technologies Used

Frontend

  • React.js - Interactive user interfaces
  • Monaco Editor - Professional code editor (VS Code's editor)
  • React Router - Client-side routing
  • Socket.IO Client - Real-time communication
  • React Icons - UI icons
  • Lucide React - Additional icon set
  • Vite - Fast build tool and development server

Backend

  • Node.js - Server-side runtime
  • Express.js - Web application framework
  • MySQL2 - Database driver
  • Socket.IO - WebSocket server
  • JWT - JSON Web Tokens for authentication
  • Google Generative AI - AI-powered hints via Gemini API
  • Piston API - Secure code execution engine

Development Tools

  • Nodemon - Auto-reload during development
  • ESLint - Code linting
  • dotenv - Environment variable management

Architecture

The system follows a client-server architecture with real-time capabilities:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Client (React)                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Monaco     β”‚   Socket.IO  β”‚   React Router         β”‚   β”‚
β”‚  β”‚   Editor     β”‚   Client     β”‚   Components           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ HTTPS/WSS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Server (Node.js + Express)                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   REST API   β”‚   Socket.IO  β”‚   JWT Auth             β”‚   β”‚
β”‚  β”‚   Endpoints  β”‚   Server     β”‚   Middleware           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚                      β”‚                     β”‚
      β–Ό                      β–Ό                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MySQL   β”‚        β”‚  Piston API  β”‚      β”‚  Gemini AI   β”‚
β”‚ Database β”‚        β”‚ (Code Exec)  β”‚      β”‚  (Hints)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components:

  • Frontend: React SPA with Monaco editor for code editing
  • Backend: Express server handling API requests and WebSocket connections
  • Database: MySQL for persistent storage of users, problems, test cases, and proctoring data
  • Code Execution: Piston API for secure, sandboxed code execution
  • AI Component: Google Gemini for intelligent hint generation

System Requirements

Minimum Requirements

  • Node.js: v14.0.0 or higher
  • MySQL: v8.0 or higher
  • RAM: 4GB minimum (8GB recommended)
  • Storage: 500MB free space
  • Browser: Chrome, Firefox, Safari, or Edge (latest versions)

Required API Keys

  • Gemini API Key: Free from Google AI Studio
  • No other paid services required for basic functionality

Supported Platforms

  • Operating Systems: Windows, macOS, Linux
  • Cloud Platforms: Railway, Render, Vercel, DigitalOcean, AWS, Azure
  • Databases: MySQL 8.0+ (PostgreSQL support with modifications)

Installation

Prerequisites

  • Node.js (v14 or above)
  • MySQL (v8.0 or above)
  • Gemini API Key (free from Google AI Studio)
  • Git (for cloning the repository)

Steps

1. Clone the Repository

git clone https://github.com/vedants556/logicode.git
cd logicode

2. Backend Setup

Navigate to the backend directory:

cd backend

Install dependencies:

npm install

Create a .env file in the backend directory with the following content:

GEMINI_API_KEY='your-gemini-api-key-here'
SQL_PASSWORD='your-mysql-password-here'
PORT=5000

Note: Replace your-gemini-api-key-here with your actual Gemini API key and your-mysql-password-here with your MySQL root password.

3. Database Setup

See the Database Setup section below for detailed instructions.

4. Run Database Migrations

Execute the migration script to set up the proctoring system:

node run_migration.js

This will create the following tables:

  • proctoring_events - Stores suspicious activities
  • active_sessions - Tracks live coding sessions
  • code_submissions - Stores code for plagiarism detection
  • proctoring_settings - Configurable proctoring rules

5. Start the Backend Server

npm run dev

The backend server will start on http://localhost:5000

6. Frontend Setup

Open a new terminal and navigate to the frontend directory:

cd frontend

Install dependencies:

npm install

Start the development server:

npm run dev

The frontend will start on http://localhost:5173 (or another port if 5173 is busy)

7. Access the Application

Open your browser and navigate to:

http://localhost:5173

Database Setup

1. Create Database and Tables

Execute the following SQL commands in MySQL:

-- Create database
CREATE DATABASE logicode;
USE logicode;

-- Users table
CREATE TABLE users (
    userid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(100) DEFAULT NULL,
    email VARCHAR(200) DEFAULT NULL UNIQUE,
    password VARCHAR(1000) DEFAULT NULL,
    role VARCHAR(100) DEFAULT 'user'
);

-- Questions table
CREATE TABLE questions (
    q_id INT PRIMARY KEY AUTO_INCREMENT,
    qname VARCHAR(500),
    description TEXT,
    defcode TEXT,
    checkBy VARCHAR(100),
    funcname VARCHAR(100),
    solution TEXT,
    qtype VARCHAR(200),
    timer INT DEFAULT 0,
    FULLTEXT(qname, description)
);

-- Test cases table
CREATE TABLE testcases (
    t_id INT PRIMARY KEY AUTO_INCREMENT,
    tno INT,
    q_id INT,
    runnercode TEXT,
    ip VARCHAR(100),
    iptype VARCHAR(100),
    op VARCHAR(100),
    optype VARCHAR(100),
    language VARCHAR(50) DEFAULT 'c',
    FOREIGN KEY (q_id) REFERENCES questions(q_id) ON DELETE CASCADE,
    INDEX idx_qid_lang (q_id, language)
);

-- Solved problems table
CREATE TABLE solved (
    sol_id INT PRIMARY KEY AUTO_INCREMENT,
    q_id INT,
    user_id INT,
    solved_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (q_id) REFERENCES questions(q_id) ON DELETE CASCADE,
    FOREIGN KEY (user_id) REFERENCES users(userid) ON DELETE CASCADE,
    UNIQUE KEY unique_solve (q_id, user_id)
);

2. Run Proctoring System Migration

The proctoring system tables are created automatically when you run:

cd backend
node run_migration.js

This creates:

  • proctoring_events
  • active_sessions
  • code_submissions
  • proctoring_settings

3. Create Admin/Teacher Accounts

-- Create admin account
INSERT INTO users (username, email, password, role)
VALUES ('admin', 'admin@logicode.com', 'admin123', 'admin');

-- Create teacher account
INSERT INTO users (username, email, password, role)
VALUES ('teacher', 'teacher@logicode.com', 'teacher123', 'teacher');

-- Promote existing user to teacher
UPDATE users SET role = 'teacher' WHERE email = 'user@example.com';

⚠️ Important: In production, use properly hashed passwords. The above examples are for development only.

Usage

For Students

  1. Sign Up/Login: Create an account or login with existing credentials
  2. Browse Problems: Navigate to the problem list and select a challenge
  3. Select Language: Choose from C, C++, Python, or Java
  4. Write Code: Use the Monaco editor to write your solution
  5. Run Tests: Click "Run" to test against all test cases (shows all results)
  6. Submit Solution: Click "Submit" when ready (marks problem as solved)
  7. Get AI Help: Use "Ask AI" button for hints when stuck
  8. Check Leaderboard: View rankings and compete with others
  9. Track Progress: Monitor your solved problems and statistics

For Admins

  1. Login: Access admin panel with admin credentials
  2. Add Problems: Create new coding challenges
  3. Configure Languages: Select supported languages for each problem
  4. Add Test Cases: Define test cases with validation
  5. Set Timers: Configure time limits for problems (optional)
  6. Manage Users: View and manage user accounts

For Teachers

  1. Login: Access teacher dashboard with teacher credentials
  2. Monitor Students: View real-time active coding sessions
  3. Check Events: Review proctoring events and violations
  4. Detect Plagiarism: Run similarity checks on code submissions
  5. View Analytics: Access detailed student profiles and statistics
  6. Configure Settings: Adjust proctoring thresholds and rules

Access the Teacher Dashboard at: /teacher-dashboard

Multi-Language Support

LogiCode supports four programming languages with language-specific handling:

Supported Languages

Language Version Piston Runtime File Extension
C 10.2.0 gcc .c
C++ 10.2.0 g++ .cpp
Python 3.10.0 python3 .py
Java 15.0.2 java .java

Features

  • Language-Specific Test Cases: Test cases are filtered by language
  • Separate Solution Code: Each language has its own solution template
  • Default Templates: Pre-configured starter code for each language
  • Syntax Highlighting: Monaco editor provides language-specific highlighting
  • Auto-completion: IntelliSense support for all languages

Code Execution Flow

  1. User selects language from dropdown
  2. Writes solution in Monaco editor
  3. Code is sent to backend with language identifier
  4. Backend combines solution with test runner code
  5. Piston API executes code in sandboxed environment
  6. Results are returned with performance metrics

Proctoring System

Overview

The proctoring system provides comprehensive monitoring for academic integrity:

Features

1. Tab Switching Detection

  • Monitors when students leave the problem page
  • Logs visibility changes with timestamps
  • Severity: Medium

2. Copy/Paste Tracking

  • Detects paste operations in the code editor
  • Tracks paste size and content length
  • High severity for large pastes (>100 characters)

3. DevTools Prevention

  • Blocks right-click context menu
  • Prevents F12, Ctrl+Shift+I, Ctrl+Shift+J, Ctrl+U
  • Logs all access attempts
  • Severity: High

4. Code Plagiarism Detection

  • Stores all code submissions with timestamps
  • Uses Levenshtein distance algorithm for similarity
  • Normalizes code (removes whitespace, comments)
  • Configurable threshold (default: 85%)
  • Flags suspicious pairs automatically

5. Real-Time Session Tracking

  • Tracks active problem-solving sessions
  • Records start/end times
  • Counts violations per session
  • Shows live activity status

Teacher Dashboard

Teachers have access to a comprehensive dashboard with four tabs:

πŸ“Š Overview Tab

  • Total student count
  • Currently active users
  • High severity event count
  • Live session feed with details

πŸ‘₯ Students Tab

  • Complete student list with metrics
  • Problems solved count
  • Total violations
  • Individual student profiles
  • Session history

πŸ“‹ Events Tab

  • All proctoring events log
  • Filterable by severity, user, problem
  • Color-coded by severity (🟒 Low, 🟠 Medium, πŸ”΄ High)
  • Timestamped entries

πŸ” Plagiarism Tab

  • Enter problem ID to check similarity
  • See all suspicious pairs
  • Similarity percentage displayed
  • Side-by-side code comparison

Proctoring Settings

Default configuration (can be customized):

-- View current settings
SELECT * FROM proctoring_settings WHERE q_id IS NULL;

-- Update global settings
UPDATE proctoring_settings
SET max_tab_switches = 10,
    max_copy_paste = 5,
    similarity_threshold = 0.90,
    enable_proctoring = TRUE
WHERE q_id IS NULL;

-- Set per-problem settings
INSERT INTO proctoring_settings (q_id, max_tab_switches, similarity_threshold)
VALUES (1, 3, 0.95);

Event Severity Levels

  • Low (🟒): Window blur, small copy operations, right-click attempts
  • Medium (🟠): Tab switches, medium paste operations, focus changes
  • High (πŸ”΄): DevTools access, large pastes (>100 chars), repeated violations

πŸ“š For more details, see Proctoring System Documentation

Security Features

Overview

LogiCode implements comprehensive security measures to protect against spam, abuse, and system attacks. The security system uses a multi-layer approach with frontend and backend protection.

Key Security Components

1. Rate Limiting

  • Strict Rate Limiter (10 requests/min): Code execution endpoints to prevent API abuse
  • Proctoring Rate Limiter (30 requests/min): Proctoring event logging
  • Standard Rate Limiter (100 requests/min): General API operations
  • Speed Limiter: Progressive delay after 5 requests to discourage spam

2. Frontend Throttling

  • Event-specific rate limits (e.g., 10 right-clicks/min, 15 tab switches/min)
  • Event deduplication within 1-second windows
  • Prevents spam at the source before hitting the backend

3. Event Batching

  • Batches proctoring events every 5 seconds
  • Reduces database writes by 90-95%
  • Bulk inserts instead of individual queries

4. Request Validation

  • Maximum payload size: 1MB
  • Maximum code size: 100KB
  • Suspicious pattern detection (infinite loops, OS commands)
  • Early rejection of malicious requests

5. Suspicious Activity Detection

  • Tracks violations per user in 5-minute windows
  • Auto-blocks users after 20 violations
  • Real-time monitoring and alerts for teachers

6. Database Cleanup

  • Automated cleanup scripts for old events
  • Retention policies: 7 days (low severity), 30 days (all events), 90 days (code submissions)
  • Table optimization to prevent bloat

Performance Impact

Security measures reduce:

  • API calls by 90-95%
  • Database writes by 95%
  • WebSocket traffic by 70%+

Without affecting legitimate users:

  • Progressive rate limiting maintains user experience
  • Automatic retry logic for transient failures
  • User-friendly error messages with clear actions

πŸ“š For complete security documentation, see Security Measures

API Documentation

Authentication Endpoints

Method Endpoint Description
POST /api/signup Register new user
POST /api/login User authentication
GET /api/verify Verify JWT token

Question Endpoints

Method Endpoint Description
POST /api/addquestion Add new problem (Admin)
GET /api/getquestions Get all problems
GET /api/getquestion/:qid Get specific problem
GET /api/solved/:userid Get solved problems

Code Execution Endpoints

Method Endpoint Description
POST /api/runtestcases Run code with all test cases
POST /api/checktc Submit and validate solution
POST /api/checkbyai AI-based validation
POST /api/tcvalid Validate test case

Proctoring Endpoints (Student)

Method Endpoint Description
POST /api/proctoring/log-event Log proctoring event
POST /api/proctoring/session Start/update session
POST /api/proctoring/end-session End active session
POST /api/proctoring/submit-code Submit code for tracking

Teacher Endpoints (Teacher/Admin Only)

Method Endpoint Description
GET /api/teacher/active-sessions Get all active sessions
GET /api/teacher/proctoring-events Get all events (filterable)
GET /api/teacher/users-overview Get all students with stats
GET /api/teacher/user/:userid Get detailed user info
POST /api/teacher/check-similarity Check code similarity

Leaderboard Endpoint

Method Endpoint Description
GET /api/leaderboard Get user rankings

Documentation

LogiCode includes comprehensive documentation covering all aspects of the platform. Below are all available guides organized by category:

πŸš€ Getting Started

πŸŽ“ Proctoring Documentation

πŸ”’ Security Documentation

πŸ› Error Handling & Troubleshooting

⚑ Performance & Code Execution

✨ Feature Updates

πŸš€ Deployment

  • Deployment Guide - Complete deployment guide for Railway, Render, Vercel, and DigitalOcean

πŸ“Š Quick Navigation by Task

Setting up the platform:

  1. Follow Installation section above
  2. Set up database using Database Setup
  3. Run proctoring migration: Proctoring Quick Start

Deploying to production:

  1. Read Deployment Guide
  2. Review Security Measures
  3. Set up cleanup jobs from Security Measures

Adding new problems:

  1. Use admin panel
  2. Follow Test Examples Corrected
  3. Reference Quick Reference Guide

Monitoring students:

  1. Create teacher account
  2. Access teacher dashboard
  3. Read Proctoring Summary

Troubleshooting issues:

  1. Check Error Handling
  2. Review Fixes Summary
  3. Consult Critical Fixes

Understanding security:

  1. Read Security Measures
  2. Quick reference: Security Quick Reference
  3. Visual guide: Security Visual Summary

Screenshots

Landing Page

Landing Page Landing Page Landing Page Landing Page Landing Page Landing Page

Dashboard

Dashboard Dashboard Dashboard

Problem Selection

Select Problem

Code Editor

Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem Solve Problem

Test Results

Wrong Code Submitted

AI Assistant

Ask AI for Help

Admin Panel

Admin Panel

Leaderboard

Leaderboard

Login/Signup

Login/Signup

Recent Updates

Version 2.5 - Security & Performance Update

πŸ”’ Advanced Security System

  • Multi-Layer Rate Limiting: Strict (10/min), standard (100/min), and progressive rate limiters
  • Frontend Throttling: Event-specific limits with deduplication
  • Event Batching: 90-95% reduction in database writes
  • Auto-Blocking: Automatic detection and blocking of malicious users
  • Request Validation: Payload size limits and suspicious pattern detection
  • Database Cleanup: Automated retention policies and table optimization

🚨 Error Handling & Resilience

  • Comprehensive Error Handling: User-friendly messages across all scenarios
  • Automatic Retry Logic: Exponential backoff for transient failures
  • Graceful Degradation: System continues working during partial failures
  • Network Error Queue: Failed requests queued and retried when connection restored
  • Detailed Error Logging: Complete error tracking for debugging

πŸ“Š Performance Metrics

  • LeetCode-Style Metrics: CPU time, memory usage, and execution time
  • Performance Comparison: Compare your solution with others
  • Real-Time Statistics: Live performance data during code execution
  • Historical Tracking: Track performance improvements over time

Version 2.0 - Major Feature Release

πŸŽ“ Proctoring System

  • Complete teacher dashboard with real-time monitoring
  • Code plagiarism detection using Levenshtein algorithm
  • Activity tracking (tab switches, copy/paste, DevTools)
  • Event logging with severity levels
  • Configurable settings and thresholds

🌐 Multi-Language Support

  • Added C++, Python, and Java support
  • Language-specific test case filtering
  • Separate solution templates per language
  • Dynamic language configuration

⚑ Enhanced Code Execution

  • LeetCode-style Run button (shows all test results)
  • Improved Submit button (validates and marks as solved)
  • Better error messages (compilation vs runtime errors)
  • Language-specific code combination logic

⏱️ Timer System

  • Auto-submit functionality when time expires
  • Visual warnings at 1-minute mark
  • Configurable time limits per problem
  • Prevents working beyond allocated time

πŸ† Modern Leaderboard

  • Redesigned with glassmorphism effects
  • Podium display for top 3 performers
  • "Your Current Rank" highlight
  • Responsive design for all devices

πŸ”§ Bug Fixes

  • Fixed test case validation issues
  • Resolved Python indentation errors
  • Fixed language filtering for test cases
  • Fixed duplicate solved problem records
  • Improved session management

Performance Improvements

Security Optimizations:

  • 95% reduction in API calls (frontend throttling)
  • 95% reduction in database writes (event batching)
  • 70%+ reduction in WebSocket traffic
  • 96% reduction in database write time

System Reliability:

  • Automatic retry for failed requests
  • Progressive rate limiting (no hard blocks)
  • Graceful degradation during high load
  • Zero impact on legitimate users

All Documentation

See the Documentation section for links to all guides including:

  • Security measures and best practices
  • Proctoring system setup and usage
  • Error handling strategies
  • Performance optimization guides
  • Deployment instructions
  • Troubleshooting and fixes

Deployment

LogiCode can be deployed to various hosting platforms. For detailed deployment instructions, see the Deployment Guide.

Quick Deployment Options

Railway (Recommended - Easiest)

  1. Sign up at Railway.app
  2. Connect your GitHub repository
  3. Add MySQL database
  4. Set environment variables
  5. Deploy automatically

Render

  1. Sign up at Render.com
  2. Create new Web Service
  3. Configure build settings
  4. Add MySQL database
  5. Deploy

Vercel + PlanetScale

  • Frontend on Vercel
  • Backend on Railway/Render
  • Database on PlanetScale

DigitalOcean App Platform

  • Full-stack deployment
  • Managed MySQL database
  • Custom domain support

Required Environment Variables

GEMINI_API_KEY=your-gemini-api-key
SQL_PASSWORD=your-mysql-password
JWT_SECRET=your-jwt-secret
DB_HOST=your-database-host
DB_USER=your-database-user
DB_NAME=your-database-name
DB_PORT=3306
NODE_ENV=production

Post-Deployment Checklist

  • Test all features (login, code execution, proctoring)
  • Set up custom domain (optional)
  • Configure monitoring and logging
  • Set up automated database cleanup (cron job)
  • Enable HTTPS
  • Configure CORS settings
  • Test proctoring system
  • Create admin and teacher accounts

πŸ“š For complete deployment instructions, see Deployment Guide

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Add comments for complex logic
  • Update documentation for new features
  • Test thoroughly before submitting PR
  • Keep commits atomic and well-described

License

This project is licensed under the ISC License.

Authors

  • Vedant Shelar - Backend Development
  • Rahul Shelke - Frontend Development
  • Ayush Devre - Database Design
  • Anuj Koli - Integration & Testing

Acknowledgments

  • Piston API - For secure code execution
  • Google Gemini - For AI-powered hints
  • Monaco Editor - For the professional code editor
  • React Community - For excellent documentation and tools

Support

Getting Help

For issues, questions, or suggestions:

  1. Documentation: Check the Documentation section for comprehensive guides
  2. GitHub Issues: Open an issue for bugs or feature requests
  3. Email: Contact the development team
  4. Quick References:

Common Issues

Issue Solution Documentation
Installation problems Check Installation section README.md
Database setup issues Follow Database Setup README.md
Proctoring not working Run migration script Proctoring Quick Start
Rate limit errors Check Security Measures Security docs
Deployment issues Follow platform-specific guide Deployment Guide
Test case validation failing Check examples Test Examples

Contributing

We welcome contributions! See the Contributing section above for guidelines.

Stay Updated

  • ⭐ Star the repository to show your support
  • πŸ‘€ Watch the repository for updates
  • πŸ”” Subscribe to releases for new features

Project Statistics

  • Languages: 4 supported (C, C++, Python, Java)
  • Security Layers: 6 (Rate limiting, throttling, batching, validation, detection, cleanup)
  • Database Tables: 9 (Users, questions, test cases, solved, proctoring tables)
  • API Endpoints: 20+ (Authentication, questions, code execution, proctoring, teacher)
  • Documentation Files: 28 comprehensive guides
  • Performance Improvement: 90-95% reduction in database load
  • Active Development: Regular updates and improvements

Keywords

Online Coding Platform, LeetCode Clone, Coding Practice, Data Structures and Algorithms, Code Execution Platform, Academic Integrity, Proctoring System, Plagiarism Detection, Multi-Language Support, Educational Technology, Computer Science Education, Programming Practice, Code Editor, Real-Time Monitoring, Student Assessment, Competitive Programming, Learn to Code


Built with ❀️ for students learning data structures and algorithms

Repository: github.com/vedants556/logicode

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages