Skip to main content
Version: v2.8.0

Creating a Project

Project Generationโ€‹

Now that the CLI is installed, you can generate a new project by using the wails init command.

Pick your favourite framework:

Generate a Svelte project using JavaScript with:

wails init -n myproject -t svelte

If you would rather use TypeScript:

wails init -n myproject -t svelte-ts

There are also community templates available that offer different capabilities and frameworks.

To see the other options available, you can run wails init -help. More details can be found in the CLI Reference.

Project Layoutโ€‹

Wails projects have the following layout:

.
โ”œโ”€โ”€ build/
โ”‚ โ”œโ”€โ”€ appicon.png
โ”‚ โ”œโ”€โ”€ darwin/
โ”‚ โ””โ”€โ”€ windows/
โ”œโ”€โ”€ frontend/
โ”œโ”€โ”€ go.mod
โ”œโ”€โ”€ go.sum
โ”œโ”€โ”€ main.go
โ””โ”€โ”€ wails.json

Project structure rundownโ€‹

  • /main.go - The main application
  • /frontend/ - Frontend project files
  • /build/ - Project build directory
  • /build/appicon.png - The application icon
  • /build/darwin/ - Mac specific project files
  • /build/windows/ - Windows specific project files
  • /wails.json - The project configuration
  • /go.mod - Go module file
  • /go.sum - Go module checksum file

The frontend directory has nothing specific to Wails and can be any frontend project of your choosing.

The build directory is used during the build process. These files may be updated to customise your builds. If files are removed from the build directory, default versions will be regenerated.

The default module name in go.mod is "changeme". You should change this to something more appropriate.