Skip to content

Vishnumgit/feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

279 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student Feedback System

A Modern, Multi-Role Feedback Collection & Analytics Platform for Educational Institutions

HTML CSS3 JavaScript Firebase Chart.js EmailJS



🏫 A transparent, anonymous, and structured system for collecting student feedback to enhance teaching quality and professional development.


✨ Key Highlights

Feature Description
πŸŒ™ Dark Theme UI Beautiful dark glassmorphism design with purple accent theme
πŸ” 3 Role-Based Portals Separate dashboards for Admin, Teacher, and Student
πŸ“Š Rich Analytics Radar, Bar, Doughnut, and Trend charts powered by Chart.js
πŸ“„ Report Generator Downloadable HTML reports with SVG charts β€” print as PDF
πŸ”₯ Firebase Cloud Sync Offline-first with automatic Firestore background sync
πŸ“± Responsive Design Works on desktop, tablet, and mobile screens
πŸ”‘ Password Reset Cloud Functions–backed forgot-password flow β€” EmailJS sends reset links, no unauthenticated Firestore access
πŸš€ Zero Dependencies No frameworks, no build step β€” just open index.html
πŸ”’ SHA-256 Password Hashing Secure credential storage using Web Crypto API with legacy migration support
⚑ Performance Optimized Non-blocking login writes and 5-min sync cache reduce Firestore reads

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    🌐 Landing Page                       β”‚
β”‚              (Student / Teacher / Admin)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚              β”‚              β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
    β”‚  πŸŽ“ Student β”‚ β”‚ πŸ‘¨β€πŸ« Teacherβ”‚ β”‚  πŸ”‘ Admin  β”‚
    β”‚   Portal    β”‚ β”‚  Portal  β”‚ β”‚   Panel    β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚              β”‚              β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
    β”‚  πŸ“ Submit  β”‚ β”‚ πŸ“Š View  β”‚ β”‚ πŸ‘₯ Manage  β”‚
    β”‚  Feedback   β”‚ β”‚ Analyticsβ”‚ β”‚ Everything β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚              β”‚              β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚    πŸ—„οΈ Data Layer       β”‚
              β”‚  localStorage (fast)  β”‚
              β”‚    β‡… background sync  β”‚
              β”‚  πŸ”₯ Firebase Firestore β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”‘ Role-Based Features

πŸ” Admin Panel β€” 7 Powerful Tabs

Tab Features
πŸ‘₯ User Management Create/edit/delete users, bulk CSV import with column normalization, batch delete with Firestore cleanup
πŸ“š Subjects & Questionnaires Add subjects, build multi-section question sets with per-subject customization
πŸ‘₯ Teacher Assignment Visual checklist cards with Roll No, section grouping, Tick All / Clear All
πŸ’¬ Feedback Oversight Filter by teacher/subject/anonymity, Select All checkbox, Delete Selected + Clear All (syncs to Firestore)
πŸ“‹ Attendance Upload CSV attendance per section, 75% threshold gate, Clear All attendance
πŸ“Š Reports & Analytics Institution bar chart, dept comparison, score distribution, per-teacher radar + bar, Download Report (HTML with SVG charts)
βš™οΈ System Settings College name, email domain, minimum threshold slider

πŸ‘¨β€πŸ« Teacher Dashboard

View Features
πŸ“Š Overview Score cards, radar chart, bar chart, trend line, performance status banner
πŸ’¬ Student Comments View all student feedback comments
πŸ“ˆ Score Breakdown Category-wise detailed scores
🏒 Department Feedback Rank-based comparison with department peers (individual scores hidden)
πŸ“‹ Section-wise Feedback Breakdown by student section
πŸ“„ Download Report Beautiful HTML report with SVG charts, data table, comments β€” print as PDF

πŸŽ“ Student Portal

Feature Description
πŸ“ Feedback Form Multi-section 1-5 star ratings, anonymous option, comments, attendance-gated (β‰₯75%)
πŸ‘€ Dashboard Profile with Roll No, assigned teachers list, submission status per teacher
πŸ”‘ Forgot Password Email-based password reset via EmailJS with secure Firestore tokens (1-hour expiry, single-use)

πŸ”₯ Firebase Firestore Schema

Collection Key Description
users sfft_users All student, teacher, admin accounts
subjects sfft_subjects Academic subjects (Math, Physics, etc.)
questionnaires sfft_questionnaires Subject-specific feedback question sets
enrollments sfft_enrollments Student ↔ Teacher assignment mappings
responses sfft_responses Submitted feedback with scores & comments
attendance sfft_attendance Student attendance records per section
settings sfft_settings College name, domain, min threshold
password_resets β€” Reset tokens with expiry for forgot password flow
fcm_tokens β€” Firebase Cloud Messaging device tokens
notifications β€” Push notification records for users

