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.
Prerequisites
Section titled “Prerequisites”| 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.
Depend on the framework
Section titled “Depend on the framework”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.
The Go framework is a set of Go modules in the go/ directory of the framework repository, so
versions are tags with the directory as prefix, resolved by the Go module proxy:
| Module | Tag | Released | What it is |
|---|---|---|---|
github.com/flowcatalyst/framework/go |
go/vX.Y.Z |
v0.4.4 | the core: fw, config, database, usecase, httpfw, locks, push, auth, admin, and the rest |
github.com/flowcatalyst/framework/go/ui |
go/ui/vX.Y.Z |
v0.6.0 | the optional server-rendered UI (templ, Datastar, i18n) |
github.com/flowcatalyst/framework/go/flowcatalyst |
go/flowcatalyst/vX.Y.Z |
v0.3.5 | the platform integration (client, definition sync, receivers). It is the only module that imports the platform SDK (github.com/flowcatalyst/go-sdk) |
go get github.com/flowcatalyst/framework/go@v0.4.4There is no BOM, build tag or feature flag. A driver is a package (for example locks/redislock,
locks/dblock) that is compiled only when you import it; the module graph may list a dependency
a binary never builds. The core module imports the standard library, golang.org/x/sync, pgx v5,
go-redis v9 and a YAML library, plus the AWS SDK for the S3 object store.
Using the platform integration in Go. go/flowcatalyst is released with its own tags
(go/flowcatalyst/vX.Y.Z) and requires the core module by version, so a Go service outside the repository can
go get github.com/flowcatalyst/framework/go/flowcatalyst@v0.3.5. See Framework status.
Go tests need no Docker. In a test package, fwtest.Main(m, ...) in TestMain starts one embedded
PostgreSQL 18 per test binary; fwtest.NewDatabase(t) returns a database cloned from a template
and dropped when the test ends. FW_TEST_DATABASE_URL points the tests at an existing server
instead (a role that may CREATE DATABASE). The PostgreSQL binaries are unpacked once per machine, not on every start. See Testing.
The smallest application
Section titled “The smallest application”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.
app := fw.New("locks-demo")
dbDecl := database.Declare(app)redisDecl := redisfw.Declare(app)locksDecl := locks.Declare(app)dblock.Declare(app) // the fw_lock migration
build := func(ctx context.Context, b *fw.Boot) (fw.Serve, error) { dbs, err := database.Connect(ctx, b, dbDecl) if err != nil { return nil, err } if err := database.Migrate(ctx, b, dbs); err != nil { return nil, err } clients, err := redisfw.Connect(ctx, b, redisDecl) if err != nil { return nil, err } all, err := locks.Build(ctx, b, locksDecl, locks.WithStore("main", dblock.Store(dbs)), locks.WithStore("shared", redislock.Store(clients, redislock.Connection("default"), redislock.Prefix("fw:lock:"))), locks.WithStore("local", locks.Memory()), locks.DefaultStore("main")) if err != nil { return nil, err } return fw.ServeFunc(func(ctx context.Context) error { // use all.Get("main") ... return nil }), nil}
os.Exit(app.Launch(context.Background(), os.Args[1:], build))Go splits start-up into two phases. In the declare phase each capability package’s Declare
registers its settings, migrations and commands on the App; declaring after Launch began
panics. In the build phase your function constructs the services in order from the Boot. The
Serve it returns is what runs until shutdown. app.Start(ctx, build) starts without blocking and
returns a *fw.Running for tests.
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: trueThe same JDBC-style URL is used by both languages. Configuration sources, their order and the full rules are on Configuration.
- Modules and lifecycle and Configuration explain what you just wrote.
- Your first service on the framework adds a use case, a typed operation and a receiver; the orders tutorial goes all the way.