A full-stack web application for managing employees and related company data. It includes a React frontend, a Spring Boot REST API, JWT authentication, and an in-memory H2 database.
- User registration and login
- JWT-based authentication
- Employee management
- Country, state, district, and language management
- Search and pagination
- Image upload
- CSV export
- Responsive React interface
- H2 database console for development
- React 19
- TypeScript
- Vite
- React Router
- Axios
- Bootstrap
- React Three Fiber
- Java 17
- Spring Boot 3
- Spring Web
- Spring Data JPA
- Spring Security
- JWT
- Maven
- H2 in-memory database
No MySQL installation or database setup is required.
Company-Employee-Management-System/
|-- Backend/
| |-- src/main/java/ # Controllers, services, entities, and repositories
| |-- src/main/resources/ # Spring Boot configuration
| |-- pom.xml # Backend dependencies
| `-- mvnw.cmd # Maven wrapper for Windows
|-- Frontend/
| |-- src/ # React application source
| |-- public/ # Static files
| `-- package.json # Frontend dependencies and scripts
`-- README.md
Install the following tools:
- Java Development Kit (JDK) 17 or newer
- Node.js 20 or newer
- npm
Maven does not need to be installed separately because the project includes the Maven wrapper.
Check the installed versions:
java -version
node --version
npm --versionThe backend and frontend must run in separate terminals.
Open PowerShell in the project folder:
cd Backend
.\mvnw.cmd spring-boot:runWait until the terminal reports that the application has started.
The backend is available at:
http://localhost:8080
Open another PowerShell terminal in the project folder:
cd Frontend
npm install
npm run devOpen the URL displayed by Vite:
http://localhost:5173
npm install is normally required only the first time or after dependencies
change.
- Open
http://localhost:5173. - Select Register and create an account.
- Sign in with the registered email and password.
- Use the navigation menu to access the protected pages.
- The JWT token is stored in browser local storage and included automatically in API requests.
The application uses an in-memory H2 database. While the backend is running, open:
http://localhost:8080/h2-console
Use these connection details:
| Field | Value |
|---|---|
| Driver Class | org.h2.Driver |
| JDBC URL | jdbc:h2:mem:employee_db |
| User Name | sa |
| Password | Leave blank |
Click Connect to view the tables and data.
The database is stored in memory. Its data is deleted when the backend stops.
Base URL:
http://localhost:8080
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register a user |
| POST | /auth/login |
Log in and receive a JWT |
| Method | Endpoint | Description |
|---|---|---|
| POST | /employees/add |
Add an employee |
| GET | /employees/all |
Get all employees |
| PUT | /employees/update/{id} |
Update an employee |
| DELETE | /employees/delete/{id} |
Delete an employee |
| Resource | Base endpoint |
|---|---|
| Languages | /language |
| States | /states |
| Districts | /district |
| Customers | /customers |
| Students | /students |
| Employee dropdown data | /employeesddl |
These resources provide create, read, update, and delete endpoints. See the
controller classes in Backend/src/main/java/com/nt/controler for the complete
route list and request formats.
cd Backend
.\mvnw.cmd testcd Frontend
npm run lint
npm run buildcd Backend
.\mvnw.cmd clean packageThe generated JAR file will be placed in Backend/target.
cd Frontend
npm run buildThe production frontend files will be placed in Frontend/dist.
Backend settings are stored in:
Backend/src/main/resources/application.properties
Frontend API settings are stored in:
Frontend/src/api/axiosConfig.ts
The frontend currently sends API requests to:
http://localhost:8080
The backend allows browser requests from:
http://localhost:5173
Update both configurations if either port or host changes.
Stop the program using port 8080, or add another port to
application.properties:
server.port=8081Then update the frontend API URL in Frontend/src/api/axiosConfig.ts.
Vite may automatically choose another port. If that happens, update the allowed
origin in Backend/src/main/java/com/nt/config/SecurityConfig.java.
Confirm that:
- The backend is running on
http://localhost:8080. - The frontend API base URL is correct.
- The browser origin is allowed by the backend CORS configuration.
This is expected because H2 is configured as an in-memory database. Use a file-based H2 URL or another database if permanent storage is required.
Press Ctrl+C in both terminals to stop the frontend and backend.
This project is intended for learning and development purposes.