πŸ“ Project Structure

feedback/
β”œβ”€β”€ πŸ“„ index.html              # Landing page (role selection)
β”œβ”€β”€ πŸ“„ report.html             # Detailed project report page
β”‚
β”œβ”€β”€ πŸ” admin-login.html        # Admin login
β”œβ”€β”€ πŸ” teacher-login.html      # Teacher login
β”œβ”€β”€ πŸ” student-login.html      # Student login
β”œβ”€β”€ πŸ”‘ reset-password.html     # Forgot / Reset password (EmailJS + Firestore)
β”‚
β”œβ”€β”€ πŸ“Š admin-dashboard.html    # Admin panel (1,968 lines β€” 7 tabs)
β”œβ”€β”€ πŸ“Š teacher-dashboard.html  # Teacher portal (877 lines)
β”œβ”€β”€ πŸ“Š student-dashboard.html  # Student portal (489 lines)
β”œβ”€β”€ πŸ“ feedback-form.html      # Feedback submission form
β”‚
β”œβ”€β”€ πŸ”” firebase-messaging-sw.js # Firebase Cloud Messaging service worker
β”‚
β”œβ”€β”€ πŸ“‚ css/
β”‚   └── style.css              # Global dark theme styles (523 lines)
β”‚
└── πŸ“‚ js/
    β”œβ”€β”€ auth.js                # Authentication & session management
    β”œβ”€β”€ charts.js              # Chart.js rendering helpers
    β”œβ”€β”€ data.js                # Data layer β€” CRUD + analytics (309 lines)
    β”œβ”€β”€ firebase-config.js     # Firebase initialization
    β”œβ”€β”€ firebase-sync.js       # Firestore ↔ localStorage sync (237 lines)
    └── fix_emojis.js          # Emoji compatibility

Total: 5,434 lines of code across 15 source files


πŸš€ Quick Start

Prerequisites

  • A modern web browser (Chrome, Firefox, Edge, Safari)
  • No server required β€” runs entirely client-side!

Setup

# 1. Clone the repository
git clone https://github.com/Vishnumgit/feedback.git

# 2. Open in browser
cd feedback
open index.html    # macOS
# or
start index.html   # Windows

Default Admin Login

Field Value
Email admin@college.edu
Password Admin@123

πŸ’‘ First visit auto-seeds the database with default subjects, questionnaires, and the admin account.

⚠️ Security Note: Default admin passwords are now hashed with SHA-256 on first use. The system supports legacy plaintext passwords during migration and automatically upgrades them to secure hashes.


πŸ› οΈ Technology Stack

Layer Technology Purpose
Frontend HTML5, CSS3, Vanilla JS UI, interactivity, DOM manipulation
Styling CSS Custom Properties Dark theme with glassmorphism effects
Charts Chart.js 4.4.0 Radar, Bar, Doughnut, Trend charts
Reports Inline SVG + HTML Downloadable printable reports
Database Firebase Firestore Cloud NoSQL database
Offline localStorage Fast offline-first data access
Sync firebase-sync.js Background bidirectional sync
Email EmailJS (server-side via Cloud Functions) Password reset emails β€” keys never exposed in client
Functions Firebase Cloud Functions v2 Secure backend for password-reset flow (bcrypt hashing, token management)
Auth Session-based (localStorage) Role-based access control
Fonts Google Fonts (Inter) Professional typography
Hosting Static files Deploy anywhere β€” GitHub Pages, Netlify, etc.

πŸ“Š Key Metrics

Metric Value
πŸ“ Total Lines of Code 5,434
πŸ“ Source Files 16
πŸ”₯ Firestore Collections 8
πŸ‘€ User Roles 3 (Admin, Teacher, Student)
πŸ“Š Chart Types 4 (Radar, Bar, Doughnut, Trend)
πŸ“„ Report Generators 2 (Teacher + Admin)
πŸ—‚οΈ Admin Tabs 7
πŸ“± Responsive Yes
⚑ Build Step None

πŸ“‹ Recent Changes (2026-03-30)

