Skip to content

Subroto-Datta/digital-noc-system

Repository files navigation

Digital NOC Management System

A comprehensive, modern web-based application designed to streamline the process of generating, tracking, and managing NOC (No Objection Certificate) requests within academic institutions. Built with React, Node.js, Express, and MongoDB.

🎯 Core Purpose & Functionality

NOC (No Objection Certificate) is typically required by students for various purposes like:

  • Internships at companies
  • Study abroad programs
  • Research collaborations
  • Conference attendance
  • Workshop participation
  • External project participation
  • Other academic activities requiring institutional approval

✨ Key Features

🔐 Advanced Authentication System

  • JWT-based secure authentication
  • Role-based access control (Student, Faculty, Admin)
  • Password hashing with bcrypt (12-round salting)
  • Session management and auto-logout
  • Profile management and updates

📋 Comprehensive NOC Request Management

  • Create Requests with detailed information:
    • Title, Department, Purpose, Description
    • File attachments (PDF, JPG, PNG, GIF) up to 5MB
    • Multiple document upload support
    • Automatic priority calculation
  • Status Tracking: Pending, Under Review, Approved, Rejected
  • Priority Levels: Low, Medium, High (AI-based calculation)
  • View and filter requests by status, department, date
  • Pagination support for large datasets
  • Advanced search and filtering capabilities

🎛️ Role-Based Access Control

  • Students:
    • Create and submit NOC requests
    • Upload supporting documents
    • Track request status in real-time
    • Download approved certificates
    • View request history and details
  • Faculty:
    • Review all pending NOC requests
    • Approve or reject with comments
    • View analytics and statistics
    • Generate and email certificates
    • Priority-based request filtering
  • Administrators:
    • Full system management access
    • Advanced analytics and reporting
    • Priority analysis tools
    • User management
    • Delete and archive requests
    • System configuration

📊 Modern Dashboard Interface

  • Beautiful, responsive UI with Tailwind CSS + Shadcn/UI
  • Real-time statistics and metrics
  • Interactive charts and graphs (Recharts)
  • Protected routes with role-based access
  • Dark mode support
  • Mobile-responsive design
  • Animated landing page with live statistics
  • Interactive data visualizations

🏗️ Technical Architecture

Frontend (React.js)

  • React 18.2.0 with React Router v6 for navigation
  • Tailwind CSS 3.3+ with custom configuration
  • Shadcn/UI components (Radix UI primitives)
  • Axios for API communication with interceptors
  • Context API for global state management (Auth Context)
  • Recharts for data visualization and analytics
  • jsPDF & html2canvas for PDF certificate generation
  • react-to-print for print functionality
  • Lucide React icons for modern iconography
  • JWT token management with automatic refresh
  • Protected routes with role-based rendering
  • Responsive design with mobile-first approach

Backend (Node.js/Express)

  • Express.js server with RESTful API architecture
  • MongoDB with Mongoose ODM (v8.0+)
  • JWT authentication with secure token generation
  • Multer for file upload handling (5MB limit)
  • Nodemailer for email notifications
  • Role-based authorization middleware
  • Input validation with express-validator
  • Rate limiting (100 requests per 15 minutes)
  • Helmet.js for security headers
  • CORS configuration for cross-origin requests
  • File system management for document storage

📊 Database Models

User Model

Comprehensive user management with the following fields:

  • name: Full name (2-50 characters)
  • email: Unique email address with validation
  • password: Bcrypt hashed password (12-round salting)
  • role: student | faculty | admin
  • department: User's department
  • studentId: Optional student identification number
  • isActive: Account status flag
  • lastLogin: Last login timestamp
  • timestamps: createdAt, updatedAt (auto-managed)

NocRequest Model

Detailed NOC request tracking with rich features:

  • title: Request title (5-100 characters)
  • description: Detailed description (10-1000 characters)
  • purpose: Categorized purpose (internship, research, conference, etc.)
  • department: Associated department
  • status: pending | under_review | approved | rejected
  • priority: low | medium | high (auto-calculated)
  • student: Reference to User model
  • reviewedBy: Reference to reviewing faculty/admin
  • reviewComments: Feedback from reviewers (max 500 chars)
  • reviewedAt: Review timestamp
  • attachments: Array of uploaded documents with metadata
    • filename, originalName, path, uploadedAt
  • tags: Array of categorization tags
  • isActive: Soft delete flag
  • timestamps: createdAt, updatedAt (auto-managed)

