A comprehensive web-based identity card management system for East Coast Railway employees, supporting both Gazetted and Non-Gazetted staff applications.
- Dual Application Types: Support for both Gazetted and Non-Gazetted employee applications
- Digital Form Submission: Complete online application forms with file uploads
- Real-time Status Tracking: Check application status with unique application numbers
- User Dashboard: Personalized dashboard for applicants
- Document Upload: Photo and signature upload functionality
- Family Member Details: Add family member information for ID cards
- Admin Panel: Comprehensive dashboard for application management
- Application Review: View, approve, or reject applications with reasons
- Bulk Operations: Generate and print multiple ID cards
- Advanced Filtering: Filter applications by date, status, and type
- Report Generation: Generate detailed reports in various formats
- Status Management: Manage application statuses (Pending, Approved, Rejected, Printing, Closed)
- ID Card Generation: Generate PDF ID cards with QR codes
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- PDFKit - PDF generation
- QRCode - QR code generation
- Multer - File upload handling
- HTML5/CSS3 - Structure and styling
- JavaScript (ES6+) - Client-side functionality
- Bootstrap 5 - Responsive UI framework
- DataTables - Advanced table functionality
- Flatpickr - Date picker
- QRCode Generator - Client-side QR codes
- Helmet - Security headers
- CORS - Cross-origin resource sharing
- Rate Limiting - API protection
- XSS Protection - Cross-site scripting prevention
- MongoDB Sanitization - NoSQL injection prevention
Before running this application, make sure you have the following installed:
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn package manager
git clone https://github.com/Sekhar03/I-CARD-SYSTEM.git
cd icard-systemnpm installCreate a .env file in the root directory:
# Server Configuration
PORT=3000
NODE_ENV=production
# Database Configuration
MONGO_URI=mongodb://localhost:27017/icard_db
# CORS Configuration
CORS_ORIGIN=http://localhost:3000
# Admin Credentials (Change these in production)
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin123
# File Upload Configuration
UPLOAD_PATH=./public/uploads
MAX_FILE_SIZE=5242880
# Security Configuration
SESSION_SECRET=your-super-secret-key-hereMake sure MongoDB is running on your system. The application will automatically create the necessary collections.
npm run devnpm startThe application will be available at http://localhost:3000
icard-system/
βββ controllers/ # API route handlers
β βββ adminController.js
β βββ formController.js
β βββ statusController.js
β βββ userController.js
βββ middleware/ # Custom middleware
β βββ upload.js
βββ models/ # Database models
β βββ EmployeeGaz.js
β βββ EmployeeNonGaz.js
βββ public/ # Static files
β βββ css/
β βββ fonts/
β βββ images/
β βββ js/
β βββ uploads/
β βββ *.html
βββ utils/ # Utility functions
β βββ generateIdCard.js
βββ server.js # Main server file
βββ package.json
βββ README.md
POST /api/admin/login- Admin authenticationGET /api/admin/applications- Get all applicationsGET /api/admin/gazetted- Get gazetted applicationsGET /api/admin/non-gazetted- Get non-gazetted applicationsPOST /api/admin/gazetted/:id/approve- Approve gazetted applicationPOST /api/admin/non-gazetted/:id/approve- Approve non-gazetted applicationPOST /api/admin/gazetted/:id/reject- Reject gazetted applicationPOST /api/admin/non-gazetted/:id/reject- Reject non-gazetted applicationGET /api/admin/generate-id-card/:id- Generate individual ID cardPOST /api/admin/generate-bulk-id-cards- Generate bulk ID cards
POST /api/forms/gazetted- Submit gazetted applicationPOST /api/forms/non-gazetted- Submit non-gazetted applicationGET /api/status/:applicationNo- Check application status
-
Access the Application
- Visit the application URL
- Choose between Gazetted or Non-Gazetted application
-
Fill Application Form
- Complete all required fields
- Upload photo and signature
- Add family member details if needed
-
Submit Application
- Review all information
- Submit the application
- Note your application number
-
Track Status
- Use the status page to check application progress
- Use your application number to track status
-
Login to Admin Panel
- Access
/adminroute - Use admin credentials
- Access
-
Review Applications
- View all applications in the dashboard
- Filter by status, date, or type
-
Process Applications
- Approve or reject applications
- Add rejection reasons if needed
- Generate ID cards for approved applications
-
Generate Reports
- Create custom reports
- Export data in various formats
- Generate bulk ID cards
- Input Validation: All user inputs are validated
- File Upload Security: Secure file upload with type and size restrictions
- XSS Protection: Cross-site scripting prevention
- NoSQL Injection Protection: MongoDB query sanitization
- Rate Limiting: API endpoint protection
- CORS Configuration: Controlled cross-origin access
- Application details (name, designation, department, etc.)
- Contact information
- Family member details
- File uploads (photo, signature)
- Application status and timestamps
- Similar structure to Gazetted model
- Additional fields specific to non-gazetted staff
- Custom validation rules
npm run devnpm install -g pm2
pm2 start server.js --name "icard-system"
pm2 startup
pm2 saveFROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]NODE_ENV=production
PORT=3000
MONGO_URI=mongodb://your-production-mongo-uri
CORS_ORIGIN=https://your-domain.com
ADMIN_USERNAME=your-admin-username
ADMIN_PASSWORD=your-secure-password
SESSION_SECRET=your-production-session-secret- Submit test applications
- Test admin functionality
- Verify ID card generation
- Test file uploads
- Check status tracking
Use tools like Postman or curl to test API endpoints:
# Test admin login
curl -X POST http://localhost:3000/api/admin/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin123"}'- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
- IT Centre/ECoR/Bhubaneswar - Initial work
- East Coast Railway for the project requirements
- Open source community for the libraries used
- Contributors and maintainers
- v1.0.0 - Initial release with basic functionality
- v1.1.0 - Added admin panel and bulk operations
- v1.2.0 - Enhanced security and performance improvements
- v1.3.0 - Added reporting and advanced filtering features
Note: This system is designed specifically for East Coast Railway requirements. Please ensure compliance with your organization's security policies before deployment.