A full-stack Employee Management System built with Spring Boot backend and React frontend, providing comprehensive employee data management capabilities with a modern, responsive user interface.
┌─────────────┐ ┌──────────────┐ ┌──────────────┐
│ │ │ Spring Boot │ │ MySQL │
│ Frontend │────▶│ Backend │────▶│ Database │
│ │ │ │ │ │
└─────────────┘ └──────────────┘ └──────────────┘
- Spring Boot 3.x
- Spring Security with JWT
- Spring Data JPA
- MySQL 8.x
- Maven
- Java 17
- HTML
- JavaScript
- Ajax
- Boostrap
- User Authentication & Authorization
- Employee CRUD Operations
- Profile Management
- Report Generation
- Responsive Design
- Role-based Access Control
- Search and Filter Capabilities
- JDK 17 or higher
- Node.js 18.x or higher
- MySQL 8.x
- Maven 3.6+
- npm or yarn
- Clone the Repository
git clone https://github.com/uchamod/Employee_Mangement_System-V2.git
cd employee-management/backend
- Configure Database
CREATE DATABASE emp_management;
- Update application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/emp_management
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
# JWT Configuration
jwt.secret=your_jwt_secret
jwt.expiration=86400000
- Run the Backend
mvn spring-boot:run
Navigate to Frontend Directory
cd ../frontend
POST /api/auth/login - Login
POST /api/auth/register - Register new user
POST /api/auth/refresh - Refresh token
GET /api/employees - Get all employees
POST /api/employees - Create employee
GET /api/employees/{id} - Get employee by ID
PUT /api/employees/{id} - Update employee
DELETE /api/employees/{id} - Delete employee
GET /api/departments - Get all departments
POST /api/departments - Create department
GET /api/departments/{id} - Get department
PUT /api/departments/{id} - Update department
DELETE /api/departments/{id} - Delete department
## Security
The application implements the following security measures:
- JWT-based authentication
- Password encryption using BCrypt
- Role-based authorization
- CORS configuration
- XSS protection
- CSRF protection
## Available Scripts
### Backend
```bash
mvn clean install - Build the project
mvn test - Run tests
mvn spring-boot:run - Run the application
## Docker Support
Build and run using Docker:
```bash
# Build images
docker-compose build
# Run services
docker-compose up
# Run unit tests
mvn test
# Run integration tests
mvn verify
- Build the JAR file:
mvn clean package
- Run the JAR:
java -jar target/employee-management-0.0.1-SNAPSHOT.jar
- Serve using nginx or other web server
Common issues and solutions:
-
Database Connection Issues
- Verify MySQL service is running
- Check database credentials
- Confirm database exists
-
Frontend API Connection Issues
- Verify backend is running
- Check CORS configuration
- Confirm API URL in environment variables
-
Authentication Issues
- Check JWT token expiration
- Verify credentials
- Clear browser cache/cookies
- Fork the repository
- Create a feature branch
- Commit changes
- Push to the branch
- Create Pull Request
-
Code Style
- Follow Java code conventions
- Use ESLint for JavaScript
- Write meaningful commit messages
-
Testing
- Write unit tests for new features
- Maintain minimum 80% code coverage
- Include integration tests for critical paths
-
Documentation
- Update README for new features
- Document API changes
- Include JSDoc comments
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please:
- Check the documentation
- Search existing issues
- Create a new issue if needed
- Spring Boot team
- Material-UI team
- Open source community
For more detailed information or support, please open an issue in the repository.