Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OD Automation System

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.

πŸš€ Features

For Students

  • 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

For Coordinators

  • 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

πŸ› οΈ Tech Stack

Frontend

  • 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

Backend

  • 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

Database

  • MongoDB: Primary database for storing requests and coordinator information
  • Mongoose: ODM for MongoDB interactions

Email Service

  • Gmail SMTP: Email delivery service
  • App Password Authentication: Secure Gmail integration

πŸ“ Project Structure

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

πŸš€ Installation & Setup

Prerequisites

Quick Setup (Windows)

  1. Download and run setup.bat file
  2. Start the application: npm run dev
  3. Open browser: http://localhost:3000

Manual Setup

1. Clone the Repository

git clone https://github.com/vabbings/OD-AUTOMATION.git
cd OD-AUTOMATION

2. Install Dependencies

# Install root dependencies
npm install

# Install client dependencies
cd client
npm install
cd ..

3. Environment Configuration

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

4. Initialize Database

# Create coordinator account
npm run init-db

5. Start the Application

# Start both client and server
npm run dev

# Or start individually
npm run server    # Backend only
npm run client    # Frontend only

Troubleshooting

Port Already in Use

# Kill existing processes
taskkill /f /im node.exe

# Or change port in .env
PORT=5001

Dependencies Issues

# Clear cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

PowerShell Issues

If you get && command errors in PowerShell:

# Use separate commands
npm install
cd client
npm install
cd ..
npm run dev

🌐 Access the Application

πŸ” Authentication

Coordinator Login

πŸ“§ Email Configuration

The system uses Gmail SMTP for sending email reports. To configure:

  1. Create a Gmail account for the application
  2. Enable 2-factor authentication
  3. Generate an App Password
  4. Update the .env file with your credentials:
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password

Email Features

  • Send approved OD requests as Excel attachments
  • Custom email messages
  • Professional HTML email templates
  • Automatic report generation

πŸ“Š API Endpoints

Authentication

  • POST /api/login - Coordinator login
  • POST /api/logout - Coordinator logout
  • GET /api/check-auth - Check authentication status

Request Management

  • 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)

Export Features

  • GET /api/export - Download Excel file (Coordinator only)
  • POST /api/export-email - Send email with Excel attachment (Coordinator only)

🎯 Key Features Explained

1. Student Request Submission

Students can submit OD requests by:

  1. Filling out the request form with personal details
  2. Selecting date and time range for the OD
  3. System automatically calculates time gaps and creates separate requests
  4. Submitting the request for coordinator review

2. Coordinator Dashboard

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

3. Email Export System

  • Generate Excel reports of approved requests
  • Send reports via email with custom messages
  • Professional email templates with attachments
  • Secure Gmail authentication

4. Time Gap Calculation

  • 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

πŸ”’ Security Features

  • 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

πŸ“ˆ Data Storage

The system uses MongoDB for data storage with the following collections:

OD Requests Collection

  • 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

Coordinators Collection

  • username: Coordinator username
  • password: Hashed password
  • createdAt: Timestamp of account creation

πŸš€ Deployment

Development

npm run dev

Production

# Build the React app
cd client
npm run build

# Start the server
npm run server

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ License

This project is open source and available under the MIT License.

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

Vaibhav Singh

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the existing issues
  2. Create a new issue with detailed information
  3. Contact the maintainer

Last Updated: August 2025 Version: 2.0.0

About

OD Automation System 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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages