Skip to content

Dnyaneshwar-dnyanu/peer-review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

fd4656d0-fab6-4c3c-a958-aed5f8833169
A full-stack web application designed to streamline the academic peer review process in colleges.
The platform enables teachers to create classrooms , students to submit projects , and teachers to evaluate projects with structured feedback and marks.


πŸš€ Live Demo

πŸ–ΌοΈ Screenshots

Add your screenshots to a /screenshots folder and update this section with the final images.

  • Login and registration
  • Teacher dashboard and classroom
  • Student dashboard and classroom
  • Project evaluation and export

πŸš€ Features

πŸ‘©β€πŸ« Teacher

  • Secure authentication
  • Create and manage classrooms
  • Generate unique room codes
  • View participants and submitted projects
  • Evaluate student projects (marks + feedback)
  • Close classrooms to stop submissions
  • Export evaluation data as CSV
  • Export evaluation data as Excel (XLSX)

πŸ§‘β€πŸŽ“ Student

  • Secure authentication
  • Join classrooms using room code
  • Submit project details
  • View feedback and marks
  • Automatic redirection when classroom is closed

πŸ” General

  • Role-based access control (Teacher / Student)
  • JWT authentication with cookies
  • Real-time UI updates using polling
  • Clean glassmorphism UI
  • Responsive design

🧠 System Architecture

Frontend (React + Tailwind)
          ↓
Backend (Node.js + Express)
          ↓
Database (MongoDB)
  • Frontend handles UI and user interaction
  • Backend handles authentication, business logic, and CSV export
  • MongoDB stores users, rooms, projects, and reviews

🧭 Architecture Diagram

flowchart LR
  UI[React + Tailwind] -->|HTTPS| API[Node.js + Express]
  API -->|Mongoose| DB[(MongoDB)]
  API -->|SMTP| Mail[(Email Provider)]
Loading

πŸ› οΈ Tech Stack

Frontend

  • React.js
  • Tailwind CSS
  • React Router

Backend

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT Authentication
  • bcrypt

πŸ” Authentication Flow

  • JWT token generated on login
  • Token stored in HTTP cookies
  • Middleware validates user on every protected route
  • Role-based authorization ensures correct access

πŸ”„ Real-Time Updates Strategy

The system uses polling to synchronize data across users.

  • Client fetches updated room/project data every few seconds
  • Ensures all users see latest submissions and reviews
  • Stable and suitable for academic environments
  • Avoids complexity of WebSockets

πŸ“Š CSV Export Feature

  • Teachers can download evaluation data in CSV format
  • CSV is generated dynamically on backend
  • Includes student details, project title, marks, and feedback
  • File opens directly in Excel / Google Sheets

πŸ§ͺ Testing Note (Important)

Cookies are shared across browser tabs.

To test Teacher and Student simultaneously , use:

  • Different browsers (Chrome & Brave), or
  • Incognito window

This ensures correct session isolation.


▢️ How to Run the Project

1️⃣ Clone the repository

git clone https://github.com/your-username/peer-review-system.git

2️⃣ Backend setup

cd backend
npm install
npm start

Create a .env file:

MONGO_URI=mongodb://localhost:27017/peer-review
JWT_KEY=your_secret_key
FRONTEND_URL=http://localhost:5173
CORS_ORIGINS=http://localhost:5173
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
JWT_EXPIRES_IN=15m
REFRESH_TOKEN_EXPIRES_IN=7d
LOG_LEVEL=info

3️⃣ Frontend setup

cd frontend
npm install
npm run dev

πŸ”§ Operations Runbook

Environments

  • Local: http://localhost:5173 (frontend) + http://localhost:3000 (backend)
  • Dev/Staging: Use dedicated URLs and isolated MongoDB instances
  • Production: Render backend + Vercel frontend (or your hosting setup)

Health and readiness

  • GET /healthz returns process status and uptime
  • GET /readyz returns readiness based on MongoDB connection

