Source Control

In addition to the standard directory layout of typical Java applications, Vaadin projects also include a number of files and folders related to the frontend tooling. A typical Vaadin application has a directory layout with something like the following content:

frontend                 (1)
└── generated/
└── themes/              (2)
    └── my-theme         (3)
        ├── components/  (4)
        └── styles.css   (5)
└── index.html           (6)
node_modules/            (7)
└── main                 (8)
    └── java
    └── resources
└── test/                (9)
package.json             (10)
package-lock.json        (11)
pom.xml                  (12)
webpack.config.js        (13)
webpack.generated.js     (14)
tsconfig.json            (15)
types.d.ts               (16)
  1. Frontend resources, including CSS, TypeScript, and JavaScript files, are placed under this folder.

  2. This folder includes custom themes.

  3. Each theme is in its own sub-folder. The name of this folder is provided as a parameter to the @Theme annotation to apply the theme to the application.

  4. The components sub-folder is for component style sheets that target the (local CSS) internals of Vaadin components.

  5. styles.css is the theme’s master style sheet that is automatically loaded when the theme is applied.

  6. index.html is an auto-generated file that defines the outermost structure of the application.

  7. A folder that caches the frontend modules that the project depends upon. This folder is auto-generated based on the contents of package.json and package-lock.json.

  8. Application sources.

  9. Test sources.

  10. package.json defines the version ranges of the frontend dependencies.

  11. package-lock.json defines the exact versions of the frontend dependencies used in this project.

  12. Project and configuration details used by Maven to build the project.

  13. Can optionally be used to customize webpack configuration.

  14. An auto-generated file containing the webpack configuration needed for all applications.

  15. An auto-generated file that defines the configuration for compiling TypeScript code in the project, when needed.

  16. An auto-generated file that defines the TypeScript type definitions used in the project.

Project content may vary

The directory layout shown here may vary depending on the project’s configuration. For example, a project using pnpm instead of npm will have a pnpm-lock.yaml file instead of package-lock.json.

The following .gitignore file lists the files and folders that should be excluded from a typical Vaadin project.



# The following files are generated/updated by vaadin-maven-plugin or vaadin-gradle-plugin

# Browser drivers for local integration tests

# Error screenshots generated by TestBench for failed integration tests

# Eclipse and STS

# IntelliJ IDEA

# NetBeans

# VS Code

# Maven wrapper

# The following are auto-generated by Vaadin if missing, but they should be added to source control if customized.