Developer Setup
This is a guide on setting up your local environment for Flaggi development, including running the server and client, using the dev container, and building from source.
Requirements
Section titled “Requirements”- Java 21 — full JDK, not just a JRE
- Gradle — use the included
./gradlewwrapper - Node.js + npm — needed for the dev console and the docs site
Recommended workflow: dev console
Section titled “Recommended workflow: dev console”The dev console is an Electron app that launches the server and two clients, then shows the logs and live game state side by side.
cd dev-consolenpm installnpm startUse the toolbar buttons to:
- Rebuild the server and client artifacts
- Stop all running processes
- Clear logs between test runs
This is the fastest way to test multiplayer behavior without manually juggling terminals.
Manual workflow
Section titled “Manual workflow”If you prefer separate processes, use the helper script from the repository root.
./scripts/run.sh server./scripts/run.sh clientThe script builds the shadow JAR automatically before launching. Useful flags:
| Flag | Effect |
|---|---|
-r, --rebuild | Clear the server temp directory before launching |
--skip-build | Skip the Gradle build step and use the existing JAR |
-h, --help | Show usage information |
Dev container
Section titled “Dev container”A Docker-based dev environment lives in .devcontainer/.
It includes:
- OpenJDK 21
- Protobuf compiler
- Gradle
- Common VS Code extensions for Java and formatting
Open the repository in VS Code and run Dev Containers: Reopen in Container.
Compile-only checks
Section titled “Compile-only checks”For fast verification without launching the game:
./gradlew :shared:compileJava :client:compileJava :server:compileJavaTo build everything:
./gradlew buildTo build just the runnable jars:
./gradlew shadowJarThe runnable artifacts are written to each module’s build/libs/ directory.
Docs website
Section titled “Docs website”The docs site itself lives in website/ and runs as a separate Astro app.
cd websitenpm installnpm run devPackaging dependencies
Section titled “Packaging dependencies”If you plan to package native installers, install these optional tools:
- create-dmg on macOS
- WiX 3 on Windows