chatbot / context.md
CampVerse CI
Deploy chatbot from GitHub Actions
50c083e
|
Raw History Blame Contribute Delete
4.29 kB

QR Attendance & Certificate Generation Module Plan

1. QR Attendance

  • Integrate QR scanning in host dashboard.
  • On scan, call backend to mark attendance.
  • QR Scanner component exists at Frontend/src/hostdashboard/QRScanner.jsx
  • Backend endpoint /api/hosts/scan-qr implemented

2. Certificate Generation

  • Add option in event creation to enable certificates.
  • Modal for host to upload participant data (CSV/Excel), signatures, and designation.
  • Allow template selection/upload.
  • Backend endpoint to receive uploads and trigger certificate generation.
  • Use /ML/certificate_generator/generator.py for batch certificate creation.
  • Store generated certificates and provide download/email options.
  • Complete Certificate Management UI component created

3. Certificate Distribution

  • API to fetch/download certificates for users.
  • Optionally, email certificates to participants.
  • Download endpoints implemented

4. Admin/Host Controls

  • Dashboard to view certificate status, re-generate, or re-send.
  • Complete status dashboard with participant tracking

5. Security & Validation

  • Validate uploads (file type, size).
  • Ensure only hosts/co-hosts can trigger certificate generation.
  • QR code expiry and single-use validation
  • Per-event QR verification (scan must match event) with unlimited scans

Implementation Summary

✅ Completed Files

Backend

  1. Controller/certificateManagement.js - NEW

    • Certificate settings management
    • Asset upload handling
    • Certificate generation orchestration
    • Status tracking
    • User certificate retrieval
  2. Routes/certificateManagementRoutes.js - NEW

    • All certificate management endpoints
    • Proper authentication and authorization
    • Swagger documentation
  3. Routes/hostRoutes.js - UPDATED

    • Added QR scanning endpoint
    • Integrated with event controller
  4. Models/Event.js - UPDATED

    • Added certificate settings schema
    • Upload tracking
  5. app.js - UPDATED

    • Registered certificate management routes

Frontend

  1. hostdashboard/CertificateManagement.jsx - NEW

    • Complete certificate management UI
    • Settings configuration
    • Asset upload interface
    • Status dashboard
    • Participant tracking table
    • Generation and regeneration controls
  2. hostdashboard/QRScanner.jsx - EXISTS

    • QR code scanning functionality
    • Real-time validation
    • Attendance marking
  3. hostdashboard/index.js - UPDATED

    • Exported CertificateManagement component

Documentation

  1. docs/host-module-complete-guide.md - NEW
    • Complete implementation guide
    • Workflow documentation
    • API documentation
    • Security considerations
    • Testing checklist
    • Troubleshooting guide

Integration Points

Certificate Generator API

  • Base URL: http://localhost:8000 (configurable)
  • Endpoints integrated:
    • /upload-template
    • /upload-logo
    • /upload-signature
    • /config/*
    • /generate
    • /download/{filename}

Backend APIs

  • /api/hosts/scan-qr - QR attendance marking
  • /api/certificate-management/events/:eventId/* - Certificate operations
  • /api/events/my-qr/:eventId - User QR retrieval

Next Steps for Deployment

  1. Environment Setup

    # Add to .env
    CERTIFICATE_API_URL=http://localhost:8000
    
  2. Start Certificate Generator

    cd ML/certificate_generator
    python api_main.py
    
  3. Install Dependencies

    cd Backend
    npm install axios form-data
    
    cd ../Frontend
    npm install @mui/material @emotion/react @emotion/styled
    
  4. Database Migration

    • Event schema already supports certificate settings
    • No migration needed, backward compatible
  5. Testing

    • Test QR scanning flow
    • Test certificate generation end-to-end
    • Verify asset uploads
    • Check permissions

Status: ✅ COMPLETE - All planned features implemented Date: November 14, 2025


References:

  • /ML/certificate_generator/README.md for generator usage.
  • /Backend/Controller/host.js for attendance and event logic.
  • /docs/host-module-complete-guide.md for complete implementation guide.