# Thunder

## Build Lightning Experience Apps in Go

Thunder lets you build Salesforce Lightning Experience applications in Go that compile to WebAssembly. Write type-safe, maintainable applications using the Elm Architecture pattern with professional SLDS-styled components.

### Key Features

**Go + WebAssembly** - Write Lightning apps in Go, compile to WASM  
**SLDS Components** - Complete library of Lightning Design System components  
**Elm Architecture** - Predictable state management with masc framework  
**Local Development** - Rapid development with hot reload  
**Type Safety** - Compile-time checking for reliable applications

### Getting Started

```bash
# Install Thunder CLI
go install github.com/octoberswimmer/thunder/cmd/thunder@latest

# Login to Salesforce
force login

# Serve locally with hot reload
thunder serve ./myapp

# Deploy to Salesforce
thunder deploy ./myapp --tab
```

### Component Library

Thunder provides a comprehensive set of components for building Lightning apps:

**Form Components** - TextInput, Textarea, Select, Datepicker, Checkbox, RadioGroup with validation  
**Layout Components** - Grid, Card, Modal, Page layouts with semantic spacing  
**Data Components** - DataTable with sorting/actions, Lookup, AddressAutocomplete  
**UI Components** - Button, Badge, Icon, ProgressBar, Spinner, Toast, Tabs

### Example Application

```go
func (m *AppModel) Render(send func(masc.Msg)) masc.ComponentOrHTML {
    headers := []string{"Name", "Industry"}
    rows := []map[string]string{
        {"Name": "Acme Corp", "Industry": "Manufacturing"},
        {"Name": "Stark Industries", "Industry": "Technology"},
    }

return components.Page(
        components.PageHeader("Accounts", "Manage your accounts"),
        components.Card("Account List",
            components.DataTable(headers, rows),
        ),
    )
}
```

### Use Cases

**Custom UIs** - Build tailored interfaces for specific business processes  
**Data Entry Forms** - Complex forms with validation and business logic  
**Dashboard Apps** - Interactive dashboards with real-time data  
**Simplify Maintenance** - Replace rich, but hard-to-maintain application frameworks such as OmniStudio  
**Record Actions** - Custom actions on Lightning record pages  
**Migration Tools** - Replace Visualforce pages with modern Lightning apps

### Docs

[GitHub Repository →](https://github.com/octoberswimmer/thunder)  
[Example Applications →](https://github.com/octoberswimmer/thunder/tree/main/examples)

### Requirements

- Go 1.24+  
- [Force CLI](https://github.com/forcecli/force)  
- Lightning Web Security enabled in Salesforce org
