Getting Started/Quick Start
Getting Started
Create an ApiHug project, understand the module layout, and run the contract-first toolchain.
Use this page to go from an empty directory to a running ApiHug demo project. The path is simple: prepare your machine, generate a project, run the build loop, and inspect the generated API surface.
ApiHug 3.x targets Spring Boot 4.0 and newer. Review the Spring Boot 4.0 migration guide before upgrading an existing project.
In a typical first run, you will:
wire, then the application (bootRun)ApiHug provides bootstrap scripts for common shells.
iex (irm 'https://raw.githubusercontent.com/apihug/apihug.github.io/main/helper/apihug-install.ps1')If you are upgrading an existing Spring project, review the Spring Boot 4.0 Migration Guide before moving the ApiHug SDK forward.
Prepare the standard development stack first:
ApiHug - API design Copilot pluginInstall the plugin from JetBrains Marketplace, then restart IntelliJ.
If you prefer a terminal-first workflow later, ApiHug REPL is a good companion. For first-time setup, the IntelliJ wizard is still the fastest way to understand the generated project shape.
File > Settings > PluginsApiHug
The IntelliJ wizard gives you a complete starting point for contract-first development.
File > New > ProjectApiHug
Set the package, project name, description, SDK options, database vendor, cache, and port.
Keep the default choices for your first project unless your team already has a standard template.
An ApiHug project usually starts with two modules:
order
|- order-app
`- order-app-proto
order is the root workspaceorder-app is the handwritten application moduleorder-app-proto is the contract module that drives generationThis step follows the same mental model as Spring Initializr. Pick the base project type, then add starter dependencies such as Spring Web.
Finish with Create -> Open Project.
If IntelliJ does not auto-import the project, reload it as Gradle. You should see both demo-app and demo-app-proto.
For existing projects, update gradle/libs.versions.toml and then reload Gradle so the new SDK version is applied consistently.
The simplest demo looks like simplest-demo:
+---gradle
| | libs.versions.toml (1)
+---demo-app (2)
| | build.gradle
| \---src
| \---main
| +---java
| | \---com
| | \---apihug
| | \---demo
| | | DemoAppApplication.java
| | +---domain
| | \---service
| \---resources
| | hope-stub.json (3)
|
+---demo-app-proto (4)
| | build.gradle
| \---src
| \---main
| +---proto
| | \---com
| | \---apihug
| | \---demo
| | \---proto
| | +---api
| | \---infra
| \---resources
| hope-wire.json (5)
| File | Role |
|---|---|
(1) libs.versions.toml | version catalog and plugin aliases |
(2) demo-app | application and handwritten logic |
(3) hope-stub.json | application-module generation config |
(4) demo-app-proto | protobuf contracts and wire output |
(5) hope-wire.json | proto-module metadata |
# versions
apihug = "<current-version>"
springBoot = "4.0.0"
springDependency = "1.1.7"
# libraries
apihugBom = { group = "com.apihug", name = "it-bom", version.ref = "apihug" }
# plugins
springBoot = { id = "org.springframework.boot", version.ref = "springBoot" }
springDependency = { id = "io.spring.dependency-management", version.ref = "springDependency" }wire validates the proto module and generates the neutral build output.
README.md > 0. Build Allgradlew clean build -x test -x wireTest -x stubTestdemo-app-proto
README.md > 3. Run Applicationgradlew demo-app:bootRun
Application 'demo-app' is running! Access URLs:
Local http://localhost:18089/
OAS http://localhost:18089/v3/api-docs
Actuator http://localhost:18089/management
Api-Errors http://localhost:18089/hope/meta/errors
Api-Dictionaries http://localhost:18089/hope/meta/dictionaries
Api-Authorities http://localhost:18089/hope/meta/authorities
Profile(s) dev
Copy the /v3/api-docs URL from the console, open it in your browser, and verify the generated contract surface.
The IntelliJ tool window should appear on the right side of the IDE. If not, open it from ApiHug > ApiHug Designer.
Once the demo is running, move to: