An open API service indexing awesome lists of open source software.

https://github.com/justshuv/springboot-employee-management-system-api

Build a secure employee management system with Spring Boot, JWT, and MySQL. Manage users effortlessly with CRUD operations and role-based access control. 🚀💻
https://github.com/justshuv/springboot-employee-management-system-api

ajax api authentication-backend authorization backend employee-management html java jsp maven mysql rest-api restapi security spring-boot spring-security springboot-rest-api-employee-management springframework

Last synced: 9 months ago
JSON representation

Build a secure employee management system with Spring Boot, JWT, and MySQL. Manage users effortlessly with CRUD operations and role-based access control. 🚀💻

Awesome Lists containing this project

README

          

# Spring Boot Employee Management System API

![Employee Management System](https://img.shields.io/badge/Employee%20Management%20System-API-brightgreen.svg)
![GitHub Release](https://img.shields.io/github/release/justshuv/springboot-employee-management-system-api.svg)

## Overview

This repository hosts a secure and scalable employee management system built using **Spring Boot**. The system leverages **Spring Security** for authentication, **JWT** for secure token-based authentication, **JPA** for database interactions, and **MySQL** as the database. This API allows you to manage employee data efficiently and securely.

## Table of Contents

- [Features](#features)
- [Technologies Used](#technologies-used)
- [Getting Started](#getting-started)
- [API Endpoints](#api-endpoints)
- [Authentication](#authentication)
- [Database Setup](#database-setup)
- [Running the Application](#running-the-application)
- [Contributing](#contributing)
- [License](#license)
- [Releases](#releases)

## Features

- **User Authentication**: Secure user login and registration.
- **Role-Based Access Control**: Different access levels for users and admins.
- **Employee CRUD Operations**: Create, Read, Update, and Delete employee records.
- **JWT Authentication**: Secure API endpoints using JWT tokens.
- **MySQL Integration**: Persistent storage of employee data.
- **RESTful API**: Easy integration with front-end applications.

## Technologies Used

- **Spring Boot**: Framework for building Java applications.
- **Spring Security**: Provides authentication and authorization.
- **JWT**: Token-based authentication mechanism.
- **JPA**: Java Persistence API for database interactions.
- **MySQL**: Relational database for data storage.
- **Maven**: Dependency management and build tool.

## Getting Started

To get started with the Employee Management System API, follow these steps:

1. Clone the repository:
```bash
git clone https://github.com/justshuv/springboot-employee-management-system-api.git
```

2. Navigate to the project directory:
```bash
cd springboot-employee-management-system-api
```

3. Configure your MySQL database. Update the `application.properties` file with your database credentials.

4. Build the project using Maven:
```bash
mvn clean install
```

5. Run the application:
```bash
mvn spring-boot:run
```

## API Endpoints

### Authentication

- **POST /api/auth/signup**: Register a new user.
- **POST /api/auth/login**: Log in and receive a JWT token.

### Employee Management

- **GET /api/employees**: Retrieve a list of all employees.
- **GET /api/employees/{id}**: Retrieve a specific employee by ID.
- **POST /api/employees**: Create a new employee record.
- **PUT /api/employees/{id}**: Update an existing employee record.
- **DELETE /api/employees/{id}**: Delete an employee record.

## Authentication

The API uses JWT for authentication. After logging in, you will receive a token. Include this token in the Authorization header for subsequent requests:

```
Authorization: Bearer
```

## Database Setup

1. Install MySQL on your machine.
2. Create a new database for the application:
```sql
CREATE DATABASE employee_management;
```
3. Update the `application.properties` file with your MySQL database details:
```properties
spring.datasource.url=jdbc:mysql://localhost:3306/employee_management
spring.datasource.username=your_username
spring.datasource.password=your_password
```

## Running the Application

To run the application, ensure that your MySQL server is running. Use the following command in your terminal:

```bash
mvn spring-boot:run
```

Once the application starts, you can access the API at `http://localhost:8080/api`.

## Contributing

Contributions are welcome! Please follow these steps to contribute:

1. Fork the repository.
2. Create a new branch:
```bash
git checkout -b feature/YourFeature
```
3. Make your changes and commit them:
```bash
git commit -m "Add some feature"
```
4. Push to the branch:
```bash
git push origin feature/YourFeature
```
5. Create a new Pull Request.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Releases

For the latest releases, visit the [Releases](https://github.com/justshuv/springboot-employee-management-system-api/releases) section. You can download and execute the latest version of the application from there.

![Releases](https://img.shields.io/badge/Download%20Latest%20Release-blue.svg)

Feel free to explore the code, suggest improvements, or report issues. Your feedback is valuable for enhancing this project!