Indexes: Optimized for performance on student, status, department, and date queries

🚀 API Structure

Authentication Routes (/api/auth):

  • POST /api/auth/signup - User registration with validation
  • POST /api/auth/login - User login with JWT token generation
  • GET /api/auth/me - Get current authenticated user
  • PUT /api/auth/profile - Update user profile information

NOC Management Routes (/api/noc):

  • POST /api/noc/create - Create new NOC request with file uploads (Student)
  • GET /api/noc/:id - Get specific NOC request details
  • GET /api/noc/user/:userId - Get all NOC requests for a specific user
  • GET /api/noc - Get all NOC requests with pagination and filters (Faculty/Admin)
  • PUT /api/noc/update/:id - Update NOC status and details (Faculty/Admin)
  • DELETE /api/noc/delete/:id - Delete NOC request (Admin only)
  • GET /api/noc/stats/overview - Get statistics overview (Faculty/Admin)
  • GET /api/noc/priority-analysis/:id - Get detailed priority analysis (Admin)
  • POST /api/noc/email-certificate - Email NOC certificate to student (Faculty/Admin)

File Management Routes (/api/noc):

  • GET /api/noc/download/:filename - Download uploaded document
  • GET /api/noc/view/:filename - View document in browser

System Routes:

  • GET /api/health - Health check endpoint for monitoring

Note: Most routes require JWT authentication via Bearer token. Role-based routes enforce specific user roles.

🛠️ Installation & Setup

Prerequisites

  • Node.js (v14 or higher) - Download
  • MongoDB (v4.4 or higher) - Download or use MongoDB Atlas (recommended)
  • npm or yarn package manager
  • Git for version control

Quick Start (Automated Setup)

The system includes an automated setup script that configures everything for you:

  1. Clone the repository:
git clone <repository-url>
cd digital-noc-system
  1. Run automated setup:
node setup.js

This script will:

  • Create the .env file for backend
  • Set default configuration values
  • Display setup instructions
  1. Install all dependencies:
# Install backend dependencies
cd backend && npm install

# Install frontend dependencies
cd ../frontend && npm install
  1. Configure MongoDB (Choose one option):

Option A - MongoDB Atlas (Recommended for Cloud):

  • Sign up at MongoDB Atlas
  • Create a free M0 cluster
  • Get your connection string
  • Update backend/.env:
MONGODB_URI=mongodb+srv://username:password@cluster.xxxxx.mongodb.net/noc_management

Option B - Local MongoDB:

  • Install MongoDB Community Server
  • Start MongoDB service
  • Use default connection: mongodb://localhost:27017/noc_management
  1. Start the application:
# Terminal 1 - Start Backend
cd backend
npm run dev

# Terminal 2 - Start Frontend
cd frontend
npm start

Manual Setup

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Install dependencies:
npm install
  1. Create .env file:
cp env.example .env
  1. Configure environment variables in .env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/noc_management
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
NODE_ENV=development
FRONTEND_URL=http://localhost:3000
EMAIL_USER=your-email@gmail.com (optional, for email features)
EMAIL_PASS=your-app-password (optional, for email features)
  1. Start backend server:
# Development mode with auto-reload
npm run dev

# Production mode
npm start

Backend API will be available at http://localhost:5000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start development server:
npm start

Frontend application will be available at http://localhost:3000

Verify Installation

  1. Backend Health Check: Visit http://localhost:5000/api/health

    • Should return: {"status": "OK", "message": "NOC Management API is running"}
  2. Frontend Access: Visit http://localhost:3000

    • Should display the landing page
  3. Create First Account: Click "Get Started" or "Sign Up" to create your first user account

🎯 Target Users

  • Students: Submit NOC requests for various academic activities
  • Faculty: Review and approve/reject student requests
  • Administrators: Manage the entire NOC workflow

