Skip to content

PawaseBB/Spring_Boot_Security_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring_Boot_Security_Project

Spring Boot Security Project Implimentation With Thymeleaf

This is a Spring Boot project that demonstrates how to set up authentication and authorization using Spring Security, along with other common dependencies like Maven, MySQL, Thymeleaf, and Spring Boot Web.

Table of Contents

Getting Started

This project serves as a foundation for implementing Spring Security in your web application. It provides a basic structure for user authentication and role-based access control.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Java Development Kit (JDK) 8 or higher
  • Apache Maven installed
  • MySQL database server
  • Your favorite Integrated Development Environment (IDE) or text editor

Installation

  1. Clone this repository to your local machine using:

    git clone https://github.com/your-username/spring-security-demo.git
  2. Create a MySQL database and update the database configuration in src/main/resources/application.properties:

    spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
    spring.datasource.username=your_username
    spring.datasource.password=your_password
  3. Build the project using Maven:

    mvn clean install

Configuration

  • Security configuration can be found in src/main/java/com/example/securitydemo/config/SecurityConfig.java. Modify this file to configure your security settings, such as custom login pages, access control, or authentication providers.

Database Setup

This project includes an SQL script to create the necessary database and schemas. Follow these steps to set up the database:

  1. Open your preferred MySQL client or command-line tool.

  2. Create a new database using the MySQL client or command-line:

    CREATE DATABASE your_database_name;
  3. Use the newly created database:

    USE your_database_name;
  4. Execute the SQL script provided in the project to create the required tables and schemas. You can find the script in Spring_Boot_Security_Project /Join_of_users_authorities.sql.

    Replace /path/to/your/project with the actual path to your project directory.

  5. EER Diagram For Tabels:

    EER-diagram
  6. Your database is now set up with the necessary tables and schemas for this project.

Make sure to update the spring.datasource.url, spring.datasource.username, and spring.datasource.password properties in the application.properties file with the correct database connection details.

For more advanced database configurations or if you encounter any issues, refer to the Spring Boot documentation on configuring databases.

Usage

  1. Run the application using Maven:

    mvn spring-boot:run
  2. Access the application in your web browser at http://localhost:8080.

  3. You can log in with the following default credentials:

    • Username: user
    • Password: password
  4. Explore the application and customize it to your needs. You can add more roles, users, and protected resources as required.

Contributing

Contributions are welcome! If you find any issues or have improvements to suggest, please open an issue or create a pull request on GitHub.

About

Spring Boot Security Project Implimentation With Thymeleaf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published