A robust, enterprise-grade shift management application built with Java EE technologies, designed to streamline employee scheduling, shift tracking, and workforce management operations. This system provides role-based access control, real-time notifications, and comprehensive shift management capabilities for organizations of all sizes.
- Features
- System Architecture
- Technology Stack
- Prerequisites
- Installation & Setup
- Database Configuration
- Deployment
- Usage Guide
- API Documentation
- Project Structure
- Security Considerations
- Contributing
- Troubleshooting
- License
-
Role-Based Access Control (RBAC)
- Admin and Employee role separation
- Secure authentication and authorization
- Session management with filters
-
Comprehensive Shift Management
- Create, read, update, and delete (CRUD) operations for shifts
- Real-time shift status tracking (active, updated, deleted)
- Shift conflict detection and validation
- DateTime-based shift scheduling
-
User Management
- User registration and authentication
- Secure password hashing (SHA-256)
- User profile management
- Employee directory
-
Notification System
- Real-time notifications for shift changes
- Employee-specific notification feed
- Timestamp tracking for all notifications
- Complete shift oversight across all employees
- Employee management and administration
- Shift assignment and reassignment
- System-wide reporting and analytics
- User role management
- View personal shift schedule
- Receive notifications for shift updates
- Track shift history
- Profile management
RotaCore follows the Model-View-Controller (MVC) architectural pattern with a clear separation of concerns:
βββββββββββββββ
β Client β (Browser - JSP Views)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Servlets β (Controllers - Business Logic)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β DAO β (Data Access Layer)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Models β (Entity Classes)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β MySQL DB β (Persistent Storage)
βββββββββββββββ
- Presentation Layer - JSP pages with CSS/JavaScript
- Controller Layer - Servlets handling HTTP requests
- Service Layer - Business logic and validation
- Data Access Layer (DAO) - Database operations
- Model Layer - POJOs representing domain entities
- Utility Layer - Database connections and helpers
- Java EE 8+ - Core application framework
- Servlets 4.0 - Request handling and routing
- JSP 2.3 - Server-side rendering
- JDBC - Database connectivity
- HTML5 - Semantic markup
- CSS3 - Responsive styling
- JavaScript (ES6+) - Client-side interactivity
- MySQL 8.0+ - Relational database management
- Apache Tomcat 9.0+ - Servlet container
- Eclipse/IntelliJ IDEA - Development environment
- Maven/Gradle (optional) - Dependency management
Before setting up RotaCore, ensure you have the following installed:
-
Java Development Kit (JDK) 8 or higher
java -version # Should output: java version "1.8.0" or higher -
Apache Tomcat 9.0+
- Download from: https://tomcat.apache.org/download-90.cgi
-
MySQL Server 8.0+
mysql --version # Should output: mysql Ver 8.0.x -
MySQL Workbench (Optional but recommended)
- For database visualization and management
-
Eclipse IDE for Enterprise Java Developers or IntelliJ IDEA Ultimate
- With Java EE/Jakarta EE support
git clone https://github.com/yourusername/RotaCore.git
cd RotaCore/Rota-Core-
Start MySQL Server
# Windows net start MySQL80 # Linux/Mac sudo systemctl start mysql
-
Create Database and Tables
mysql -u root -p < db.sqlOr manually execute the SQL script:
mysql -u root -p
source /path/to/RotaCore/Rota-Core/db.sql;
-
Verify Database Setup
USE shift_manager; SHOW TABLES; -- Should display: users, shifts, notifications
Update the database credentials in src/main/java/com/shiftmanager/util/DBConnection.java:
private static final String URL = "jdbc:mysql://localhost:3306/shift_manager";
private static final String USERNAME = "root"; // Your MySQL username
private static final String PASSWORD = "yourpassword"; // Your MySQL password- Open Eclipse IDE
- File β Import β Existing Projects into Workspace
- Select the
Rota-Coredirectory - Click Finish
- Open IntelliJ IDEA
- File β Open
- Select the
Rota-Coredirectory - Configure Tomcat server in Run β Edit Configurations
-
In Eclipse:
- Window β Preferences β Server β Runtime Environments
- Click Add β Select Apache Tomcat v9.0
- Browse to your Tomcat installation directory
- Click Finish
-
Add Server to Project:
- Right-click on project β Run As β Run on Server
- Select configured Tomcat server
- Click Finish
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(64) NOT NULL, -- SHA-256 hash
role ENUM('employee', 'admin') NOT NULL
);CREATE TABLE shifts (
id INT AUTO_INCREMENT PRIMARY KEY,
employee_id INT NOT NULL,
start_time DATETIME NOT NULL,
end_time DATETIME NOT NULL,
status ENUM('active', 'updated', 'deleted') DEFAULT 'active',
FOREIGN KEY (employee_id) REFERENCES users(id)
);CREATE TABLE notifications (
id INT AUTO_INCREMENT PRIMARY KEY,
employee_id INT NOT NULL,
message TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (employee_id) REFERENCES users(id)
);After running db.sql, manually insert the admin account:
INSERT INTO users (name, email, password, role)
VALUES ('Admin', 'admin@abhishek.com',
SHA2('admin', 256), 'admin');Default Credentials:
- Email: admin@abhishek.com
- Password: admin
- Role: Admin
β οΈ Security Warning: Change the default admin password immediately after first login in a production environment.
-
Build the Project
- In Eclipse: Project β Clean β Build Project
- Ensure no compilation errors
-
Deploy to Tomcat
- Right-click project β Run As β Run on Server
- Select Tomcat server
- Application will be deployed automatically
-
Access the Application
http://localhost:8080/Rota-Core/
-
Build WAR File
- Right-click project β Export β WAR file
- Save as
shift-manager.war
-
Deploy to Tomcat
# Copy WAR to Tomcat webapps directory cp shift-manager.war /path/to/tomcat/webapps/ # Restart Tomcat ./bin/shutdown.sh ./bin/startup.sh
-
Update Database Connection
- Use production database credentials
- Enable SSL/TLS for database connections
- Configure connection pooling (recommended)
-
Access Production Application
http://your-domain.com:8080/shift-manager/
-
Login
- Navigate to application URL
- Use admin credentials
-
Dashboard Overview
- View all employees and their shifts
- Monitor shift statistics
- Access administrative functions
-
Create Shifts
- Click "Create Shift"
- Select employee
- Set start and end times
- Submit to create
-
Manage Shifts
- Update: Modify existing shift details
- Delete: Remove shifts (soft delete with status change)
- View History: Track shift modifications
-
Employee Management
- View employee directory
- Manage user roles
- Monitor employee schedules
-
Login
- Navigate to application URL
- Use employee credentials
-
View Shifts
- See assigned shifts
- Check upcoming schedule
- Review shift history
-
Notifications
- Receive alerts for shift changes
- View notification feed
- Track important updates
-
POST
/login- User authentication- Parameters:
email,password - Returns: Session with user object
- Parameters:
-
GET
/logout- User logout- Clears session
- Redirects to login page
-
POST
/register- New user registration- Parameters:
name,email,password,role
- Parameters:
-
POST
/createShift- Create new shift- Parameters:
employeeId,startTime,endTime - Access: Admin only
- Parameters:
-
POST
/updateShift- Update existing shift- Parameters:
shiftId,startTime,endTime - Access: Admin only
- Parameters:
-
POST
/deleteShift- Delete shift (soft delete)- Parameters:
shiftId - Access: Admin only
- Parameters:
Rota-Core/
β
βββ src/
β βββ main/
β βββ java/
β β βββ com/
β β βββ shiftmanager/
β β βββ dao/ # Data Access Objects
β β β βββ NotificationDAO.java
β β β βββ ShiftDAO.java
β β β βββ UserDAO.java
β β β
β β βββ model/ # Entity Models
β β β βββ Notification.java
β β β βββ Shift.java
β β β βββ User.java
β β β
β β βββ servlet/ # Controllers
β β β βββ AuthFilter.java
β β β βββ CreateShiftServlet.java
β β β βββ DeleteShiftServlet.java
β β β βββ LoginServlet.java
β β β βββ LogoutServlet.java
β β β βββ RegisterServlet.java
β β β βββ UpdateShiftServlet.java
β β β
β β βββ util/ # Utilities
β β βββ DBConnection.java
β β
β βββ webapp/ # Web Resources
β βββ WEB-INF/
β β βββ web.xml # Deployment Descriptor
β β
β βββ css/ # Stylesheets
β βββ js/ # JavaScript
β β
β βββ admin.jsp # Admin Dashboard
β βββ employee.jsp # Employee Dashboard
β βββ index.jsp # Landing Page
β βββ login.jsp # Login Page
β βββ register.jsp # Registration Page
β βββ error.jsp # Error Page
β
βββ build/ # Compiled Classes
βββ db.sql # Database Schema
βββ .classpath # Eclipse Classpath
βββ .project # Eclipse Project File
βββ README.md # This File
-
Password Security
- SHA-256 hashing for password storage
- No plain-text passwords in database
-
Authentication Filter
AuthFilter.javaprotects restricted pages- Session validation on every request
- Automatic redirect to login for unauthorized access
-
SQL Injection Prevention
- PreparedStatements for all database queries
- Input validation and sanitization
-
Role-Based Access Control
- Separate admin and employee roles
- Permission checks before sensitive operations
-
Upgrade Password Hashing
// Consider using BCrypt or Argon2 instead of SHA-256 // SHA-256 is cryptographic but not designed for passwords
-
Implement HTTPS
- Configure SSL/TLS certificates
- Force HTTPS for all connections
-
Session Security
- Configure session timeout
- Implement CSRF tokens
- Use secure and httpOnly cookies
-
Input Validation
- Validate all user inputs on server-side
- Implement CAPTCHA for registration/login
- Rate limiting for API endpoints
-
Database Security
- Use least-privilege database accounts
- Enable MySQL SSL connections
- Regular database backups
-
Logging & Monitoring
- Implement comprehensive logging
- Monitor for suspicious activities
- Set up alerts for security events
We welcome contributions to RotaCore! Follow these steps to contribute:
-
Fork the Repository
git clone https://github.com/yourusername/RotaCore.git
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Follow Java coding conventions
- Write meaningful commit messages
- Add comments for complex logic
-
Test Your Changes
- Ensure no existing functionality breaks
- Test with different user roles
- Verify database operations
-
Commit and Push
git add . git commit -m "feat: add your feature description" git push origin feature/your-feature-name
-
Submit Pull Request
- Provide detailed PR description
- Reference related issues
- Wait for code review
-
Java Naming Conventions
- Classes: PascalCase (
UserDAO) - Methods: camelCase (
getUserById()) - Constants: UPPER_SNAKE_CASE (
MAX_LOGIN_ATTEMPTS)
- Classes: PascalCase (
-
Code Documentation
- JavaDoc comments for all public methods
- Inline comments for complex logic
-
Database
- Use snake_case for table and column names
- Always define foreign key constraints
Error: java.sql.SQLException: Access denied for user
Solution:
- Verify MySQL is running:
net start MySQL80 - Check credentials in
DBConnection.java - Ensure database
shift_managerexists - Grant privileges:
GRANT ALL ON shift_manager.* TO 'user'@'localhost';
Error: Failed to deploy application
Solution:
- Clean Tomcat work directory:
tomcat/work/Catalina/localhost/ - Rebuild project: Project β Clean
- Check
web.xmlfor syntax errors - Verify servlet mappings
HTTP Status 404 - Not Found
Solution:
- Check file paths in servlet redirects
- Verify JSP files are in
webapp/directory - Ensure context path is correct
- Review
web.xmlservlet mappings
User logged out unexpectedly
Solution:
- Check
AuthFilterconfiguration - Verify session timeout settings in
web.xml - Ensure cookies are enabled in browser
- Review session handling in servlets
Login failed with correct credentials
Solution:
- Verify password hashing algorithm matches (SHA-256)
- Check database password column length (64 chars for SHA-256)
- Re-insert admin user with correct hash:
INSERT INTO users VALUES (NULL, 'Admin', 'admin@abhishek.com', SHA2('admin', 256), 'admin');
- RESTful API for mobile integration
- Email notifications for shift changes
- Calendar view for shift visualization
- Export shifts to PDF/Excel
- Shift swap requests between employees
- Multi-location support
- Advanced reporting and analytics
- Two-factor authentication (2FA)
- Dark mode UI theme
- Internationalization (i18n) support
- Initial release
- Core shift management functionality
- Role-based access control
- Basic notification system
- Admin and employee dashboards
- Project Lead: Suraj Kumar
- Email: [Your Email]
- GitHub: @Suraj-kummar
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 Suraj Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- Apache Software Foundation for Tomcat
- Oracle for MySQL
- Eclipse Foundation for IDE
- All contributors and testers
For support, please:
- Open an issue on GitHub: Issues
- Email: surajsinha1115@gmail.com
- Documentation: Wiki
If you find this project useful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting new features
- π€ Contributing code