Skip to content

Clone a Starter Application

Choose a language below to clone and run an existing Viaduct application. The Kotlin path uses the small CLI starter. The Java path uses the complete Micronaut Star Wars demo in the main Viaduct repository.

Run the starter

Make a local clone of the CLI starter:

git clone https://github.com/viaduct-dev/cli-starter.git

cd into the clone and verify your environment:

./gradlew test

Gradle should report that the build was successful.

Although Viaduct is typically hosted in a web server, the CLI starter calls it directly from the application's main function so the example stays small. Run a query through Gradle:

./gradlew -q run --args="'{ greeting }'"

The starter ships with a tiny schema:

type Query {
   greeting: String @resolver
   author: String @resolver
}

Any query that's valid against this schema can be passed via --args.

Install JDK 21+ and clone the main repository:

git clone https://github.com/airbnb/viaduct.git
cd viaduct/demoapps/starwars-java

Verify the application before starting the server:

USE_VIADUCT_SNAPSHOT_REPO=true ./gradlew test
USE_VIADUCT_SNAPSHOT_REPO=true ./gradlew run

The flag enables the snapshot repository required by the demo’s current Viaduct version. On Windows, run these commands in Git Bash.

Open GraphiQL and execute:

query {
  allCharacters(limit: 1) {
    name
    displayName
  }
}

The response includes Luke Skywalker. The server exposes /graphql for HTTP requests and /graphiql for the browser. Stop it with Ctrl+C.

Other starter applications

Besides the CLI starter, github.com/viaduct-dev hosts several framework-specific starters:

For Java, continue with demoapps/starwars-java in the main repository; the standalone starter repositories listed above use Kotlin.

Pick the one that matches your target framework. Each repo's README has its own setup steps.

What's Next

Continue to Touring the Application to understand the structure of a Viaduct application.