Sample Application Architecture
Last updated
Last updated
For the hands-on workshop labs you will be provided a complete spring mvc web server application together with a corresponding spring mvc thymeleaf web client app.
Table of Contents
The server application provides a RESTful service for administering todo items and users.
Use cases of this application are:
Administer todo items (List, view and create todo items)
Administer users
The following figure shows a typical Microservice technology stack implemented by various Spring projects.
The RESTful service for todo items and users is build using the Spring MVC annotation model and Spring HATEOAS.
The server application is already secured by basic authentication and also includes authorization using static roles.
The domain model of the server application is quite simple and just consists of ToDoItem and User models. The packages of the application are organized according to the different application layers:
api: Contains the complete RESTful service
service: The service classes (quite simple for workshop, usually these contain the business logic)
entity: All domain models and repositories
In addition, there more packages with supporting functions:
config: All spring configuration classes
security: All security relevant classes, e.g. a UserDetailsService implementation
There are two target user roles for this application:
USER: Standard user who can list and add todo items
ADMIN: An administrator user who can list, add or remove users and can see all todo items of all users
Important: We will use the following users in all subsequent labs from now on:
bwayne
bruce.wayne@example.com
wayne
USER
ckent
clark.kent@example.com
kent
USER
pparker
peter.parker@example.com
parker
ADMIN
These users are configured for basic authentication and also later for authenticating using keycloak.
This application is used as target server to propagate an access token to when calling from the ToDo item server application.
The client is just able to perform the login using the spring authorization server and to make a test call to get and display the list of all ToDo items for the currently authenticated user. This way you can test the correct communication between client and server without any other tool like postman.
The domain model of the client application is quite simple and just consists of ToDoItemResource and User models. The packages of the application are organized according to the different application layers:
web: Contains the complete spring web mvc layer with all required client side resources
In addition, there is one more package with supporting functions:
config: All spring configuration classes
In resources/templates you find all thymeleaf html templates. These templates use the bootstrap framework that resides in resources/static folder.
There are two target user roles for this client-/server application:
USER: Standard user who can list and add todo items
ADMIN: An administrator user who can list, add or remove users and can see all todo items (of all users)
bwayne
bruce.wayne@example.com
wayne
USER
ckent
clark.kent@example.com
kent
USER
pparker
peter.parker@example.com
parker
ADMIN
The demo client and server application both are build using the programming language and utilizing the .
The application also contains a complete documentation for the RESTful API that is automatically initialized when starting the provided application. You can find this after starting the server application: .
Alternatively you can also use postman and the provided .
To call the provided REST API you can use curl, postman or httpie. For details on how to call the REST API please consult the which also provides the possibility to execute requests for the API endpoints.
You can find the provided initial server application beneath the as .
You can find the provided Suggest ToDo items server application beneath the as .
You can find the provided initial client application beneath the .