OK, now the server part 😉👍
For the server part you can just build a standard server project. You should build a new Maven server project. So if you are finished with the client project, just leave it like that... and build a new Maven server project.
For the server part you have some choices:
- Spring Boot webapp
- JakartaEE webapp with Tomcat / Jetty
- Quarkus, Micronaut
- PHP
- NodeJS
- ASP.NET
- ...
If you want to use Java and Spring Boot you can just build a new Maven Spring Boot project with Spring Initialzr:
https://start.spring.io
After that you need to take care of the communication between web browser client with GWT, which you've done before and the Spring Boot server part... remember this is a "remote call" since your web browser is on a different machine than your Spring Boot server.
Your choices:
Today everyone use REST but IMHO GWT RPC is very nice for Java developers.
Here you can see 3 Maven projects: "client", "api" and "server". So far you've done the "client" and now you need the "server" and "api" (also called "shared", because this project is shared between "client "and "server").
Using GWT RPC is actually quite the same. You also need api / shared and server but you will use standard Servlet GWT / RPC instead of REST JSON.
If you need the structure for GWT RPC with Spring Boot just tell me... I have no demo available, but could do this easily.
Or you also could use the Maven Archetype GWT Spring Boot from Frank:
https://github.com/NaluKit/gwt-maven-springboot-archetype to create the project structure for Spring Boot and GWT. Actually similar to my GWT Spring Boot example above but still different in how it works together...
That's a lot alternatives, ahh... I have to admit, that makes the introduction in GWT a bit difficult because of the alternatives...
My way was and is:
- Separate the client, api / shared and server as Maven projects / modules
- Build the server part completely independent of GWT like I showed above
- Build the communication between them with the alternatives above
- ... and always remember: the result of GWT transpiler is JavaScript, so you could always take the JavaScript with its resources and "copy" it to your server part, so it will be served from your server part.
- ... but still remember: JavaScript runs on web browser so you always have remote call to your server part.
Hope this helps,
Lofi