Skip to main content
Version: 5.0.0

Sample applications

The repository ships three complete AWE 5 applications in awe-samples/. They run on the React engine, are declared in XML (the only Java class starts Spring Boot) and fill their own database on the first start.

Use them as a demo and as a reference: open the XML next to the running screen to see how a feature is declared.

The samples​

SampleDomainPortAWE features it shows
vet-clinicVeterinary clinic18101Screens, criteria, nested grids, charts, file upload, print and export, permissions, three languages
fleet-logisticsFreight and logistics18102Scheduler, notifier, large and tree grids, charts, maps with routes, public tracking, permissions
help-deskIT and customer support18103Wizard, side panel, REST API, permissions, server-enforced workflow, charts, custom widget (support chat that opens a ticket without signing in)

Each sample has a README.md with its demo users, the full feature-to-file table and its setup notes.

A tour of the samples​

Three short tours of what each sample looks like once it runs. Each caption names the screen and the AWE feature behind it; the XML of every screen is in the sample.

Happy Paws (veterinary clinic)​

A clinic with a public site, a staff area for the vets and a portal where owners follow their pets. It runs at http://localhost:18101 and shows criteria, nested grids, charts, side panels and print and export.

Happy Paws public home with a hero photo and three figures

The public home: hero and figures, with no sign-in.

Services and photo gallery of the Happy Paws home

Services and gallery further down the same public page, declared in XML.

Appointment request form of Happy Paws

The appointment request: a public form that only inserts a pending request.

Veterinarian dashboard in dark mode with cards and charts

The vet dashboard in dark mode: cards with trends, three charts and a grid of vaccinations to renew.

Invoice detail side panel with its lines and a Download PDF button

An invoice in a side panel, with its lines and the Download PDF action.

Owner portal showing the next appointment and pending payment

The owner portal: the server filters every query to the pets of the connected owner.

Meridian Freight (logistics)​

A freight company with public shipment tracking, a dispatch area and a customer area. It runs at http://localhost:18102 and shows maps with routes, large grids, the scheduler and the notifier.

Public tracking of shipment MF-T9JSDP6N with its timeline and numbered points on a map

Public tracking: the code MF-T9JSDP6N plus the postal code 36919 return the timeline and numbered points on the map.

Dispatch board with charts, a map of the fleet and the selected vehicle

The dispatch board: charts, the fleet on a map and the vehicle selected on it.

Route planner with route R1003 selected and its numbered stops joined by a road route

The route planner with R1003 selected: numbered stops and the real road between them.

Split sign-in page of Meridian Freight

The sign-in page, split in two: the form on one side and the brand on the other.

Beacon Desk (help desk)​

An IT support desk with a public portal, a queue for agents and a dashboard for supervisors. It runs at http://localhost:18103 and shows the side panel, charts, the REST API and a custom widget.

Support chat open on the Beacon Desk home with a suggested knowledge base article

The support chat widget answers with knowledge base articles before it offers to open a ticket, with no sign-in.

Public ticket check showing the status and the replies of a ticket

Ticket check: the access key G6AP6EHR plus the requester email (ava.parker@contoso.example) show the status and the replies.

Agent queue with the side panel of a ticket and its conversation

The agent queue: select a ticket to open its panel with the conversation and the reply form.

SLA dashboard in dark mode with cards and four charts

The supervisor dashboard in dark mode: open tickets, SLA breaches and resolution times.

Build and run one​

mvn -f awe-samples/help-desk/pom.xml spring-boot:run

Replace help-desk with vet-clinic or fleet-logistics, then open http://localhost:<port> (see the table).

NeedCommand
First build (needs the React client in awe-framework/awe-client-react/dist)mvn -pl awe-samples/help-desk -am install -DskipTests
Runnable jarmvn package && java -jar awe-samples/help-desk/target/help-desk.jar
Descriptor tests onlymvn test -pl awe-samples/help-desk -Dskip.frontend=true
Start again with fresh demo dataDelete the target/db folder

-Dskip.frontend=true skips the client build, so the descriptor tests run without Node.

The pattern they share​

Every sample has a public part and a private part:

AreaWhoHow it is separated
PublicAnybody, no sign-inmenu/public.xml; a few queries and maintain targets marked public="true"
StaffVets, dispatchers, agents, supervisorsAWE profiles (profile/*.xml) and the permissions of each target
End customersPet owners, freight customers, requestersA profile with row-level filtering by the connected user
  • Row-level security is on the server. The login of the customer is linked to its record. Every query of the customer area filters with a server-only query that reads the session user (VetSelfOwn, FltSelfCus, HdkSelfReq), and the maintain targets take the owner from the same query. Hiding a button is not security.
  • Public targets stay minimal. Only what the landing page needs is public: lookups, one insert-only request and, in the tracking and ticket checks, a query that needs a secret code plus a second value. Nothing else runs without a session.
  • Permissions on every target. The profile grants them; a role that must not do something does not get the permission. See Permissions.

Descriptor tests for your application​

AbstractApplicationDescriptorTest (module awe-testing) checks the XML of an application with plain JUnit: no Spring context and no browser, so it runs in milliseconds. Extend it and name the module directory:

RuleWhat fails the build
ParseAn XML file that does not parse into its AWE model class
Locale keysA key used by a screen, menu, enumerated group or permission and missing in a locale file
Server targetsA query, maintain target or enumerated group that a screen launches and no descriptor declares
Intended public targetsA target with public="true" that publicTargets() does not list, or the reverse
Secrets from the environmentA master-key or secret property that is not ${NAME:sample}

The AWE modules on the classpath count as known targets and keys, so the application needs its AWE dependencies, as it does to run. This is the test of the help desk, trimmed:

class HelpDeskDescriptorTest extends AbstractApplicationDescriptorTest {

@Override
protected Path moduleDirectory() {
return Path.of("src/main/resources/application/helpdesk");
}

// Reads only: no maintain is public
@Override
protected Set<String> publicTargets() {
return Set.of("HdkSvcPub", "HdkArtPub", "HdkCatPub", "HdkStatusPub", "HdkRepliesPub");
}

// Rules of the application go beside the inherited ones
@Test
void supervisorOnlyTargetsRequireSupervisorPermissions() throws Exception {
// ...
}
}

propertiesFile() defaults to application.properties two levels above the module directory; override it when yours is elsewhere. Add your own @Test methods for rules specific to your application, as the sample does.

Not production ready as is​

The samples are demos. Before using one as the base of a real application:

  • Set AWE_MASTER_KEY (and AWE_JWT_SECRET in help-desk). Without them the sample values, public in this repository, are used.
  • Delete or deactivate the demo users and above all the test / test administrator.
  • Put a CAPTCHA and a rate limit in front of every anonymous insert and lookup (quote and appointment requests, shipment and ticket checks).
  • Restrict or disable /v3/api-docs when the REST API is exposed (help-desk).
  • Generate tracking codes randomly at insert time; the seeds derive them with a fixed formula so the demo is repeatable.