Skip to content

πŸŽ“ Digital certificate issuance and verification system for universities. React + Node.js + MySQL with JWT auth, email verification, and admin approval workflow.

License

Notifications You must be signed in to change notification settings

litch07/eduauth-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EduAuth Registry

License: MIT Node.js Version React Version

πŸ“– Overview

EduAuth Registry is a comprehensive digital certificate issuance and verification system designed for Bangladeshi universities. This full-stack web application enables universities to issue tamper-proof digital certificates, students to manage their credentials and access requests, employers/verifiers to search and verify student qualifications, and administrators to oversee the entire system with analytics and audit trails.

The system emphasizes database design quality, normalization, data integrity, security, and professional UI/UX. With features like transaction-safe serial generation, two-factor verification, and privacy-preserving design, EduAuth Registry sets the standard for secure educational credential management.

πŸ“š Documentation

πŸ“Έ Screenshots

Landing Page

Landing Page Light Mode

Light Mode

Landing Page Dark Mode

Dark Mode

Core Functionality

Certificate Verification

Public Certificate Verification

Certificate Details

Certificate Details

User Dashboards

Student Dashboard

Student Dashboard

University Dashboard

University Dashboard

Verifier Dashboard

Verifier Dashboard

Admin Dashboard

Admin Dashboard

User Experience Features

Email Verification Modal

Email Verification System

Dark Mode

Dark Mode Support


Email Notifications

Verification Email

Email Verification Code (OTP)

Approval Email

Account Approval Notification

Admin Verification Flow: After email verification, admin approval is required (manual verification of user details through admin dashboard). The system is designed to work without external APIs for maximum reliability.

✨ Features

  • πŸ” Secure Authentication - JWT-based authentication with bcrypt password hashing (12 rounds)
  • πŸ“§ Email Verification System - 6-digit OTP codes for account verification and admin approvals
  • πŸ”— Automated Notifications - Email alerts for important system events

πŸ—οΈ System Architecture

  • Frontend: React 18, React Router v6, Tailwind CSS v3, Axios, date-fns
  • Backend: Node.js, Express.js, MySQL2 connection pool
  • Database: MySQL 8.0 with 12 normalized tables and 6 optimized views
  • Authentication: JWT with 7-day expiration, bcrypt (12 rounds)
  • Email Service: Nodemailer with Gmail SMTP support
  • Storage: UUID v4 for all primary keys, InnoDB storage engine

πŸš€ Getting Started

Prerequisites

  • Node.js v18.0.0 or higher (Download)
  • MySQL 8.0 (Download or use XAMPP/WAMP)
  • npm or yarn (comes with Node.js)
  • Git (optional, for cloning)

Installation

1. Clone the Repository

git clone https://github.com/litch07/eduauth-registry.git
cd eduauth-registry

2. Backend Setup

cd backend
npm install
cp .env.example .env
# Edit .env with your database and email credentials

3. Database Setup

Import the schema using phpMyAdmin or command line:

# Using command line
mysql -u root -p eduauth_registry < database/schema.sql

# Or use phpMyAdmin to import database/schema.sql

Optional: Seed demo data

cd backend
node seed-demo.js

4. Frontend Setup

cd ../frontend
npm install

5. Run the Application

Open two terminals:

Terminal 1 - Backend (from backend/ directory):

npm run dev
# Runs on http://localhost:5000

Terminal 2 - Frontend (from frontend/ directory):

npm start
# Runs on http://localhost:3000

6. Access the Application

πŸ”‘ Default Credentials

After seeding demo data, use these credentials to login:

Role Email Password
Admin eduauthregistry@gmail.com admin123
Student 1 (Sadid) ssadidahmed01@gmail.com password123
Student 2 (Sayem) sayem23cse@gmail.com password123
Student 3 (Rayhan) mhossain2330996@bscse.uiu.ac.bd password123
University 1 (UIU) demo@uiu.ac.bd password123
University 2 (GUB) registry@green.edu.bd password123
Verifier 1 (Enoisis) ssadidahmed07@gmail.com password123
Verifier 2 (Tesla) ssadidahmed03@gmai.com password123

Note: Change these credentials in production!

πŸ“ Project Structure

eduauth-registry/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/               # Database & email configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ database.js       # MySQL connection pool
β”‚   β”‚   β”‚   └── email.js          # Nodemailer setup
β”‚   β”‚   β”œβ”€β”€ controllers/          # Business logic for each feature
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ studentController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ universityController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ verifierController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ verifyController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ adminController.js
β”‚   β”‚   β”‚   └── profileController.js
β”‚   β”‚   β”œβ”€β”€ middleware/           # Authentication & authorization
β”‚   β”‚   β”‚   └── auth.js           # JWT verification, role checking
β”‚   β”‚   β”œβ”€β”€ routes/               # API endpoint definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ studentRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ universityRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ verifierRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ adminRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ verifyRoutes.js
β”‚   β”‚   β”‚   └── profileRoutes.js
β”‚   β”‚   β”œβ”€β”€ utils/                # Helper functions
β”‚   β”‚   β”‚   β”œβ”€β”€ serialGenerator.js
β”‚   β”‚   β”‚   β”œβ”€β”€ activityLogger.js
β”‚   β”‚   β”‚   └── emailService.js
β”‚   β”‚   └── server.js             # Express app entry point
β”‚   β”œβ”€β”€ uploads/                  # User-uploaded files
β”‚   β”‚   β”œβ”€β”€ certificates/
β”‚   β”‚   β”œβ”€β”€ students/
β”‚   β”‚   └── universities/
β”‚   β”œβ”€β”€ .env.example              # Environment variables template
β”‚   β”œβ”€β”€ package.json
β”‚   └── seed-demo.js              # Demo data generator
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ DarkModeToggle.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardLayout.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EmailVerificationModal.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TopHeader.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PageHeader.jsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ context/              # Global state management
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   └── DarkModeContext.jsx
β”‚   β”‚   β”œβ”€β”€ pages/                # Page components by role
β”‚   β”‚   β”‚   β”œβ”€β”€ Landing.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Verify.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ student/
β”‚   β”‚   β”‚   β”œβ”€β”€ university/
β”‚   β”‚   β”‚   β”œβ”€β”€ verifier/
β”‚   β”‚   β”‚   └── admin/
β”‚   β”‚   β”œβ”€β”€ services/             # API client & configuration
β”‚   β”‚   β”‚   └── api.js            # Axios instance
β”‚   β”‚   β”œβ”€β”€ App.js                # Main app component
β”‚   β”‚   └── index.js              # React entry point
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ tailwind.config.js        # Tailwind CSS configuration
β”‚   β”œβ”€β”€ package.json
β”‚   └── ...
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ schema.sql                # Complete database schema
β”‚   └── seed.sql                  # Demo data SQL
β”œβ”€β”€ docs/                         # Documentation files
β”‚   β”œβ”€β”€ API.md                    # Detailed API documentation
β”‚   β”œβ”€β”€ DATABASE_SCHEMA.md        # ER diagram & schema details
β”‚   └── SETUP.md                  # Detailed setup guide
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ SETUP.md
└── README.md

πŸ” Environment Variables

Create a .env file in the backend/ directory with the following variables:

# ===== SERVER CONFIGURATION =====
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

# ===== DATABASE CONFIGURATION =====
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=
DB_NAME=eduauth_registry
DB_PORT=3306

# ===== JWT CONFIGURATION =====
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_EXPIRES_IN=7d

# ===== EMAIL CONFIGURATION (Gmail) =====
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
SMTP_FROM=EduAuth Registry <noreply@eduauth.com>

Gmail App Password Setup

  1. Enable 2-Factor Authentication on your Gmail account
  2. Generate an App Password
  3. Use the generated password in SMTP_PASS

πŸ“š API Documentation

Public Endpoints (No Authentication)

Certificate Verification

  • POST /api/verify/certificate - Verify certificate using Serial + DOB
    {
      "serial": "BSC-25-000001M",
      "dateOfBirth": "2000-01-15"
    }

Authentication Endpoints

User Registration & Login

  • POST /api/auth/register/student - Register as student
  • POST /api/auth/register/university - Register as university (requires admin approval)
  • POST /api/auth/register/verifier - Register as verifier (requires admin approval)
  • POST /api/auth/login - Login (Student, University, or Verifier)
  • POST /api/auth/send-verification-code - Send email verification code
  • POST /api/auth/verify-email-code - Verify email with 6-digit code

Student Protected Routes

  • GET /api/student/dashboard - Dashboard statistics
  • GET /api/student/certificates - Get student's certificates
  • PUT /api/student/certificates/:id/toggle-sharing - Toggle certificate privacy
  • GET /api/student/certificate-requests - View access requests
  • PUT /api/student/certificate-requests/:id/approve - Approve request
  • PUT /api/student/certificate-requests/:id/reject - Reject request

University Protected Routes

  • GET /api/university/dashboard - Dashboard statistics
  • GET /api/university/students - List enrolled students
  • POST /api/university/students/enroll - Enroll new student
  • GET /api/university/students/search - Search students by email
  • POST /api/university/certificates/issue - Issue new certificate

Verifier Protected Routes

  • GET /api/verifier/dashboard - Dashboard statistics
  • GET /api/verifier/search-student - Search by NID + DOB
  • POST /api/verifier/request-all-certificates - Request access to all certificates
  • POST /api/verifier/request-single-certificate - Request access to specific certificate
  • GET /api/verifier/my-requests - View sent requests
  • GET /api/verifier/active-access - View active access grants
  • GET /api/verifier/verification-history - View verification history

Admin Protected Routes

  • GET /api/admin/dashboard - System statistics
  • GET /api/admin/pending-verifiers - Pending verifier approvals
  • PUT /api/admin/verifiers/:id/approve - Approve verifier
  • PUT /api/admin/verifiers/:id/reject - Reject verifier
  • GET /api/admin/users - List all users
  • GET /api/admin/verification-analytics - Verification statistics
  • GET /api/admin/activity-logs - System activity logs

For detailed API documentation, see API.md

πŸ—„οΈ Database Schema

12 Normalized Tables (3NF)

Core User Tables:

  • Admins - System administrators
  • Users - All user accounts (STUDENT, UNIVERSITY, VERIFIER)
  • Student - Student profile information
  • Institution - University/institution profiles
  • Verifiers - Employer/organization verifier profiles

Operational Tables:

  • Enrollment - Links students to institutions
  • Certificate - Issued certificates with serial numbers
  • CertificateSequence - Singleton table for safe serial generation

Request & Access Tables:

  • CertificateRequests - Verifier requests for access
  • VerifierAccess - Active access grants

Audit Tables:

  • VerificationLog - Public certificate verification audit trail
  • ActivityLog - System-wide activity audit
  • EmailVerificationCodes - Email verification OTP codes

6 Database Views (Performance Optimization)

  • vw_certificates_full - Certificate with student and institution details
  • vw_student_dashboard - Student statistics
  • vw_university_dashboard - University statistics
  • vw_verification_stats - Verification statistics per certificate
  • vw_active_enrollments - Complete enrollment information
  • vw_system_stats - System-wide metrics

For detailed ER diagram and schema, see DATABASE_SCHEMA.md

πŸ”’ Security Features

Authentication & Authorization

  • βœ… JWT Authentication - 7-day token expiration
  • βœ… bcrypt Password Hashing - 12 rounds with salt
  • βœ… Role-Based Access Control (RBAC) - Fine-grained permissions
  • βœ… Email Verification - 6-digit OTP codes

Data Protection

  • βœ… SQL Injection Prevention - All queries parameterized
  • βœ… Soft Delete - Data retention with logical deletion
  • βœ… Complete Audit Trail - ActivityLog for all actions
  • βœ… Privacy Protection - Sensitive data never exposed in APIs

Verification & Privacy

  • βœ… Two-Factor Verification - Serial + Date of Birth
  • βœ… Admin Approval Workflow - Universities and verifiers require approval
  • βœ… Privacy-Preserving Search - NID search doesn't expose personal data
  • βœ… Student Control - Can toggle certificate sharing and revoke access

🎨 Key Features Explained

Certificate Serial Format

Each certificate has a unique, tamper-proof serial number: BSC-25-000001M

  • BSC - Degree level (BSC/MSC/PHD)
  • 25 - Year (2025)
  • 000001 - Base-36 sequence number (6 characters, auto-incrementing)
  • M - Checksum digit (validates sequence using weighted modulo-36)

Transaction-Safe Serial Generation

The system prevents duplicate serials using:

  • SELECT ... FOR UPDATE - Row-level locking
  • CertificateSequence - Singleton table for atomic increments
  • Transaction rollback on failure

This ensures data integrity even under concurrent issuance.

Two-Factor Verification

Public certificate verification requires two independent factors:

  1. Certificate Serial Number - Public identifier
  2. Student Date of Birth - Private credential

This prevents unauthorized access while maintaining privacy.

Admin Approval System

New universities and verifiers require admin approval:

  1. User registers with details
  2. Admin reviews in pending approvals
  3. Admin approves (sends email) or rejects with reason
  4. User can now use the system (if approved)

πŸ§ͺ Testing

Test with Postman/Insomnia

  1. Import the API collection (if available)
  2. Set environment variables (BASE_URL, JWT_TOKEN)
  3. Run test requests

Test with Demo Data

cd backend
node seed-demo.js

This creates:

  • 1 Admin account (eduauthregistry@gmail.com)
  • 2 Universities (UIU and GUB, both pre-approved)
  • 3 Students (Sadid, Sayem, Rayhan with enrollments)
  • 2 Verifiers (Enoisis and Tesla, both pre-approved)
  • 3 Certificates with different degree levels
  • Sample verification history and activity logs

🀝 Contributing

This is an academic DBMS Lab project. Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please see CONTRIBUTING.md for guidelines.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

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

Sadid Ahmed (@litch07)

πŸ™ Acknowledgments

  • Built as a DBMS Lab project for database design excellence
  • Inspired by secure educational credential systems
  • Thanks to all contributors and reviewers

πŸ“ž Support

For support, questions, or bug reports:

πŸ”— Quick Links

🌟 Project Highlights

Database Design

  • βœ… 3NF normalization
  • βœ… 12 normalized tables
  • βœ… 6 optimized views
  • βœ… Complete integrity constraints
  • βœ… Comprehensive indexing

Code Quality

  • βœ… Clean, maintainable code
  • βœ… Consistent naming conventions
  • βœ… Proper error handling
  • βœ… Security best practices
  • βœ… Well-documented

User Experience

  • βœ… Professional UI design
  • βœ… Responsive layout
  • βœ… Dark mode support
  • βœ… Intuitive navigation
  • βœ… Clear error messages

⭐ If you find this project useful, please consider giving it a star!

Made with ❀️ for academic excellence.

About

πŸŽ“ Digital certificate issuance and verification system for universities. React + Node.js + MySQL with JWT auth, email verification, and admin approval workflow.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages