Vaadin in Replit

Hi all!

I wanted to try using Vaadin in replit.com. Running a Spring Boot application there needs some tweaking, but I managed to make decent setup if you want to try it out. I used the Vaadin Flow and “Walking Skeleton” code and it seems run ok with the embedded database.

Here is the .replit configuration I used. Please note that in start.vaadin.com you can configure the package name:

compile = "mvn package"
run = "mvn spring-boot:run"
entrypoint = "src/main/java/com/example/Application.java"
hidden = ["**/*.class"]

[packager]
language = "java"

[packager.features]
packageSearch = true

[languages.java]
pattern = "**/*.java"

[languages.java.languageServer]
start = "jdt-language-server"

[unitTest]
language = "java"

[nix]
channel = "stable-22_11"

[debugger]
support = true

[debugger.compile]
command = "mvn package"

[debugger.interactive]
transport = "localhost:0"
connectTimeout = 60
startCommand = "java-debug"

[debugger.interactive.initializeMessage]
command = "initialize"
type = "request"

[debugger.interactive.initializeMessage.arguments]
adapterID = "cppdbg"
clientID = "replit"
clientName = "replit.com"
columnsStartAt1 = true
linesStartAt1 = true
locale = "en-us"
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true

[debugger.interactive.launchMessage]
command = "launch"
type = "request"

[debugger.interactive.launchMessage.arguments]
classPaths = ["."]
mainClass = "com.example.Application"

[deployment]
build = ["mvn", "install", "-P", "production"]
run = ["java", "-jar", "target/vaadin-app-*.jar", "com.example.Application"]
deploymentTarget = "cloudrun"

[[ports]]
localPort = 8080
externalPort = 80

To modify it you need to make sure the hidden files are visible.

In the background Replit uses NixOS based VM environment, which seems to give you pretty stable dev environment.

Not that all the features still work. For example the Preview (old Web view) is not always loading the application and gives some errors in console. Also Vaadin dev mode menu or Copilot is configured to work only in localhost, and does not show up in *.replit.dev virtual hosts.