Skip to content
Draft
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: 2 additions & 0 deletions jmix-templates/content/project/application-kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ The application will be available at <http://localhost:8080>.
The default user credentials are:
* Login: `admin`
* Password: `admin`

**WARNING**: Change admin password and remove `ui.login.defaultUsername` and `ui.login.defaultPassword` application properties when deploying the application to production.
2 changes: 2 additions & 0 deletions jmix-templates/content/project/application-tabmod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ The application will be available at <http://localhost:8080>.
The default user credentials are:
* Login: `admin`
* Password: `admin`

**WARNING**: Change admin password and remove `ui.login.defaultUsername` and `ui.login.defaultPassword` application properties when deploying the application to production.
2 changes: 2 additions & 0 deletions jmix-templates/content/project/application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ The application will be available at <http://localhost:8080>.
The default user credentials are:
* Login: `admin`
* Password: `admin`

**WARNING**: Change admin password and remove `ui.login.defaultUsername` and `ui.login.defaultPassword` application properties when deploying the application to production.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.login.AbstractLogin.LoginEvent;
import com.vaadin.flow.component.login.LoginI18n;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.i18n.LocaleChangeEvent;
import com.vaadin.flow.i18n.LocaleChangeObserver;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.VaadinSession;
import io.jmix.core.CoreProperties;
import io.jmix.core.MessageTools;
import io.jmix.core.security.AccessDeniedException;
import io.jmix.flowui.Notifications;
import io.jmix.flowui.component.loginform.JmixLoginForm;
import io.jmix.flowui.kit.component.ComponentUtils;
import io.jmix.flowui.kit.component.loginform.JmixLoginI18n;
Expand Down Expand Up @@ -46,6 +48,9 @@ public class LoginView extends StandardView implements LocaleChangeObserver {
@Autowired
private MessageTools messageTools;

@Autowired
private Notifications notifications;

@ViewComponent
private JmixLoginForm login;

Expand All @@ -62,6 +67,16 @@ public class LoginView extends StandardView implements LocaleChangeObserver {
public void onInit(final InitEvent event) {
initLocales();
initDefaultCredentials();
showWarningIfDefaultCredentials();
}

private void showWarningIfDefaultCredentials() {
if ("admin".equals(defaultPassword)) {
notifications.create("WARNING: Change admin password and remove ui.login.default* properties when deploying the application to production")
.withPosition(Notification.Position.BOTTOM_CENTER)
.withDuration(10000)
.show();
}
}

private void initLocales() {
Expand Down
30 changes: 30 additions & 0 deletions jmix-templates/content/project/rest-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ${project_projectPrintableName}

This is a web application based on the [Jmix](https://www.jmix.io) framework.

## Getting Started

The newly created project requires Java 21 and uses the embedded HSQL database.

Use the following resources to learn more about Jmix:
* [Jmix Documentation](https://docs.jmix.io)
* [Online Demo Applications](https://www.jmix.io/live-demo)
* [Jmix AI Assistant](https://ai-assistant.jmix.io) (also available in the **Jmix AI** tool window of IntelliJ IDEA)

## Development

- [Setup](https://docs.jmix.io/jmix/setup.html) your development environment.
- [Open](https://docs.jmix.io/jmix/studio/project.html#opening-existing-project) the project in the IDE.
- If you want to use AI agents to develop the application, check out the [Jmix AI Agent Guidelines](https://github.com/jmix-framework/jmix-agent-guidelines) repository.

## Running

To start the application, use the **${project_projectPrintableName} Jmix Application** run configuration in your IDE, or run the following command in the project root directory:

```bash
./gradlew bootRun
```

The application will be available at <http://localhost:8080>.

See [Jmix REST API documentation](https://docs.jmix.io/jmix/rest) for more information.