This is a simple web chat. It uses Spring MVC XML config, Hibernate, Thymeleaf, JPA, Spring Security, OAUTH 2.0, slf4j, log4j2, Lombok, MySQL, Jackson.
- Java 18+;
- I have
java 19.0.2
.
- I have
- MySQL server;
- No explicit database initialization is needed;
- Make sure you don't have anything important in db with name
springforum
.
- Run MySQL server:
Win+R -> mysqld --console
- Set
OAUTH_CLIENTID
andOAUTH_CLIENTSECRET
system environment variables;-
You can get them here: https://console.cloud.google.com/apis/credentials You may need this settings to create new OAuth 2.0 Client ID:
Authorized JavaScript origins
=http://localhost:8080
Authorized redirect URIs
=http://localhost:8080/login/oauth2/code/google
-
In Powershell syntax is:
$env:OAUTH_CLIENTSECRET = 'blablabla'
$env:OAUTH_CLIENTID = 'fake'
-
You can set those variables to random values, webapp will still work, but registration/login with Google wouldn't be available.
-
- In project's root directory execute:
mvn clean jetty:run
- Visit http://localhost:8080
- Login as
admin
qwerty
; - Post a new message;
- Click on your name in top right corner, change your name to anything else;
- Name under your existing message will be changed too;
- Create new user at http://localhost:8080/createUser
- Examine list of users at http://localhost:8080/users
- Logout and login with your google account.