CodeGuard AI is a single-file web application that demonstrates an AST-based structural similarity detector with a separate AI-assisted scoring layer for detecting plagiarism in programming assignments. It is a final-year Computer Science research prototype built for an academic (University of Kigali / Rwanda) context.
# CodeGuard AI
**AI-Powered Code Plagiarism Detection Platform**
CodeGuard AI is a single-file web application that demonstrates an AST-based structural similarity detector with a separate AI-assisted scoring layer for detecting plagiarism in programming assignments. It is a final-year Computer Science research prototype built for an academic (University of Kigali / Rwanda) context.
> **Prototype notice.** This is a browser-only demonstration. All data, scores, and metrics are labelled *Demo / Illustrative* — no real research findings are fabricated. The AI layer is a *supporting* signal only: it never decides academic misconduct. A human lecturer always makes the final decision (human-in-the-loop).
---
## Features
- **Role-based access control** — three roles (System Administrator, Lecturer, Student) with enforced permissions
- **12-stage animated analysis pipeline** — Submission → Language ID → Preprocess → Normalize → AST Generation → AST Normalization → Feature Extraction → Structural Similarity → AI Scoring → Classification → Evidence → Human Review
- **AST-based structural analysis** kept architecturally separate from the AI-assisted score
- Interactive **SVG AST viewer** (zoom, collapse, compare-highlight)
- **Split-screen code comparison** with line-match highlighting
- Plagiarism **case management** and review workflow
- Printable / exportable **reports** (JSON + CSV)
- Admin tools: user management, roles & permissions, departments, courses, database + ERD, security center, audit logs, system monitoring
- Configurable scoring weights (AST 60% / Token 20% / AI 20%)
- Evaluation dashboard with a confusion matrix (labelled *Demo*)
- Global search (Ctrl+K), notifications, dark mode, native SVG charts
- Guided **presentation / demo mode**
---
## Running it
### Option A — Open directly
Download or clone the repo and open `index.html` in any modern browser (Chrome, Edge, or Firefox). No server, build step, or installation is required.
### Option B — Dep …