Skip to content

Getting started

This page gets a service depending on the framework and starting. Read What the framework is first if you have not, and check Framework status for what is released.

Need For Notes
JDK 25 and Maven 3.9 (Java) building a Java service the build sets maven.compiler.release to 25
Go 1.27 (Go) building a Go service every framework go.mod says go 1.27
PostgreSQL running a service the only supported database system. Several named instances may be configured; use cases and migrations run on the default one
Docker (Java) tests, and generate / check of checked SQL Java tests start PostgreSQL 18 (and Redis) with Testcontainers; checked SQL starts a throwaway postgres:18-alpine unless you point it at an empty database
Redis or Valkey only the Redis lock, push and rate-limit drivers optional. Standalone only: no Cluster or Sentinel
A FlowCatalyst platform only the FlowCatalyst module optional: the module can be left out

Go tests need no Docker: fwtest starts an embedded PostgreSQL 18 per test binary and clones a database per test. Redis tests need redis-server or valkey-server on PATH; they fail rather than skip when it is missing.

The Java framework is published to GitHub Packages (https://maven.pkg.github.com/flowcatalyst/framework) by the publish workflow whenever a tag v<major>.<minor>.<patch> is pushed. The tag sets the version of every module, the BOM included. The latest release is 0.2.2. Use 0.1.1 or later: v0.1.0 is an incomplete upload and must not be used.

GitHub Packages asks for a token with read:packages for Maven reads, even for a public package. Add a github server to ~/.m2/settings.xml (never to the project):

<settings>
<servers>
<server>
<id>github</id>
<username>YOUR_GITHUB_USER</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>

and the repository to your pom.xml, for dependencies and for the checked-SQL plugin:

<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/flowcatalyst/framework</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>github</id>
<url>https://maven.pkg.github.com/flowcatalyst/framework</url>
</pluginRepository>
</pluginRepositories>

In GitHub Actions, actions/setup-java writes that server entry for you (server-id: github, server-username: GITHUB_ACTOR, server-password: GITHUB_TOKEN).

Import framework-bom. It manages the version of every framework module and of the libraries they are built and tested with (Jackson 3, Jetty, HikariCP, the PostgreSQL driver, JUnit, Testcontainers). An application needs no framework parent and no special compiler setup:

<properties>
<maven.compiler.release>25</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.flowcatalyst.framework</groupId>
<artifactId>framework-bom</artifactId>
<version>0.2.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Then list the modules you use, without versions, and the plugins (a BOM cannot manage plugin versions, so give the checked-SQL plugin the framework version yourself):

<dependencies>
<dependency>
<groupId>io.flowcatalyst.framework</groupId>
<artifactId>framework-usecase</artifactId> <!-- write path; brings framework-database and framework-core -->
</dependency>
<dependency>
<groupId>io.flowcatalyst.framework</groupId>
<artifactId>framework-http-jetty</artifactId> <!-- HTTP server; brings framework-http -->
</dependency>
<dependency>
<groupId>io.flowcatalyst.framework</groupId>
<artifactId>framework-flowcatalyst</artifactId> <!-- optional: platform client and sync -->
</dependency>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>
<!-- An application chooses its logging backend; the framework brings none. -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin><artifactId>maven-compiler-plugin</artifactId><version>3.16.0</version></plugin>
<plugin><artifactId>maven-surefire-plugin</artifactId><version>3.6.0</version></plugin>
</plugins>
</build>

The platform SDK dependency. framework-flowcatalyst depends on the FlowCatalyst Java SDK (io.flowcatalyst:flowcatalyst-sdk, version flowcatalyst-sdk.version in the BOM, currently 0.0.31). The SDK is not on Maven Central, and the framework does not publish it. From 0.0.30 it is published to the platform repository’s GitHub Packages Maven registry (https://maven.pkg.github.com/flowcatalyst/flowcatalyst; a token with read:packages): add that repository before resolving framework-flowcatalyst. An earlier version, or your own build, comes from the tag in the platform repository (java-sdk/v<version>, directory clients/java-sdk) with mvn install -DskipTests. The version must match the BOM’s. Modules that do not use the platform (framework-core, -database, -usecase, -http, …) do not need it.

The modules, and the class you list for each:

Artifact Module class you list Page
framework-core none; always present (lifecycle, config, Context, health) Modules and lifecycle
framework-database DatabaseModule Database and Redis
framework-redis RedisModule Database and Redis
framework-locks, -locks-database, -locks-redis LocksModule; LocksDatabaseModule (the fw_lock migration); DatabaseLockStores, RedisLockStores Locks
framework-objectstore, -objectstore-s3 ObjectStoresModule; S3ObjectStores Object stores
framework-usecase OutboxModule, UseCaseModule Write path
framework-client-settings ClientSettingsModule Client settings
framework-measure none; money and units Money and units
framework-http, framework-http-jetty none; JettyHttpModule HTTP
framework-httpclient, -httpclient-module none; HttpClientModule HTTP client
framework-ratelimit-redis none; RedisRateLimiter Rate limiting
framework-auth (+ -database, -redis) AuthModule Sessions and login
framework-admin AdminModule Admin
framework-push, framework-push-redis PushModule; RedisPushLogs Push
framework-flowcatalyst FlowCatalystModule FlowCatalyst module
framework-ui the server-rendered UI module UI
framework-sql, framework-sql-maven-plugin none; the checked-SQL generator and its plugin Checked SQL

Test fixtures are published as test-jar artifacts (<type>test-jar</type>, <scope>test</scope>) of framework-database, -redis, -locks and -flowcatalyst, and managed by the BOM. See Testing.

An application declares what it uses and then starts. Java lists modules on a builder; Go declares packages on an fw.App and builds the services in a build function. This is the framework’s own locks-demo (one lock store per driver, then a lock taken on each).

App app = App.builder()
.module(new DatabaseModule())
.module(new RedisModule())
.module(
LocksModule.builder()
.store("main", DatabaseLockStores.database())
.store("shared", RedisLockStores.redis("default", "fw:lock:"))
.store("local", LockStores.memory())
.defaultStore("main")
.build())
.module(new LocksDatabaseModule()) // the fw_lock migration
.start();
Locks locks = app.get(Locks.class);
WithLockResult<String> result = locks.get("main").withLock(
LockKey.service("locks-demo"), Duration.ofSeconds(10), Duration.ofSeconds(5),
lease -> "token " + lease.fencingToken());

For a main method use launch(args), which also runs a module’s command (such as migrate or sync) when the first argument names one, and otherwise starts normally:

switch (App.builder().module(/* ... */).launch(args)) {
case Launch.Ran ran -> System.exit(ran.exitCode());
case Launch.Started started -> started.app();
}

App is AutoCloseable; builder.shutdownHook(true) also closes it from a JVM shutdown hook.

Both read config/application.yaml (the Go directory is changed with fw.WithConfigDir). Every value can be overridden by the environment variable named after its path, for example DATABASE_INSTANCES_MAIN_URL. Keep the password out of the file: use DATABASE_INSTANCES_MAIN_PASSWORD or an uncommitted config/secrets.local.yaml. The minimum for a development database is:

database:
default: main
instances:
main:
url: jdbc:postgresql://localhost:5432/app
username: app
pool: { max: 10, min-idle: 1, connect-timeout: 5s }
migrate: true

The same JDBC-style URL is used by both languages. Configuration sources, their order and the full rules are on Configuration.