Category Changes
☁️ Cloud Functions Add functions/ with three callable functions (requestPasswordReset, verifyResetToken, confirmPasswordReset) that handle the full password-reset flow server-side using Admin SDK
πŸ”’ Security Move all token/Firestore operations out of the browser; store passwords as bcrypt (server) and SHA-256 (localStorage fallback, computed server-side); EmailJS private key stored in Firebase Secret Manager
πŸ›‘οΈ Firestore Rules Explicitly deny client access to password_resets collection
πŸ”‘ reset-password.html Replace direct Firestore calls with Firebase callable function invocations; remove EmailJS browser SDK and exposed keys
βš™οΈ firebase-config.js Initialize firebase.functions() for callable invocations
πŸ“„ README Add Cloud Functions setup guide and EmailJS key configuration instructions

☁️ Cloud Functions Setup (Password Reset)

The forgot-password / reset-password flow is backed by three Firebase Cloud Functions so that unauthenticated browsers never access Firestore directly (which would be blocked by the security rules).

Functions overview

Function Description
requestPasswordReset Looks up the user, creates a one-time token in password_resets, sends the reset link via EmailJS
verifyResetToken Checks that a token exists, is not used, and has not expired
confirmPasswordReset Validates the token, hashes the new password with bcrypt (server-side), updates Firestore + Firebase Auth, marks the token used

Prerequisites

EmailJS private key

Server-side calls to the EmailJS REST API require a private (access) token β€” this is different from the public key used in the browser.

  1. Log in to EmailJS dashboard β†’ Account β†’ API Keys
  2. Copy your Private Key

⚠️ Never put the private key in client-side code or commit it to the repository.

Deploy the functions

# 1. Install dependencies
cd functions
npm install

# 2. Authenticate and select your project
firebase login
firebase use <your-firebase-project-id>   # e.g. student-feedback-form-489916

# 3. Set EmailJS secrets as environment variables
firebase functions:secrets:set EMAILJS_SERVICE_ID
firebase functions:secrets:set EMAILJS_TEMPLATE_ID
firebase functions:secrets:set EMAILJS_PUBLIC_KEY
firebase functions:secrets:set EMAILJS_PRIVATE_KEY
firebase functions:secrets:set BASE_URL
# BASE_URL should be the full URL to reset-password.html, e.g.:
#   https://vishnumgit.github.io/feedback/reset-password.html
# (The CLI will prompt you to paste each value securely)

# 4. Deploy
firebase deploy --only functions

The functions are deployed to the us-central1 region by default. Change setGlobalOptions({ region: ... }) in functions/index.js if you need a different region.

EmailJS template variables

Your EmailJS template (ID stored in EMAILJS_TEMPLATE_ID) must contain two variables:

Variable Value sent
{{email}} Recipient email address
{{link}} Full password-reset URL

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

P Vishnuvardhan Reddy


πŸ“„ License

This project is built for educational purposes at MGIT.


⭐ Star this repo if you found it useful!

Made with ❀️ for better education


πŸ”₯ Firebase Setup (Required)

This project uses Firebase Authentication and Firestore for secure data management.

Step 1: Enable Authentication

  1. Go to Firebase Console β†’ Select your project
  2. Navigate to Authentication β†’ Sign-in method tab
  3. Enable Email/Password β†’ Toggle ON β†’ Save
  4. Enable Anonymous β†’ Toggle ON β†’ Save (fallback for Google Sign-In)

πŸ’‘ Both are completely free on the Spark plan (unlimited auth operations).

Step 2: Deploy Firestore Security Rules

  1. Go to Firestore Database β†’ Rules tab
  2. Replace existing rules with the content from firestore.rules
  3. Click Publish

Security Model

Updated: Security rules now use explicit per-collection access control instead of a catch-all rule. Anonymous auth users can read whitelisted collections but cannot write to sensitive ones. All unlisted collections are denied by default.

Role Users Subjects Enrollments Responses Settings
Admin Read/Write All Read/Write Read/Write Read/Write/Delete Read/Write
Student Read Own Read Read Read + Create Read
Teacher Read Own Read Read Read Read
Unauthenticated ❌ Blocked ❌ Blocked ❌ Blocked ❌ Blocked ❌ Blocked

Auto-Migration

Existing users (from localStorage) are automatically migrated to Firebase Auth on their first login. No manual account creation needed β€” the system handles it seamlessly.

Free Plan Limits

Resource Free Limit Our Usage
Authentication Unlimited βœ… Well within
Firestore Reads 50,000/day βœ… Reduced by role-based sync + 5-min cache
Firestore Writes 20,000/day βœ… Reduced by security rules blocking unauthorized writes
Storage 1 GiB βœ… Minimal

About

Feedback System - Student, Teacher & Admin Portal

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors