Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion articles/building-apps/forms-data/add-flyway.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ create table task
);
----

Open `[application package].taskmanagement.Task` and compare the `@Entity` and `@Column` annotations with the SQL script. The names, size, and nullability should match.
Open `[application package].examplefeature.Task` and compare the `@Entity` and `@Column` annotations with the SQL script. The names, size, and nullability should match.

====

Expand Down
2 changes: 1 addition & 1 deletion articles/building-apps/security/add-login/flow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public final class MainView extends Main {
----
import jakarta.annotation.security.PermitAll;

@Route("task-list")
@Route("")
@PageTitle("Task List")
@Menu(order = 0, icon = "vaadin:clipboard-check", title = "Task List")
// tag::snippet[]
Expand Down
2 changes: 1 addition & 1 deletion articles/building-apps/security/protect-services/flow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ To see that the service is actually protected, you're going to break the task li
.TaskListView.java
[source,java]
----
@Route("task-list")
@Route("")
@PageTitle("Task List")
@Menu(order = 0, icon = "vaadin:clipboard-check", title = "Task List")
@PermitAll
Expand Down
4 changes: 2 additions & 2 deletions articles/building-apps/security/protect-services/hilla.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ Log in as `ADMIN` and create some tasks. Everything should work as before.
.Break the Task List
[%collapsible]
====
To see that the service is actually protected, you're going to break the task list. Open `src/main/frontend/views/task-list.tsx` and change `TaskListView()` so that `isAdmin` is always `true`:
To see that the service is actually protected, you're going to break the task list. Open `src/main/frontend/views/@index.tsx` and change `TaskListView()` so that `isAdmin` is always `true`:

.frontend/views/task-list.tsx
.frontend/views/@index.tsx
[source,tsx]
----
...
Expand Down
4 changes: 2 additions & 2 deletions articles/building-apps/security/protect-views/flow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class SecurityConfig {
.Create Admin View
[%collapsible]
====
Create a new class [classname]`AdminView` in the [packagename]`[application package].taskmanagement.ui` package:
Create a new class [classname]`AdminView` in the [packagename]`[application package].examplefeature.ui` package:

.AdminView.java
[source,java]
Expand Down Expand Up @@ -366,7 +366,7 @@ So far all authenticated users have been able to add tasks to [classname]`TaskLi
.TaskListView.java
[source,java]
----
@Route("task-list")
@Route("")
@PageTitle("Task List")
@Menu(order = 0, icon = "vaadin:clipboard-check", title = "Task List")
@PermitAll
Expand Down
4 changes: 2 additions & 2 deletions articles/building-apps/security/protect-views/hilla.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ Attempt to access http://localhost:8080/admin directly. You should end up on the
.Make the Task List Read-Only For Users
[%collapsible]
====
So far all authenticated users have been able to add tasks to the task list view. You'll now change it so that only users with the `ADMIN` role can add tasks. Open `src/main/frontend/views/task-list.tsx` and change it as follows:
So far all authenticated users have been able to add tasks to the task list view. You'll now change it so that only users with the `ADMIN` role can add tasks. Open `src/main/frontend/views/@index.tsx` and change it as follows:

.frontend/views/task-list.tsx
.frontend/views/@index.tsx
[source,tsx]
----
// tag::snippet[]
Expand Down
4 changes: 2 additions & 2 deletions articles/building-apps/views/navigate/flow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public class LinksView extends Main {

Now, open your browser and go to: http://localhost:8080/links

Hover on the "Task List" link to see that it points to `\http://localhost:8080/task-list`. Click the link to navigate to the task list view, then use the *browser's back button* to return.
Hover on the "Task List" link to see that it points to `\http://localhost:8080`. Click the link to navigate to the task list view, then use the *browser's back button* to return.
====


Expand Down Expand Up @@ -312,7 +312,7 @@ Open [classname]`TaskListView` and add this method:
.TaskListView.java
[source,java]
----
@Route("task-list")
@Route("")
@PageTitle("Task List")
@Menu(order = 0, icon = "vaadin:clipboard-check", title = "Task List")
public class TaskListView extends Main {
Expand Down
30 changes: 14 additions & 16 deletions articles/getting-started/walk-through.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,36 @@ A walking skeleton always contains the following Java files, regardless of wheth
src
├── main/java
│ ├── [application package]
│ │ └── taskmanagement <1>
│ │ └── examplefeature <1>
│ │ ├── Task.java
│ │ ├── TaskRepository.java
│ │ └── TaskService.java
│ └── Application.java <2>
└── test/java
└── [application package]
└── taskmanagement
└── examplefeature
└── TaskServiceTest.java <3>
----
<1> The `taskmanagement` feature package.
<1> The `examplefeature` feature package.
<2> Main entry point into the application.
<3> Example integration test for the `TaskService`.

If you generated a Flow view, the project contains more Java files. You'll learn about those later.

The main entry point into the application is `Application.java`. This class contains the `main()` method that start up the Spring Boot application.

The skeleton follows a *feature-based package structure*, organizing code by *functional units* rather than traditional architectural layers. It includes two feature packages: `base` and `taskmanagement`.
The skeleton follows a *feature-based package structure*, organizing code by *functional units* rather than traditional architectural layers. It includes two feature packages: `base` and `examplefeature`.

* The `base` package contains classes meant for reuse across different features, either through composition or inheritance.
* The `taskmanagement` package is an example feature package that demonstrates the structure. It represents a *self-contained unit of functionality*, including UI components, business logic, and data access. Once you create your own features, you'll remove this package.
* The `examplefeature` package is an example feature package that demonstrates the structure. It represents a *self-contained unit of functionality*, including UI components, business logic, and data access. Once you create your own features, you'll remove this package.

This feature-driven approach keeps related code together, making it easier to maintain, extend, and understand. A feature package could represent anything from a *specific use case* (e.g., "User Registration"), a *UI view* (e.g., "Dashboard"), or even a *business subdomain* (e.g., "Billing"). By grouping everything needed for a feature into a single package structure, you avoid scattering logic across layers and reduce unnecessary coupling.


=== The Task Management Feature
=== The Example Feature

The `taskmanagement` feature consists of a JPA entity, a Spring Data JPA repository interface, and an application service.
The `examplefeature` feature consists of a JPA entity, a Spring Data JPA repository interface, and an application service.

The repository stores and fetches entities from a relational database.

Expand All @@ -106,22 +106,21 @@ src
│ ├── component
│ │ └── ViewToolbar.java
│ ├── MainErrorHandler.java
│ ├── MainLayout.java
│ └── MainView.java
└── taskmanagement
│ └── MainLayout.java
└── examplefeature
└── ui
└── TaskListView.java
----

The `base.ui` package contains view-related classes that cut across multiple views in multiple features. The skeleton contains an error handler, a main layout, and a simple main view. You'll want to replace the main view with your own as the application grows.
The `base.ui` package contains view-related classes that cut across multiple views in multiple features. The skeleton contains an error handler and a main layout.

The error handler receives all exceptions that reach the user interface, logs them, and shows an error notification to the user. You'll want to customize this as the application grows.

Your application shows all the views inside the main layout by default. It contains the application's name and a navigation menu. You'll want to at least change the application name.

The `base.ui.component` package contains custom UI components that can be reused throughout the entire application. The skeleton only contains one, but as your application grows, you'll add more components to this package.

The `taskmanagement` feature package contains one UI-related package. It contains the view that allows users to create and list tasks to do.
The `examplefeature` feature package contains one UI-related package. It contains the view that allows users to create and list tasks to do.


== Frontend Files
Expand Down Expand Up @@ -156,15 +155,14 @@ src
└── views
├── @index.tsx
├── @layout.tsx
├── _ErrorHandler.ts
└── task-list.tsx
└── _ErrorHandler.ts
----

The `components` directory contains custom UI components that can be reused throughout the entire application. The skeleton only contains one, but as your application grows, you'll add more components to this directory.

The `views` directory contains a main view, a main layout, an error handler, and an example view. The file names in this directory all have special meaning. You'll learn about it later.
The `views` directory contains an example view, a main layout, and an error handler. The file names in this directory all have special meaning. You'll learn about it later.

The example view - `task-list.tsx` - allows users to add and list tasks to do.
The example view - `@index.tsx` - allows users to add and list tasks to do.

Your application shows all the views inside the main layout - `@layout.tsx` - by default. It contains the application's name and a navigation menu. You'll want to at least change the application name.

Expand Down
Loading