You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,29 +30,33 @@ The framework provides support for the following features:
30
30
31
31
## How To Get Started
32
32
33
+
### Configuring Your Local Environment
34
+
There is an example configuration file in /src/main/resources called application-local.yml-example. By default this project's gradle bootRun command runs Spring using the "local" profile. So you can just copy that file to application-local.yml and replace the values (keys, URLs, etc..) with your values. If you are using a different profile to run (such as default) you will just need to ensure the same configs are in place in your active configuration file(s).
35
+
36
+
Missing or incorrect configuration values will make this framework not work correctly.
37
+
33
38
### Database
34
39
This framework uses a database as a user store. By buildling on top of Spring JPA it is easy to use which ever datastore you like. The example configuration in application.yml is for a [MariaDB](https://mariadb.com) 10.5 database. You will need to create a user and a database and configure the database name, username, and password.
35
40
36
41
You can do this using docker with a command like this:
The framework sends emails for verficiation links, forgot password flow, etc... so you need to configure the outbound SMTP server and authentication information.
47
55
48
56
### SSO OAuth2 with Google and Facebook
49
57
The framework supports SSO OAuth2 with Google and Facebook. To enable this you need to configure the client id and secret for each provider.
50
58
51
-
For local development you will need a public hostname and HTTPS enabled. You can use ngrok to create a public hostname and tunnel to your local machine. You can then use the ngrok hostname in your Google and Facebook developer console configuration.
52
-
53
-
There is an example configuration file in /src/main/resources called application-local.yml-example. By default this project's gradle bootRun command runs Spring using the "local" profile. So you can just copy that file to application-local.yml and replace the values (keys, URLs, etc..) with your values. If you are using a different profile to run (such as default) you will just need to ensure the same configs are in place in your active configuration file(s).
54
-
55
-
Missing or incorrect configuration values will make this framework not work correctly.
59
+
For public OAuth you will need a public hostname and HTTPS enabled. You can use ngrok to create a public hostname and tunnel to your local machine. You can then use the ngrok hostname in your Google and Facebook developer console configuration.
If you are running your local dev env using HTTPS or referencing it from a ngrok tunnel using HTTPS, you will need to make a few changes to get Live Reload to work. First you need to comment out the LiveReload HTTP line near the bottom of the index.html Thymeleaf template file. And uncomment the HTTPS line just below.
84
+
If you are running your local dev env using HTTPS or referencing it from a ngrok tunnel using HTTPS, you will need to make a few changes to get Live Reload to work. First you need to tell the application to use HTTPS by setting the following properties in your application.yml file:
85
+
86
+
```
87
+
spring.devtools.livereload.https=true
88
+
```
81
89
82
90
You then need to install mitmproxy and configure it to intercept the HTTPS traffic. You can do this by running the following command:
By default, mitmproxy uses self-signed SSL certificates, so you need to tell your browser to trust them before this will work. You can do this by opening https://localhost:35739/livereload.js in your browser and going through the steps to trust the server and certificate. Alternatively, you can configure mitmproxy to use real certificates and avoid this step. Follow these directions: https://docs.mitmproxy.org/stable/concepts-certificates/
96
+
By default, mitmproxy uses self-signed SSL certificates, so you need to tell your browser to trust them before this will work. You can do this by opening https://localhost:35739/livereload.js in your browser and going through the steps to trust the server and certificate.
97
+
98
+
Alternatively, you can configure mitmproxy to use real certificates and avoid this step. Follow these directions: https://docs.mitmproxy.org/stable/concepts-certificates/
87
99
88
100
## Notes
89
101
Much of this is based on the [Baeldung course on Spring Security](https://www.baeldung.com/learn-spring-security-course). If you want to learn more about Spring Security or would like to add SSO integration or 2FA to your application, that guide is a great place to start.
90
102
91
-
The codebase provides examples of different ways to serve and consume APIs. For instance, some APIs return a 200 response for all queries with a success flag and use status codes to convey success or failures. Others only use the 200 response for successful requests and use 409 or 500 for various error scenarios. The AJAX client JavaScript in the codebase also showcases different approaches, with some triggering redirects to new pages while others display messaging directly on the current page. These examples aim to demonstrate different implementation options depending on your preferences and requirements.
92
-
93
103
Please note that there is no warranty or guarantee of functionality, quality, performance, or security made by the author. The code is available freely, but you assume all responsibility and liability for its usage in your application.
<!-- Uncomment this line if you are running with HTTPS, and refer to my blog post here: https://www.digitalsanctuary.com/java/how-to-get-springboot-livereload-working-over-https.html -->
0 commit comments