A comprehensive web application for managing On-Duty (OD) requests in educational institutions. This system provides separate interfaces for students to submit OD requests and coordinators to manage and approve them.
- Submit OD Requests: Students can submit On-Duty requests with detailed information
- View Request Status: Track the status of submitted requests (Pending/Approved/Rejected)
- Slot Selection: Choose from available time slots for OD requests
- Real-time Updates: See immediate feedback on request submission
- Multi-gap Support: Automatically creates separate requests for multiple time periods
- Form Validation: Comprehensive input validation with auto-formatting
- Authentication: Secure login system with coordinator credentials
- Request Management: View, approve, and reject OD requests
- Excel Export: Download approved requests as Excel files
- Email Export: Send approved requests report via email with custom messages
- Real-time Status Updates: Instant feedback on actions taken
- React.js: Modern UI framework
- Tailwind CSS: Utility-first CSS framework for responsive design
- Axios: HTTP client for API calls
- React Router: Client-side routing
- Node.js: JavaScript runtime
- Express.js: Web application framework
- MongoDB: NoSQL database for data storage
- Mongoose: MongoDB object modeling tool
- Nodemailer: Email sending functionality
- ExcelJS: Excel file generation
- Express Session: Session management
- Bcrypt.js: Password hashing for security
- MongoDB: Primary database for storing requests and coordinator information
- Mongoose: ODM for MongoDB interactions
- Gmail SMTP: Email delivery service
- App Password Authentication: Secure Gmail integration
OD AUTOMATION/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ CoordinatorDashboard.js
β β β βββ CoordinatorLogin.js
β β β βββ EmailExportModal.js
β β β βββ LandingPage.js
β β β βββ ODRequestForm.js
β β β βββ StudentView.js
β β βββ App.js
β β βββ index.js
β βββ package.json
βββ server/ # Node.js backend
β βββ routes/ # API routes
β β βββ auth.js # Authentication routes
β β βββ export.js # Export functionality
β β βββ requests.js # Request management
β βββ models/ # Data models
β β βββ Coordinator.js # Coordinator model
β β βββ ODRequest.js # OD Request model
β βββ scripts/ # Initialization scripts
β βββ index.js # Server entry point
βββ package.json
βββ README.md
- Node.js (v14 or higher) - Download from nodejs.org
- MongoDB - Download from mongodb.com or use MongoDB Atlas
- Git - Download from git-scm.com
- Code Editor (VS Code recommended) - Download from code.visualstudio.com
- Download and run
setup.batfile - Start the application:
npm run dev - Open browser: http://localhost:3000
git clone https://github.com/vabbings/OD-AUTOMATION.git
cd OD-AUTOMATION# Install root dependencies
npm install
# Install client dependencies
cd client
npm install
cd ..Create a .env file in the root directory:
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/od-automation
PORT=5000
NODE_ENV=development
# Email Configuration (Optional)
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password# Create coordinator account
npm run init-db# Start both client and server
npm run dev
# Or start individually
npm run server # Backend only
npm run client # Frontend only# Kill existing processes
taskkill /f /im node.exe
# Or change port in .env
PORT=5001# Clear cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm installIf you get && command errors in PowerShell:
# Use separate commands
npm install
cd client
npm install
cd ..
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- URL: http://localhost:3000/coordinator/login
- Username:
amity@admin - Password:
admin123
The system uses Gmail SMTP for sending email reports. To configure:
- Create a Gmail account for the application
- Enable 2-factor authentication
- Generate an App Password
- Update the
.envfile with your credentials:
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password- Send approved OD requests as Excel attachments
- Custom email messages
- Professional HTML email templates
- Automatic report generation
POST /api/login- Coordinator loginPOST /api/logout- Coordinator logoutGET /api/check-auth- Check authentication status
GET /api/requests- Get all requests (Coordinator only)POST /api/requests- Submit new OD request (Public)PUT /api/requests/:id/approve- Approve request (Coordinator only)PUT /api/requests/:id/reject- Reject request (Coordinator only)
GET /api/export- Download Excel file (Coordinator only)POST /api/export-email- Send email with Excel attachment (Coordinator only)
Students can submit OD requests by:
- Filling out the request form with personal details
- Selecting date and time range for the OD
- System automatically calculates time gaps and creates separate requests
- Submitting the request for coordinator review
Coordinators can:
- View all pending, approved, and rejected requests
- Approve or reject requests with one click
- Export approved requests as Excel files
- Send approved requests via email with custom messages
- Generate Excel reports of approved requests
- Send reports via email with custom messages
- Professional email templates with attachments
- Secure Gmail authentication
- System automatically identifies time gaps within selected time range
- Creates separate requests for each time gap
- Supports multiple subject and faculty codes for multi-gap requests
- Session-based Authentication: Secure coordinator access
- Password Hashing: Bcrypt.js for secure password storage
- Input Validation: Server-side validation for all inputs
- Error Handling: Comprehensive error messages
- CORS Configuration: Secure cross-origin requests
The system uses MongoDB for data storage with the following collections:
- name: Student's full name
- enrollmentNumber: Student enrollment number
- subjectCode: Subject code for the OD
- facultyCode: Faculty code for the subject
- date: Date of the OD
- timeFrom: Start time of the OD
- timeTo: End time of the OD
- reason: Reason for the OD
- status: Request status (Pending/Approved/Rejected)
- createdAt: Timestamp of request creation
- username: Coordinator username
- password: Hashed password
- createdAt: Timestamp of account creation
npm run dev# Build the React app
cd client
npm run build
# Start the server
npm run server- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
Vaibhav Singh
- GitHub: @vabbings
- Project: OD-AUTOMATION
If you encounter any issues or have questions:
- Check the existing issues
- Create a new issue with detailed information
- Contact the maintainer
Last Updated: August 2025 Version: 2.0.0