Skip to content

kaif77/spring-boot-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Security

A demonstration project for implementing security features using Spring Boot. This repository showcases how to integrate Spring Security with a Java backend, including database authentication and web security configurations.

Key Features

  • Spring Boot 2.7.x based project structure
  • Spring Security integration for authentication and authorization
  • JPA support for database operations
  • MySQL database connectivity (runtime)
  • Lombok for boilerplate code reduction
  • Maven Wrapper for easy project setup
  • Ready for further extension and real-world use

Requirements

  • Java 11 or later
  • Maven 3.6+
  • MySQL server

Getting Started

1. Clone the Repository

git clone https://github.com/kaif77/spring-boot-security.git
cd spring-boot-security

2. Configure the Database

Update your application.properties (typically placed in src/main/resources/) with your MySQL credentials and database information. For example:

spring.datasource.url=jdbc:mysql://localhost:3306/your_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update

3. Build the Project

You can use the included Maven Wrapper for a consistent build experience:

./mvnw clean install

Or, if Maven is installed globally:

mvn clean install

4. Run the Application

./mvnw spring-boot:run

or

mvn spring-boot:run

The application will start on http://localhost:8080.

Testing

JUnit 5 and Spring Boot Test are included for writing and running tests.

./mvnw test

Project Structure

  • src/main/java/com/kaif/SpringBootSecurity/ - Main application source code
  • src/test/java/com/kaif/SpringBootSecurity/ - Test cases
  • pom.xml - Project dependencies and build configuration

Dependencies

Key dependencies (see pom.xml for details):

  • spring-boot-starter-web
  • spring-boot-starter-security
  • spring-boot-starter-data-jpa
  • mysql-connector-j
  • lombok
  • Testing: spring-boot-starter-test, spring-security-test

Customization

  • Extend or replace the default security configuration to match your application's requirements.
  • Modify entity models and repositories as needed for your business logic.

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages