This options is great if you already have a JVM app running on your machine because it doesn't
require a separate instance to run Backdoor.
First, add the JAR dependency to your project:
<dependency>
<groupId>io.github.tanin47</groupId>
<artifactId>backdoor</artifactId>
<version>2.8.0</version>
</dependency>
Then, initialize Backdoor when your Java application starts:
var server = new BackdoorServerBuilder()
.addDatabaseConfig("postgres", "postgres://127.0.0.1:5432/backdoor_test", null, null)
.addDatabaseConfig("clickhouse", "jdbc:ch://localhost:8123", "backdoor", "test_ch")
.withPort(9999)
.withSecretKey("SbZlbmJIXh")
.addUser("test_user", "test_pass")
.addUser("another_user", "another_pass")
.build();
server.start();
Then, when your JVM application stops, make sure to stop Backdoor with:
server.stop();