ReviewGuard is a production-grade AI-powered moderation platform engineered to simulate how modern digital ecosystems protect communities from:
- Toxicity
- Spam
- Duplicate reviews
- Coordinated abuse
- Manipulative content
- Repeat offenders
The system combines:
- π§ Large Language Models (LLMs)
- π Semantic similarity embeddings
- β‘ Real-time WebSocket synchronization
- π‘οΈ Deterministic fallback moderation
- π‘ Live telemetry architecture
- π Enterprise-grade security systems
Unlike traditional moderation dashboards, ReviewGuard operates as a complete Trust Infrastructure System with role-isolated operational layers for:
- Users
- Moderators
- Administrators
- LLM-based contextual toxicity auditing
- Semantic duplicate detection
- Explainable AI reasoning
- Multi-layer moderation defense
- Fail-soft moderation fallback
- Instant moderation updates
- Live dashboard synchronization
- WebSocket-driven status propagation
- Real-time threat feeds
- Moderator queue streaming
- JWT Authentication
- Role-Based Access Control (RBAC)
- Tiered Rate Limiting
- bcrypt password hashing
- Audit logging system
- Protected route middleware
- Moderator analytics dashboards
- Threat distribution insights
- Audit trail system
- Staff governance controls
- Performance leaderboards
flowchart TD
A[Landing Page]
A --> B[JWT Authentication Gate]
B -->|No Token| C[Login]
B -->|No Token| D[Sign Up]
C --> E[JWT Issued]
D --> E
B -->|Valid Token| F[Role Router]
E --> F
F --> G[User Dashboard]
F --> H[Moderator Dashboard]
F --> I[Admin Dashboard]
%% User Features
G --> G1[Submit Review]
G1 --> G2[Trust Meter]
G2 --> G3[Reputation Ladder]
G3 --> G4[Review History]
G4 --> G5[Soft Delete]
%% Moderator Features
H --> H1[Command Queue]
H1 --> H2[Evaluation Studio]
H2 --> H3[Evasion Detection]
H3 --> H4[Audit Timeline]
H4 --> H5[Approve Reject]
%% Admin Features
I --> I1[Live Threat Feed]
I1 --> I2[Staff Governance]
I2 --> I3[Cascading Delete]
I3 --> I4[Global Audit Logs]
I4 --> I5[Leaderboard]
%% API Layer
G5 --> J[API Gateway]
H5 --> J
I5 --> J
J --> J1[JWT Verify]
J --> J2[Rate Limiter]
J --> J3[Socket.IO]
J --> J4[Express.js]
%% Core Services
J --> K1[Review Service]
J --> K2[Moderation Service]
J --> K3[User Service]
J --> K4[Admin Service]
%% Queue
K1 --> L[BullMQ + Redis Queue]
K2 --> L
%% AI Pipeline
L --> M1[Layer 1 - Hugging Face Embeddings]
L --> M2[Layer 2 - Groq LLM]
L --> M3[Layer 3 - Rule Based Fallback]
%% Storage
M1 --> N1[MongoDB Atlas]
M2 --> N2[Redis]
M3 --> N3[Vector Store]
%% Audit Flow
K2 -. Audit Logs .-> N1
K4 -. Decisions .-> N1
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS |
| Backend | Node.js, Express.js |
| Database | MongoDB Atlas + Mongoose |
| Authentication | JWT + bcrypt |
| Real-Time | Socket.io |
| AI Infrastructure | Groq (Llama-3), HuggingFace |
| Embeddings | BGE-Small-En |
| Queue System | BullMQ |
| Broker | Redis |
| Charts | Recharts |
| Validation | express-validator |
| Security | express-rate-limit |
| Deployment | Render |
Detect semantically similar reviews even when wording changes.
- TF-IDF Vectorization
- Semantic Embeddings
- Cosine Similarity
β
Duplicate review detection
β
Semantic spam analysis
β
Coordinated review manipulation detection
β
Paraphrased duplicate identification
Similarity β₯ 0.85 β Duplicate Review- Groq API
- Llama-3-8B
| Category | Severity |
|---|---|
| Profanity | 0.35 |
| Hate Speech | 0.65 |
| Threats | 0.90 |
| Spam | 0.45 |
| Personal Attacks | 0.55 |
- Excessive CAPS
- Aggressive punctuation
- Contextual hostility
- Threat probability scoring
- Manipulative language patterns
Each moderation decision includes:
- AI-generated reasoning
- Confidence scoring
- Toxicity evidence
- Duplicate evidence
Fallback moderation during:
- AI outages
- API failures
- Network instability
- Queue congestion
- Regex heuristics
- TF-IDF similarity
- Rule-based scoring
β
Zero external dependency
β
Ultra-fast execution
β
Fail-soft protection
β
Guaranteed moderation continuity
User Submits Review
β
Parallel AI Analysis
β
Duplicate Detection
β
LLM Toxicity Audit
β
Fallback Shield Validation
β
Threat Classification
β
Moderator Queue
β
Socket.io Event Emission
β
Instant Dashboard UpdateUsers receive:
- Toxicity alerts
- Duplicate warnings
- Submission recommendations
- AI-generated moderation hints
- Probationary
- Trusted Reviewer
- Verified Contributor
- Elite Guardian
(Approved Reviews / Total Reviews) Γ 100- Animated SVG circular progress bars
- Dynamic stroke animations
- Live trust recalculations
- Vertically locked lifecycle feed
- Real-time review state updates
- Status accent visualization
- Responsive mirrored layout system
Users may remove reviews publicly.
However:
- Reviews remain internally archived
- Moderators can detect evasion attempts
- Prevents delete-and-retry abuse
- Prioritized flagged review stream
- AI severity indicators
- Duplicate confidence metrics
- Real-time synchronization
- Side-by-side duplicate comparison
- AI-generated reasoning panels
- Semantic similarity analysis
- Moderation evidence visualization
Moderators can inspect:
- Deleted reviews
- Repeat abuse patterns
- Bot-like review behavior
- Coordinated spam clusters
Every review includes:
- Submission timestamps
- AI scan completion time
- Moderator action logs
- Status transitions
Terminal-style telemetry stream displaying:
- Incoming reviews
- Threat classifications
- Moderator actions
- Queue activity
- System alerts
β
Promote/Demote users
β
Toggle account access
β
Deactivate moderators
β
Cascading account deletion
β
Governance-level control
Complete moderation traceability including:
- Approval/Rejection logs
- Moderator identity
- Precision timestamps
- Accountability tracking
Tracks:
- Review throughput
- Moderation efficiency
- Approval accuracy
- Response latency
Producer (Submission)
β
Redis Queue
β
BullMQ Worker
β
AI Processing
β
Database Persistence
β
Socket.io Pushβ
Non-blocking APIs
β
Horizontal scalability
β
Retry resilience
β
Queue persistence
β
Low-latency user experience
| Security Layer | Implementation |
|---|---|
| JWT Authentication | 7-Day Expiry |
| Password Hashing | bcrypt |
| RBAC | Route-level middleware |
| Validation | express-validator |
| Rate Limiting | Multi-tier protection |
| CORS Protection | Restricted origins |
| Audit Logging | Immutable tracking |
| Endpoint | Limit |
|---|---|
| General API | 10k / 15m |
| Review Submission | 1k / hour |
| Authentication | 500 / 15m |
Review Guard/
βββ backend/
β βββ config/
β β βββ db.js # MongoDB Atlas connection
β β
β βββ controllers/ # Business logic
β β βββ authController.js
β β βββ reviewController.js
β β βββ moderationController.js
β β βββ adminController.js
β β
β βββ middleware/
β β βββ auth.js # JWT verification
β β βββ roleCheck.js # Role-based access
β β βββ rateLimiter.js # Rate limiting
β β
β βββ models/
β β βββ User.js
β β βββ Review.js
β β βββ AuditLog.js
β β
β βββ routes/
β β βββ auth.js
β β βββ reviews.js
β β βββ moderation.js
β β βββ admin.js
β β
β βββ scripts/
β β βββ seed.js # Database seeder
β β
β βββ utils/
β β βββ toxicity.js # Mock AI toxicity detector
β β βββ tfidf.js # TF-IDF duplicate detection
β β
β βββ .env # Environment variables
β βββ server.js
β
βββ frontend/
βββ src/
βββ api/
β βββ axios.js
β
βββ components/
β βββ Navbar.jsx
β βββ StatusBadge.jsx
β βββ ProtectedRoute.jsx
β βββ LoadingSpinner.jsx
β
βββ context/
β βββ AuthContext.jsx
β
βββ pages/
βββ Login.jsx
βββ Register.jsx
βββ UserDashboard.jsx
βββ ModeratorPanel.jsx
βββ Analytics.jsx
βββ AdminPanel.jsx
POST /api/auth/register
POST /api/auth/login
GET /api/auth/mePOST /api/reviews
GET /api/reviews/my
DELETE /api/reviews/:idGET /api/moderation/reviews
PUT /api/moderation/reviews/:id/approve
PUT /api/moderation/reviews/:id/reject
GET /api/moderation/analytics
GET /api/moderation/audit-logsGET /api/admin/users
PUT /api/admin/users/:id/role
PUT /api/admin/users/:id/toggle-status
DELETE /api/admin/users/:id| Role | Password | |
|---|---|---|
| π Admin | admin@reviewmod.com | Admin@123 |
| π‘οΈ Moderator | moderator@reviewmod.com | Mod@1234 |
| π€ User | user@reviewmod.com | User@1234 |
| π€ User | alice@reviewmod.com | Alice@1234 |
git clone <your-repository-url>
cd ReviewGuardcd backend
npm installCreate .env
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_secret_key
PORT=5000
CLIENT_URL=http://localhost:5173cd frontend
npm installcd backend
npm run seednpm run devnpm run dev- Full-Stack MERN Development
- AI-Powered Moderation Systems
- Semantic Similarity Analysis
- WebSocket Event Architecture
- Real-Time Synchronization
- Distributed Queue Systems
- Explainable AI
- Role-Based Authorization
- Scalable Backend Infrastructure
- Threat Intelligence Design
AI/ML β’ Full-Stack Development β’ Explainable AI β’ Real-Time Systems
If you like this project, give it a β on GitHub and feel free to fork or contribute.