🔧 Development

Backend Development

cd backend
npm run dev  # Starts with nodemon for auto-restart

Frontend Development

cd frontend
npm start    # Starts React development server

Database

Make sure MongoDB is running on your system. The application will automatically create the necessary collections.

📱 Advanced Features

🎨 Modern UI Components

  • Landing Page: Animated hero section with live statistics
  • Interactive Dashboard: Real-time data updates and visualizations
  • Certificate Generator: Professional NOC certificate with PDF export
  • File Preview: In-browser document viewing (PDF, images)
  • Progress Indicators: Loading states and animations
  • Responsive Design: Optimized for desktop, tablet, and mobile
  • Shadcn/UI Components: Beautiful, accessible UI components
  • Animated Elements: Particle fields, counters, interactive globe

🤖 Intelligent Priority System

The system includes an AI-based priority calculator that analyzes:

  • Title Quality: Length, formatting, professional language
  • Description Quality: Word count, sentence structure, completeness
  • Urgency Keywords: Detects time-sensitive language
  • Purpose Category: Weights based on request type
  • Overall Quality Score: Comprehensive scoring (0-100)

Priority levels automatically assigned:

  • High Priority (70+ points): Urgent, well-documented requests
  • Medium Priority (40-69 points): Standard requests
  • Low Priority (0-39 points): Incomplete or non-urgent requests

📄 Certificate Management

  • Auto-Generation: Professional certificates for approved NOCs
  • PDF Export: High-quality PDF download with formatting
  • Print Support: Direct printing from browser
  • Email Delivery: Send certificates directly to student email
  • Certificate ID: Unique identifier for verification
  • Custom Branding: Institution logo and signature support

📁 File Management

  • Multiple Uploads: Attach multiple documents per request
  • Supported Formats: PDF, JPG, PNG, GIF
  • File Size Limit: 5MB per file
  • Secure Storage: Files stored in organized directory structure
  • Preview & Download: View documents in-browser or download
  • File Metadata: Track upload time and original filenames

📊 Analytics & Reporting

  • Real-time Statistics: Live dashboard metrics
  • Status Distribution: Visual breakdown of request statuses
  • Department Analytics: Performance by department
  • Trend Analysis: Request patterns over time
  • Success Rate Tracking: Approval/rejection ratios
  • Recent Activity: Last 7 days activity monitoring

For Students

  • ✅ Create and submit NOC requests with attachments
  • ✅ Real-time status tracking (Pending → Under Review → Approved/Rejected)
  • ✅ View complete request history with filters
  • ✅ Download approved certificates as PDF
  • ✅ Print certificates directly
  • ✅ Upload supporting documents (multiple files)
  • ✅ View uploaded document previews
  • ✅ Update profile information
  • ✅ Track priority levels of requests
  • ✅ Mobile-responsive dashboard

For Faculty

  • ✅ Review all submitted NOC requests
  • ✅ Approve or reject with detailed comments
  • ✅ Priority-based request sorting
  • ✅ Filter by status, department, date
  • ✅ View detailed student information
  • ✅ Generate official certificates
  • ✅ Email certificates to students
  • ✅ View analytics dashboard with charts
  • ✅ Download/view student attachments
  • ✅ Bulk operations support
  • ✅ Statistics overview

For Administrators

  • ✅ Full system access and management
  • ✅ Advanced priority analysis tools
  • ✅ User management capabilities
  • ✅ Delete and archive requests
  • ✅ System-wide analytics and reports
  • ✅ Configuration and settings
  • ✅ Detailed priority breakdown per request
  • ✅ Performance monitoring
  • ✅ Data export capabilities

🔒 Security Features

  • JWT Authentication: Secure token-based authentication with expiration
  • Password Security: Bcrypt hashing with 12-round salting
  • Input Validation: Express-validator for all user inputs
  • Rate Limiting: 100 requests per 15-minute window per IP
  • CORS Protection: Configured for specific frontend origin
  • Helmet.js: Security headers (XSS, clickjacking, etc.)
  • File Upload Security: File type and size validation
  • SQL Injection Protection: Mongoose ODM with parameterized queries
  • XSS Prevention: Input sanitization on both client and server
  • HTTPS Support: Production-ready SSL/TLS configuration
  • Role-Based Access: Middleware enforcement for protected routes
  • Session Management: Secure token storage and refresh
  • MongoDB Security: Connection string encryption, auth required

