Hacker
Shivansh Sharma
@shivansharma
Projects
Flagsmith Spring Boot Starter
Flagsmith Experimentation HackathonNov 2026
A Spring Boot starter for Flagsmith, plus a self-hosting kit and a demo checkout service that uses it. The problem: using Flagsmith from a Java service today means wiring the SDK by hand, and the defaults are risky in production. If Flagsmith is slow, the SDK can wait up to 15 seconds and then return an empty flag set, so every flag silently looks missing. There's no Spring integration, and running a real experiment needs exposure and conversion events wired up yourself. Who it's for: Java/Spring teams who want feature flags and A/B tests without adding a new way for production to break. How it works: - Add one dependency and two properties (API URL + server key). Everything is auto-configured. - FlagService gives isEnabled / getValue / getVariant, for the environment or per user. - @FeatureFlag guards a controller or service method. When the flag is off it returns 404, throws, or calls a fallback method. Bad config fails at startup, not during an incident. - The user comes from Spring Security or an X-User-Id header, so each user always gets the same variant. - Fail-safe: every call has a hard timeout. If Flagsmith can't answer, it serves the last known value, then a configured default. A circuit breaker means an outage costs zero latency after the first two calls. - Experiments: exposures are recorded automatically for users in a running experiment, and trackEvent() records conversions. Flagsmith computes the result. - Actuator health (reports UNKNOWN, not DOWN, during an outage so pods aren't killed), Micrometer metrics and a ready Grafana dashboard. make demo starts self-hosted Flagsmith, Postgres, Prometheus, Grafana and the demo app, and seeds the flags and experiment. There's also a Helm setup using the official chart for Kubernetes. About 100 tests, including integration tests against a real Flagsmith in Docker.