Getting Started/Quick Start

Getting Started

Quick Start

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.

What You Will Do

In a typical first run, you will:

  1. initialize an ApiHug workspace
  2. generate a demo project from the IntelliJ wizard or Apihug REPL
  3. run wire, then the application (bootRun)
  4. open the generated OAS document

Before You Start

Initialize a Workspace

ApiHug provides bootstrap scripts for common shells.

PowerShell
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 Development Stack

Prepare the standard development stack first:

  1. JDK 17 or newer
  2. Gradle 8 or newer
  3. IntelliJ IDEA 2022 or newer
  4. the ApiHug - API design Copilot plugin
  5. access to Spring Initializr or an equivalent internal bootstrap flow
Maven Central version badge for com.apihug/it-bom

IntelliJ Plugin

Install 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.

Plugin Install Path

  1. Open File > Settings > Plugins
  2. Search for ApiHug
  3. Install the plugin
  4. Restart IntelliJ
Install ApiHug Plugin

Generate a Project

The IntelliJ wizard gives you a complete starting point for contract-first development.

1. Start an ApiHug Project

  1. Open File > New > Project
  2. Select ApiHug
  3. Continue to the project settings step
Start project from ApiHug Plugin

2. Fill in Project Settings

Set the package, project name, description, SDK options, database vendor, cache, and port.

ApiHug Project Settings

Keep the default choices for your first project unless your team already has a standard template.

An ApiHug project usually starts with two modules:

Text
order
|- order-app
`- order-app-proto
  1. order is the root workspace
  2. order-app is the handwritten application module
  3. order-app-proto is the contract module that drives generation

3. Pick Spring Components

This step follows the same mental model as Spring Initializr. Pick the base project type, then add starter dependencies such as Spring Web.

ApiHug Project Spring Settings

Finish with Create -> Open Project.

4. Load the Project as Gradle

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.

Maven Central version badge for com.apihug/it-bom
ApiHug Load Project

Understand the Project Layout

The simplest demo looks like simplest-demo:

Terminal
+---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)
FileRole
(1) libs.versions.tomlversion catalog and plugin aliases
(2) demo-appapplication and handwritten logic
(3) hope-stub.jsonapplication-module generation config
(4) demo-app-protoprotobuf contracts and wire output
(5) hope-wire.jsonproto-module metadata
libs.versions.toml
# 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" }

Run the Contract-First Loop

1. Run Wire

wire validates the proto module and generates the neutral build output.

  1. Open README.md > 0. Build All
  2. Copy the command into your terminal, for example gradlew clean build -x test -x wireTest -x stubTest
  3. Run it
  4. Check the generated output under demo-app-proto
ApiHug Wire Project

2. Run the Application

  1. Open README.md > 3. Run Application
  2. Run gradlew demo-app:bootRun
  3. Confirm the application starts cleanly
ApiHug Spring Boot
Terminal
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

3. Check the OAS Output

Copy the /v3/api-docs URL from the console, open it in your browser, and verify the generated contract surface.

ApiHug API Information

Open the ApiHug Tool Window

The IntelliJ tool window should appear on the right side of the IDE. If not, open it from ApiHug > ApiHug Designer.

ApiHug Tool Window

Next Step

Once the demo is running, move to:

  1. What is ApiHug? to understand the platform model
  2. Skills & Rules to learn the AI workflow
  3. Tool Chain to go deeper on REPL, BMAD, lint, wire, and stub
Copyright © 2026 ApiHug·AI-native Enterprise Architecture Factory