🎨 UI/UX Features

Design & Aesthetics

  • Modern Interface: Clean, professional design with Tailwind CSS
  • Responsive Layout: Mobile-first design, works on all devices
  • Shadcn/UI Components: Premium, accessible component library
  • Dark Mode Ready: Prepared for dark theme implementation
  • Consistent Styling: Design system with reusable components
  • Professional Typography: Clear hierarchy and readability

User Experience

  • Intuitive Navigation: Clear menu structure with role-based items
  • Real-time Feedback: Toast notifications and status updates
  • Loading States: Skeleton screens and spinners
  • Error Handling: User-friendly error messages
  • Form Validation: Real-time validation with helpful hints
  • Smooth Animations: Transitions and micro-interactions
  • Progress Indicators: Step-by-step process visualization
  • Search & Filter: Quick access to relevant information
  • Keyboard Navigation: Accessibility support
  • Auto-save Draft: Prevents data loss during form filling

Visual Elements

  • Status Badges: Color-coded request statuses
  • Priority Indicators: Visual priority levels
  • Avatar System: User profile pictures support
  • Icon Library: Lucide React icons throughout
  • Charts & Graphs: Recharts for data visualization
  • Document Previews: In-app file viewing
  • Interactive Landing: Animated hero and statistics

📂 Project Structure

digital-noc-system/
├── backend/
│   ├── middleware/
│   │   └── auth.js                 # Authentication middleware
│   ├── models/
│   │   ├── User.js                 # User schema
│   │   └── NocRequest.js           # NOC request schema
│   ├── routes/
│   │   ├── auth.js                 # Authentication routes
│   │   └── noc.js                  # NOC management routes
│   ├── utils/
│   │   └── priorityCalculator.js  # Priority algorithm
│   ├── uploads/
│   │   └── noc-documents/          # File storage
│   ├── .env                        # Environment variables
│   ├── env.example                 # Environment template
│   ├── server.js                   # Express server
│   └── package.json
├── frontend/
│   ├── public/
│   │   └── index.html
│   ├── src/
│   │   ├── components/
│   │   │   ├── ui/                 # Shadcn UI components
│   │   │   ├── AnimatedCounter.js
│   │   │   ├── CertificateGenerator.js
│   │   │   ├── NOCCertificate.js
│   │   │   ├── LoadingSpinner.js
│   │   │   ├── Navbar.js
│   │   │   ├── ParticleField.js
│   │   │   ├── InteractiveGlobe.js
│   │   │   └── ...
│   │   ├── contexts/
│   │   │   └── AuthContext.js      # Global auth state
│   │   ├── pages/
│   │   │   ├── LandingPage.js
│   │   │   ├── Login.js
│   │   │   ├── Signup.js
│   │   │   ├── Dashboard.js
│   │   │   ├── AdminDashboard.js
│   │   │   ├── CreateNOC.js
│   │   │   ├── NOCDetails.js
│   │   │   └── Profile.js
│   │   ├── lib/
│   │   │   └── utils.js            # Utility functions
│   │   ├── App.js                  # Main app component
│   │   ├── index.js                # Entry point
│   │   └── index.css               # Global styles
│   ├── components.json             # Shadcn config
│   ├── tailwind.config.js
│   └── package.json
├── setup.js                        # Automated setup script
├── README.md                       # This file
├── SETUP.md                        # Detailed setup guide
└── QUICK_START.md                  # Quick start guide

🚀 Current Status

✅ Implemented Features

  • ✅ Complete authentication system with JWT
  • ✅ Role-based access control (Student, Faculty, Admin)
  • ✅ NOC request creation with file uploads
  • ✅ Multi-file attachment support (PDF, images)
  • ✅ Intelligent priority calculation system
  • ✅ Request approval/rejection workflow
  • ✅ Professional certificate generation
  • ✅ PDF export and print functionality
  • ✅ Document viewing and downloading
  • ✅ Admin analytics dashboard
  • ✅ Real-time statistics
  • ✅ Responsive UI with Shadcn components
  • ✅ Modern landing page
  • ✅ Rate limiting and security features
  • ✅ MongoDB integration with indexes
  • ✅ Automated setup script

🔄 In Progress

  • 🔄 Email notification system (infrastructure ready)
  • 🔄 Advanced search with Elasticsearch
  • 🔄 Bulk operations for admins
  • 🔄 Activity log and audit trail

📈 Planned Enhancements

High Priority

  • 📧 Email Notifications: Automated emails for status changes
  • 📱 SMS Alerts: Critical update notifications via SMS
  • 🔍 Advanced Search: Full-text search with filters
  • 📊 Enhanced Reports: Exportable reports in multiple formats
  • 🔔 Push Notifications: Real-time browser notifications
  • 📅 Calendar Integration: Deadline tracking and reminders

Medium Priority

  • 🌙 Dark Mode: Complete dark theme implementation
  • 🌐 Internationalization: Multi-language support
  • 📱 Mobile App: Native iOS and Android applications
  • 🔗 API Webhooks: Integration with external systems
  • 📈 Advanced Analytics: ML-based insights and predictions
  • 💾 Data Export: Bulk export to CSV, Excel, PDF
  • 🔄 Automated Workflows: Rule-based approval routing

Future Considerations

  • 🤖 Chatbot Support: AI assistant for common queries
  • 🔐 SSO Integration: Single Sign-On with institutional systems
  • GraphQL API: Alternative to REST for complex queries
  • 🎓 LMS Integration: Connect with Learning Management Systems
  • 📸 Digital Signatures: Electronic signature support
  • 🔔 Approval Chains: Multi-level approval workflows
  • 📊 Business Intelligence: Advanced BI dashboard
  • 🌍 Public API: Third-party developer access

⚡ Performance Optimizations

  • Database Indexes: Optimized queries on frequently accessed fields
  • Pagination: Large datasets split into manageable pages
  • Image Optimization: Compressed file uploads
  • Code Splitting: React lazy loading for faster initial load
  • CDN Ready: Static assets ready for CDN deployment
  • Caching Strategy: Browser caching for static resources
  • MongoDB Connection Pooling: Efficient database connections
  • API Response Compression: Gzip compression enabled

🐛 Troubleshooting

Common Issues and Solutions

MongoDB Connection Failed

Error: connect ECONNREFUSED 127.0.0.1:27017

Solution:

  1. Ensure MongoDB is running: mongosh to verify
  2. Check MONGODB_URI in .env file
  3. For Atlas: Verify network access and connection string

Port Already in Use

Error: listen EADDRINUSE :::5000

Solution:

  1. Change PORT in .env file
  2. Kill existing process: lsof -ti:5000 | xargs kill (Mac/Linux)
  3. Windows: netstat -ano | findstr :5000 then taskkill /PID <PID> /F

CORS Errors

Access-Control-Allow-Origin header missing

Solution:

  1. Verify FRONTEND_URL in backend .env
  2. Check proxy setting in frontend package.json
  3. Restart both servers

File Upload Errors

Solution:

  1. Check file size (max 5MB)
  2. Verify file format (PDF, JPG, PNG, GIF only)
  3. Ensure uploads/noc-documents directory exists

JWT Token Errors

Solution:

  1. Set JWT_SECRET in .env (min 32 characters)
  2. Clear browser localStorage
  3. Re-login to get fresh token

🚀 Deployment

Production Checklist

Backend Deployment

  • Set NODE_ENV=production
  • Use strong JWT_SECRET (32+ characters)
  • Configure production MongoDB URI
  • Set up environment variables
  • Enable HTTPS/SSL
  • Configure proper CORS origins
  • Set up monitoring and logging
  • Use PM2 or similar process manager
  • Configure backup strategy
  • Set up error tracking (Sentry, etc.)

Frontend Deployment

  • Build production bundle: npm run build
  • Configure API endpoints
  • Enable CDN for static assets
  • Set up caching headers
  • Configure DNS and domain
  • Enable HTTPS/SSL
  • Test on multiple devices
  • Set up analytics (Google Analytics, etc.)

Deployment Platforms

Recommended Options:

  • Backend: Heroku, AWS EC2, DigitalOcean, Railway, Render
  • Frontend: Vercel, Netlify, AWS S3 + CloudFront, GitHub Pages
  • Database: MongoDB Atlas (recommended), AWS DocumentDB

Environment Variables for Production

# Backend (.env)
NODE_ENV=production
PORT=5000
MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/noc_management
JWT_SECRET=your_super_secure_secret_key_min_32_chars_long
FRONTEND_URL=https://your-frontend-domain.com
EMAIL_USER=noreply@yourdomain.com
EMAIL_PASS=your_email_app_password

📊 System Requirements

Development Environment

  • OS: Windows 10+, macOS 10.15+, or Linux (Ubuntu 20.04+)
  • RAM: Minimum 4GB, Recommended 8GB+
  • Storage: Minimum 500MB free space
  • Browser: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

Production Environment

  • Server: 2+ CPU cores, 4GB+ RAM
  • Node.js: v14+ (v16+ recommended)
  • MongoDB: v4.4+ (v5.0+ recommended)
  • Network: HTTPS enabled, 100Mbps+ bandwidth

📚 Additional Resources

  • Setup Guide: Detailed installation instructions
  • Quick Start: Get started in 5 minutes
  • API Documentation: Available at /api/health endpoint
  • MongoDB Indexes: Optimized for student, status, and date queries

🔧 Development Tips

Backend Development

# Enable debug mode
DEBUG=* npm run dev

# Test API endpoints
curl http://localhost:5000/api/health

# MongoDB shell access
mongosh mongodb://localhost:27017/noc_management

Frontend Development

# Clear cache and rebuild
rm -rf node_modules package-lock.json
npm install
npm start

# Build for production testing
npm run build
npx serve -s build

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/AmazingFeature
  3. Make your changes: Follow the existing code style
  4. Test thoroughly: Ensure all features work as expected
  5. Commit your changes: git commit -m 'Add some AmazingFeature'
  6. Push to branch: git push origin feature/AmazingFeature
  7. Open a Pull Request: Describe your changes in detail

Code Style Guidelines

  • Follow ESLint rules for JavaScript
  • Use meaningful variable and function names
  • Add comments for complex logic
  • Write clean, readable code
  • Test your changes before submitting

📄 License

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

🆘 Support & Contact

Getting Help

  • Documentation: Check README.md, SETUP.md, and QUICK_START.md
  • Issues: Create an issue on GitHub with detailed description
  • Questions: Use GitHub Discussions for general questions

Reporting Bugs

When reporting bugs, please include:

  • Operating system and version
  • Node.js and npm versions
  • MongoDB version
  • Steps to reproduce the issue
  • Error messages and logs
  • Screenshots if applicable

🎓 About

This Digital NOC Management System is designed to modernize and streamline the No Objection Certificate process in academic institutions. It replaces traditional paper-based workflows with a secure, efficient, and user-friendly digital platform.

Key Benefits

  • Faster Processing: Reduce approval time from days to hours
  • 📊 Better Tracking: Real-time status updates for all stakeholders
  • 🔒 Enhanced Security: Secure document storage and access control
  • 🌍 Accessibility: Access from anywhere, anytime
  • 📈 Data Insights: Analytics for informed decision-making
  • 💰 Cost Savings: Reduce paper, printing, and manual processing costs

Target Institutions

  • Universities and Colleges
  • Research Institutions
  • Training Centers
  • Corporate Learning Departments
  • Government Educational Bodies

Built with ❤️ for Academic Institutions

Making NOC management efficient, transparent, and accessible for everyone.

About

Full-stack NOC (No Objection Certificate) management system for academic institutions — role-based access for students, faculty & admins with JWT auth, PDF certificate generation, and analytics dashboard

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors