@@ -10,6 +10,37 @@ You can have an overview of our Spring Boot Server with the diagram below:
10
10
11
11
![ spring-boot-spring-security-postgresql-jwt-authentication-architecture] ( spring-boot-spring-security-postgresql-jwt-authentication-architecture.png )
12
12
13
+ ## Configure Spring Datasource, JPA, App properties
14
+ Open ` src/main/resources/application.properties `
15
+
16
+ ```
17
+ spring.datasource.url= jdbc:postgresql://localhost:5432/testdb
18
+ spring.datasource.username= postgres
19
+ spring.datasource.password= 123
20
+
21
+ spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true
22
+ spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect
23
+
24
+ # Hibernate ddl auto (create, create-drop, validate, update)
25
+ spring.jpa.hibernate.ddl-auto= update
26
+
27
+ # App Properties
28
+ bezkoder.app.jwtSecret= ======================BezKoder=Spring===========================
29
+ bezkoder.app.jwtExpirationMs= 86400000
30
+ ```
31
+
32
+ ## Run Spring Boot application
33
+ ```
34
+ mvn spring-boot:run
35
+ ```
36
+
37
+ ## Run following SQL insert statements
38
+ ```
39
+ INSERT INTO roles(name) VALUES('ROLE_USER');
40
+ INSERT INTO roles(name) VALUES('ROLE_MODERATOR');
41
+ INSERT INTO roles(name) VALUES('ROLE_ADMIN');
42
+ ```
43
+
13
44
For more detail, please visit:
14
45
> [ Spring Boot, Spring Security, PostgreSQL: JWT Authentication & Authorization example] ( https://bezkoder.com/spring-boot-security-postgresql-jwt-authentication/ )
15
46
@@ -30,8 +61,16 @@ For instruction: [Spring Boot Refresh Token with JWT example](https://bezkoder.c
30
61
31
62
> [ Spring Boot Repository Unit Test with @DataJpaTest ] ( https://bezkoder.com/spring-boot-unit-test-jpa-repo-datajpatest/ )
32
63
64
+ > [ Spring Boot Rest Controller Unit Test with @WebMvcTest ] ( https://www.bezkoder.com/spring-boot-webmvctest/ )
65
+
33
66
> [ Spring Boot Pagination & Sorting example] ( https://www.bezkoder.com/spring-boot-pagination-sorting-example/ )
34
67
68
+ > Validation: [ Spring Boot Validate Request Body] ( https://www.bezkoder.com/spring-boot-validate-request-body/ )
69
+
70
+ > Documentation: [ Spring Boot and Swagger 3 example] ( https://www.bezkoder.com/spring-boot-swagger-3/ )
71
+
72
+ > Caching: [ Spring Boot Redis Cache example] ( https://www.bezkoder.com/spring-boot-redis-cache-example/ )
73
+
35
74
Associations:
36
75
> [ Spring Boot One To Many example with Spring JPA, Hibernate] ( https://www.bezkoder.com/jpa-one-to-many/ )
37
76
@@ -55,6 +94,10 @@ Associations:
55
94
56
95
> [ Spring Boot + Angular 14 JWT Authentication] ( https://www.bezkoder.com/angular-14-spring-boot-jwt-auth/ )
57
96
97
+ > [ Spring Boot + Angular 15 JWT Authentication] ( https://www.bezkoder.com/angular-15-spring-boot-jwt-auth/ )
98
+
99
+ > [ Spring Boot + Angular 16 JWT Authentication] ( https://www.bezkoder.com/angular-16-spring-boot-jwt-auth/ )
100
+
58
101
> [ Spring Boot + React JWT Authentication] ( https://bezkoder.com/spring-boot-react-jwt-auth/ )
59
102
60
103
## Fullstack CRUD App
@@ -73,6 +116,10 @@ Associations:
73
116
74
117
> [ Angular 14 + Spring Boot + PostgreSQL example] ( https://www.bezkoder.com/spring-boot-angular-14-postgresql/ )
75
118
119
+ > [ Angular 15 + Spring Boot + PostgreSQL example] ( https://www.bezkoder.com/spring-boot-angular-15-postgresql/ )
120
+
121
+ > [ Angular 16 + Spring Boot + PostgreSQL example] ( https://www.bezkoder.com/spring-boot-angular-16-postgresql/ )
122
+
76
123
> [ React + Spring Boot + PostgreSQL example] ( https://bezkoder.com/spring-boot-react-postgresql/ )
77
124
78
125
Run both Back-end & Front-end in one place:
@@ -81,63 +128,3 @@ Run both Back-end & Front-end in one place:
81
128
> [ Integrate React.js with Spring Boot Rest API] ( https://bezkoder.com/integrate-reactjs-spring-boot/ )
82
129
83
130
> [ Integrate Vue.js with Spring Boot Rest API] ( https://bezkoder.com/integrate-vue-spring-boot/ )
84
-
85
- ## Dependency
86
- ``` xml
87
- <dependency >
88
- <groupId >org.springframework.boot</groupId >
89
- <artifactId >spring-boot-starter-data-jpa</artifactId >
90
- </dependency >
91
-
92
- <dependency >
93
- <groupId >org.springframework.boot</groupId >
94
- <artifactId >spring-boot-starter-security</artifactId >
95
- </dependency >
96
-
97
- <dependency >
98
- <groupId >org.springframework.boot</groupId >
99
- <artifactId >spring-boot-starter-web</artifactId >
100
- </dependency >
101
- <dependency >
102
- <groupId >org.postgresql</groupId >
103
- <artifactId >postgresql</artifactId >
104
- <scope >runtime</scope >
105
- </dependency >
106
-
107
- <dependency >
108
- <groupId >io.jsonwebtoken</groupId >
109
- <artifactId >jjwt</artifactId >
110
- <version >0.9.1</version >
111
- </dependency >
112
- ```
113
-
114
- ## Configure Spring Datasource, JPA, App properties
115
- Open ` src/main/resources/application.properties `
116
-
117
- ```
118
- spring.datasource.url= jdbc:postgresql://localhost:5432/testdb
119
- spring.datasource.username= postgres
120
- spring.datasource.password= 123
121
-
122
- spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true
123
- spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect
124
-
125
- # Hibernate ddl auto (create, create-drop, validate, update)
126
- spring.jpa.hibernate.ddl-auto= update
127
-
128
- # App Properties
129
- bezkoder.app.jwtSecret= bezKoderSecretKey
130
- bezkoder.app.jwtExpirationMs= 86400000
131
- ```
132
-
133
- ## Run Spring Boot application
134
- ```
135
- mvn spring-boot:run
136
- ```
137
-
138
- ## Run following SQL insert statements
139
- ```
140
- INSERT INTO roles(name) VALUES('ROLE_USER');
141
- INSERT INTO roles(name) VALUES('ROLE_MODERATOR');
142
- INSERT INTO roles(name) VALUES('ROLE_ADMIN');
143
- ```
0 commit comments