wails/website/docs/gettingstarted/firstproject.mdx
Lea Anthony 0c88fb217c Improve documentation clarity and reduce cognitive load
- Update Go version requirement from 1.23+ to 1.25+ across all docs
- Update installation.mdx with links to official installers and actual wails3 doctor output
- Revert first-app.mdx to simple greet app tutorial (10 mins)
- Move TODO app to dedicated tutorial at tutorials/todo-vanilla.mdx (20 mins)
- Simplify next-steps.mdx: remove 50+ links, focus on essential paths
- Simplify tutorials/overview.mdx: remove emojis, cards, verbose sections
- Add Windows 11 Dev Drive performance tips to installation guides
- Fix auto-rebuild documentation (Go code auto-rebuilds, no manual restart needed)
- Remove "What You've Learned" section emojis
- Convert cards to bullet points throughout for better readability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 08:42:09 +11:00

136 lines
3.7 KiB
Text

---
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.
:::tip[Performance Tip for Windows 11 Users]
Consider using [Dev Drive](https://learn.microsoft.com/en-us/windows/dev-drive/) to store your projects. Dev Drives are optimized for developer workloads and can significantly improve build times and disk access speeds by up to 30% compared to regular NTFS drives.
:::
Pick your favourite framework:
```mdx-code-block
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
<Tabs
defaultValue="Svelte"
values={[
{label: "Svelte", value: "Svelte"},
{label: "React", value: "React"},
{label: "Vue", value: "Vue"},
{label: "Preact", value: "Preact"},
{label: "Lit", value: "Lit"},
{label: "Vanilla", value: "Vanilla"},
]}
>
<TabItem value="Svelte">
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t svelte
If you would rather use TypeScript:<br/>
wails init -n myproject -t svelte-ts
</TabItem>
<TabItem value="React">
Generate a <a href={"https://reactjs.org/"}>React</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t react
If you would rather use TypeScript:<br/>
wails init -n myproject -t react-ts
</TabItem>
<TabItem value="Vue">
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t vue
If you would rather use TypeScript:<br/>
wails init -n myproject -t vue-ts
</TabItem>
<TabItem value="Preact">
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t preact
If you would rather use TypeScript:<br/>
wails init -n myproject -t preact-ts
</TabItem>
<TabItem value="Lit">
Generate a <a href={"https://lit.dev/"}>Lit</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t lit
If you would rather use TypeScript:<br/>
wails init -n myproject -t lit-ts
</TabItem>
<TabItem value="Vanilla">
Generate a Vanilla project using JavaScript with:<br/><br/>
wails init -n myproject -t vanilla
If you would rather use TypeScript:<br/>
wails init -n myproject -t vanilla-ts
</TabItem>
</Tabs>
```
<hr />
There are also [community templates](../community/templates.mdx) 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](../reference/cli.mdx#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.