Logs

  • JSON structured logs with timestamp, level, message, requestId, userId, latencyMs
  • Set log level via LOG_LEVEL (e.g., info, warn, error)

πŸ“ˆ Monitoring

UptimeRobot

  • Monitor GET /healthz for uptime
  • Optionally monitor GET /readyz for database readiness
  • Use the public backend URL (Render) for checks and alerts

Prometheus

  • A sample Prometheus configuration is provided in prometheus.yml
  • Default scrape target: host.docker.internal:3000
  • If you expose a metrics endpoint (for example, /metrics), update the scrape config accordingly

πŸ§ͺ DevOps Pipeline (CI/CD)

This repository includes a GitHub Actions workflow at .github/workflows/main.yml.

On every push or pull request to main

  • Security - Audit & Scan: installs dependencies, runs npm audit, builds backend image, and scans with Trivy
  • Backend - Test: installs backend dependencies and runs npm test
  • Frontend - Lint, Test & Build: runs npm run lint, npm test, and npm run build

On push to main

  • Backend - Build & Push Docker Image: pushes to GitHub Container Registry (GHCR)
  • Backend - Trigger Render Deployment: calls the Render deploy hook and verifies /healthz

CI/CD secrets

  • RENDER_DEPLOY_HOOK - triggers backend deploy on Render
  • BACKEND_HEALTH_URL - base URL for health checks (example: https://peer-review-backend.onrender.com)
  • RENDER_ROLLBACK_HOOK - optional rollback hook for auto-revert on failed health checks

πŸ’Ύ Backup and Restore

Prerequisites: MongoDB Database Tools (mongodump, mongorestore) installed on the machine.

Backup (Linux/macOS)

export MONGO_URI=mongodb://localhost:27017/peer-review
export BACKUP_DIR=./backups
./backend/scripts/backup.sh

Backup (Windows PowerShell)

$env:MONGO_URI="mongodb://localhost:27017/peer-review"
$env:BACKUP_DIR=".\backups"
./backend/scripts/backup.ps1

Restore (Linux/macOS)

export MONGO_URI=mongodb://localhost:27017/peer-review
export BACKUP_PATH=./backups/20260101-120000
./backend/scripts/restore.sh

Restore (Windows PowerShell)

$env:MONGO_URI="mongodb://localhost:27017/peer-review"
$env:BACKUP_PATH=".\backups\20260101-120000"
./backend/scripts/restore.ps1

Restore drill (recommended monthly)

  • Take a fresh backup from production
  • Restore into staging or a local environment
  • Run smoke tests (login, create room, add project)
  • Record duration and any issues in the release notes

🚨 Incident Response

  • Triage: confirm impact and capture request IDs from logs
  • Mitigate: rollback via RENDER_ROLLBACK_HOOK or redeploy last known good image
  • Communicate: post status update to stakeholders
  • Resolve: fix root cause and deploy patch
  • Postmortem: document timeline, fix action items, add tests

βœ… Release Checklist

  • Ensure CI green: tests, lint, security audit, Trivy scan
  • Verify environment variables and secrets
  • Run database backup before production deploy
  • Deploy and verify GET /healthz and GET /readyz
  • Monitor logs for errors and latency spikes
  • Update release notes

πŸ›‘οΈ Governance

Branch protection recommendation (GitHub):

  • Require pull request reviews
  • Require status checks:
    • Backend - Test
    • Frontend - Lint, Test & Build
    • Security - Audit & Scan
  • Require branches to be up to date before merging
  • Restrict who can push to main

πŸŽ“ Academic Relevance

This project demonstrates:

  • Full-stack development
  • Secure authentication
  • Role-based access control
  • Database design
  • REST API design
  • UI/UX principles
  • Real-world problem solving

πŸ‘¨β€πŸ’» Author

Developed as an academic project to improve transparency and efficiency in project evaluation systems.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages