juneau-petstore
The juneau-petstore family is the canonical Apache Juneau showcase application. It packages a small, complete
sample petstore (pets, orders, users) and deploys it under two runtimes, Jetty/Microservice and Spring Boot, using
the exact same REST surface. Its centrepiece is an admin console built entirely on the Juneau console framework:
fourteen pages that exercise datatables, charts, staged edits, async jobs, themes and the four rendering flavors.
This section tours that console, page by page.
In-tree, no external repo. The petstore lives directly in the Juneau reactor under
juneau-petstore/.
Module layout
juneau-petstore/ (top-level aggregator, packaging=pom)
├── juneau-petstore-core/ Shared, deployment-agnostic surface (REST API, console, tests)
├── juneau-petstore-jetty/ Jetty/Microservice deployment
└── juneau-petstore-springboot/ Spring Boot deployment
Each module ships as a plain jar (no OSGi-bundle wrapping for the sample). The library Juneau modules they depend on
are still OSGi bundles, so OSGi consumers lose nothing.
What is mounted where
The core-hosted surface is identical across both deployments by construction (it is shared code, not parallel copies):
| URL | Resource | What it is |
|---|---|---|
/petstore/* | PetStoreResource | The petstore REST API: GET/POST/PUT/DELETE over pets, orders and users, backed by an in-memory PetStore service seeded from classpath JSON. |
/console/* | PetstoreConsoleResource | The admin console. Each page is a child resource (StoreRest, PetsRest, OrdersRest, UsersRest, OpsRest, DevRest, AboutRest) that extends PetstoreConsolePage. |
/juneau-console/* | ConsoleAssetsRest | The console shell scripts and stylesheets, served by ConsoleChromeMixin. |
/petstore-ui | PetstoreUiResource | A no-build React app that talks to /petstore; the console embeds it as the React rendering flavor. |
The deployment-specific surface is intentionally non-parity:
| Surface | Jetty deployment | Spring Boot deployment |
|---|---|---|
| Microservice admin | ConfigResource, LogsResource, ShutdownResource (from juneau-microservice-examples), behind their own AdminBoundary CSRF filter | (omitted; Spring Boot has its own actuator) |
Spring @Autowired injection demo | (n/a; no Spring container) | HelloResource + HelloMessageProvider (/hello/*) |
The core's PetstoreConsoleResource and PetStoreResource extend BasicRestServlet (servlet API only, nothing
Spring or Microservice specific). Each deployment's RootResources mounts them as @Rest(children={...}); the Jetty
one extends BasicRestServletGroup, the Spring Boot one extends BasicSpringRestServletGroup so children resolve as
Spring beans. Switching runtimes is a matter of swapping the router base class and the bootstrap.
Running the petstore
See start-petstore-jetty.py and start-petstore-springboot.py for the launch scripts.
python3 scripts/start-petstore-jetty.py # http://localhost:10000
python3 scripts/start-petstore-springboot.py # http://localhost:5000
Jetty runs on port 10000 and Spring Boot on 5000; see Ports used in these docs.
Then open /console (it redirects to /console/store), or /petstore/pets for the raw JSON API.
The console tour

The console is one chrome (header, navigation tree, footer, theme) wrapped around cards. The pages below are numbered P1 through P14 in the order of the navigation tree. Each tour page is described the same way: what it shows, the FreeMarker template, the Java builder twin that produces the same page contract, the tests that pin it, and the framework pages it demonstrates.
| Page | Route | Tour page |
|---|---|---|
| Chrome and navigation | /console/* | Console Tour |
| P1 Store | /console/store | Store |
| P2 Pets | /console/pets | Pets |
| P3 Sold pets | /console/pets/sold | Sold Pets |
| P4 Pet detail | /console/pets/{id}/{tab} | Pet Detail |
| P5 Orders | /console/orders | Orders |
| P6 Jobs | /console/ops/jobs | Jobs |
| P7 Audit | /console/ops/audit | Audit |
| P8 Custom cards | /console/dev/cards | Custom Cards |
| P9 Themes | /console/dev/themes | Themes |
| P10 Pending changes | /console/pets/changes | Pending Changes |
| P11 Users | /console/users | Users |
| P12 Rendering flavors | /console/dev/flavors/{html,freemarker,mustache,react} | Rendering Flavors |
| P13 Secure | /console/dev/secure | Secure |
| P14 About | /console/about | About |
| Developer pages (charts, data, dashboard) | /console/dev/{charts,data,dashboard} | Developer Pages |
| Porting the patterns to your own admin UI | n/a | Porting to the Console |
Where the tests live
The console tests are in juneau-petstore/juneau-petstore-core/src/test/java/org/apache/juneau/petstore/console/.
Each resource has a *Rest_Test, PetstorePages_ContractTest pins the page contract of the main pages, and the
browser subpackage holds the browser tests. Every tour page names the tests that cover it.
Where to look in the source
org.apache.juneau.petstore.rest.PetStoreResource: the CRUD API.org.apache.juneau.petstore.service.PetStore: the in-memory store.org.apache.juneau.petstore.console.PetstoreConsoleResourceandPetstoreConsolePage: the console host and the base class every page extends.org.apache.juneau.petstore.console.pages: the builder twins (PetsPageBuilders,OpsPageBuilders, ...).org.apache.juneau.petstore.jetty.App/RootResources: the Jetty deployment.org.apache.juneau.petstore.springboot.App/RootResources: the Spring Boot deployment.
See also
See also
The four rendering flavors are covered on Rendering Flavors and the bearer-token demo on Secure. For how the petstore changed from earlier releases, see the v10.0 Migration Guide.