diff --git a/articles/building-apps/forms-data/add-flyway.adoc b/articles/building-apps/forms-data/add-flyway.adoc index 8372ba28a1..942d69af93 100644 --- a/articles/building-apps/forms-data/add-flyway.adoc +++ b/articles/building-apps/forms-data/add-flyway.adoc @@ -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. ==== diff --git a/articles/building-apps/security/add-login/flow.adoc b/articles/building-apps/security/add-login/flow.adoc index 28dcacf7a9..2d2cfe3a85 100644 --- a/articles/building-apps/security/add-login/flow.adoc +++ b/articles/building-apps/security/add-login/flow.adoc @@ -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[] diff --git a/articles/building-apps/security/protect-services/flow.adoc b/articles/building-apps/security/protect-services/flow.adoc index 4bde950189..50fc81e5d3 100644 --- a/articles/building-apps/security/protect-services/flow.adoc +++ b/articles/building-apps/security/protect-services/flow.adoc @@ -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 diff --git a/articles/building-apps/security/protect-services/hilla.adoc b/articles/building-apps/security/protect-services/hilla.adoc index 6f5bff5759..be0230a23c 100644 --- a/articles/building-apps/security/protect-services/hilla.adoc +++ b/articles/building-apps/security/protect-services/hilla.adoc @@ -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] ---- ... diff --git a/articles/building-apps/security/protect-views/flow.adoc b/articles/building-apps/security/protect-views/flow.adoc index 1f8b202bdf..f9bb6ee0eb 100644 --- a/articles/building-apps/security/protect-views/flow.adoc +++ b/articles/building-apps/security/protect-views/flow.adoc @@ -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] @@ -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 diff --git a/articles/building-apps/security/protect-views/hilla.adoc b/articles/building-apps/security/protect-views/hilla.adoc index faa4768f11..2d041be5d3 100644 --- a/articles/building-apps/security/protect-views/hilla.adoc +++ b/articles/building-apps/security/protect-views/hilla.adoc @@ -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[] diff --git a/articles/building-apps/views/navigate/flow.adoc b/articles/building-apps/views/navigate/flow.adoc index 725c6af9f1..efeea8c03f 100644 --- a/articles/building-apps/views/navigate/flow.adoc +++ b/articles/building-apps/views/navigate/flow.adoc @@ -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. ==== @@ -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 { diff --git a/articles/getting-started/walk-through.adoc b/articles/getting-started/walk-through.adoc index 60525a1199..6a596971c4 100644 --- a/articles/getting-started/walk-through.adoc +++ b/articles/getting-started/walk-through.adoc @@ -54,7 +54,7 @@ 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 @@ -62,10 +62,10 @@ src │ └── 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`. @@ -73,17 +73,17 @@ If you generated a Flow view, the project contains more Java files. You'll learn 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. @@ -106,14 +106,13 @@ 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. @@ -121,7 +120,7 @@ Your application shows all the views inside the main layout by default. It conta 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 @@ -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.