This project is a full-stack Employee Management System (EMS) built using Angular for the frontend and Spring Boot for the backend, with MySQL for data storage. It provides functionalities to manage employee records, such as creating, updating, viewing, and deleting employee details.
- Add new employees
- Update employee details
- View employee information
- Delete employee records
- Responsive and user-friendly interface
- Frontend: Angular, Bootstrap, HTML, CSS
- Backend: Spring Boot, Hibernate, JPA, MySQL
- Database: MySQL
- Build Tools: Maven
- Java: 17 or higher
- MySQL Server
- Maven
- Angular CLI: 15.2.11
- Node: 20.18.0
- Node Package Manager: npm 9.2.0
- OS: win32 x64
- Spring Tool Suite 4
-
Clone the repository:
git clone https://github.com/harshalk2022/EMS-Full-Stack-Application.git cd EMS-Full-Stack-Application
-
Configure the database:
- Open the
application.properties
file located in thesrc/main/resources
folder. - Update the following lines with your MySQL configuration:
# Database Configuration:MySQL spring.datasource.url=jdbc:mysql://localhost:3306/<your-database-name> spring.datasource.username=<your-username> spring.datasource.password=<your-password>
- Open the
-
Build and run the Spring Boot backend:
mvn clean install mvn spring-boot:run
The backend server will start at
http://localhost:8181
.
-
Navigate to the frontend directory:
cd ../EMS_Frontend
-
Install the dependencies:
npm install
-
Run the Angular application:
ng serve
The frontend will be available at
http://localhost:4200
.
- Ensure both the backend and frontend servers are running.
- Open a browser and go to
http://localhost:4200
to start using the EMS application.
The backend provides a RESTful API to interact with EMS. The base URL for all API endpoints is http://localhost:8080/api
.
-
Endpoint:
/employees
-
Method:
GET
-
Description: Fetches all employee records.
-
Response:
[ { "id": 1, "name": "Harshal Khndalkar", "email": "[email protected]", "role": "Engineer" }, { "id": 1, "name": "John Doe", "email": "[email protected]", "role": "Developer" } ]
-
Endpoint:
/employees/{id}
-
Method:
GET
-
Description: Fetches an employee by their ID.
-
Response:
{ "id": 1, "name": "John Doe", "email": "[email protected]", "role": "Developer" }
-
Endpoint:
/employees
-
Method:
POST
-
Description: Adds a new employee record.
-
Request Body:
{ "name": "Jane Smith", "email": "[email protected]", "role": "Manager" }
-
Response:
{ "id": 2, "name": "Jane Smith", "email": "[email protected]", "role": "Manager" }
-
Endpoint:
/employees/{id}
-
Method: PUT
-
Description: Updates an existing employee record.
-
Request Body:
{ "name": "Jane Smith", "email": "[email protected]", "role": "Senior Manager" }
-
- Endpoint:
/employees/{id}
- Method: DELETE
- Description: Deletes an employee by their ID.
Contributions are welcome! Feel free to fork the repository and submit a pull request with your enhancements.
This project is licensed under the MIT License.