5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:51:26 +08:00
wails/website/docs/gettingstarted/firstproject.mdx
2021-09-27 19:35:30 +10:00

54 lines
1.6 KiB
Plaintext

---
sidebar_position: 2
---
# Creating a Project
## Project Generation
Now that the CLI is installed, you can generate a new project by using the `wails init` command.
To get up and running quickly, you can generate a default project by running `wails init -n myproject`. This will
create a directory called `myproject` and populate it with the default template.
Other project templates are available and can be listed using `wails init -l`.
To see the other options available, you can run `wails init -help`.
More details can be found in the [CLI Reference](/docs/reference/cli#init).
## 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.