A GOTH stack (Go, Templ, HTMX, Tailwind) application for browsing Salesforce objects.
- Browse Accounts, Contacts, Opportunities, and Leads
- Column-based filtering with debounced search
- Paginated results
- Direct links to open records in Salesforce
- Git
- Go 1.23+
- Node.js 18+ (for Tailwind CSS)
- templ CLI
- Salesforce Connected App with Client Credentials flow enabled
# Check Git
git --version
# Check Go
go version
# Check Node.js
node --versionGit:
- macOS:
brew install gitor download from git-scm.com - Linux:
sudo apt-get install gitorsudo yum install git - Windows: Download from git-scm.com
Go:
- Download and install from go.dev/dl
- Ensure Go's bin directory is in your PATH:
# Add to ~/.zshrc or ~/.bashrc if not present export PATH=$PATH:$(go env GOPATH)/bin
- Reload your shell:
source ~/.zshrc(or~/.bashrc)
Node.js:
- macOS:
brew install nodeor use nvm - Linux: Use nvm or your package manager
- Windows: Download from nodejs.org or use nvm-windows
templ CLI:
go install github.com/a-h/templ/cmd/templ@latest# All of these should output version numbers
git --version
go version
node --version
templ --version- Create a Connected App in Salesforce Setup
- Enable OAuth settings with "Client Credentials Flow"
- Add appropriate scopes (e.g.,
api,refresh_token) - Note the Consumer Key (Client ID) and Consumer Secret
Once all prerequisites are installed, set up the project:
# Clone the repository (if not already done)
git clone <repository-url>
cd goth-hw
# Install Go dependencies
go mod tidy
# Install Node.js dependencies (Tailwind CSS)
npm install
# Install templ CLI (if not done in prerequisites)
go install github.com/a-h/templ/cmd/templ@latest
# Generate Templ files (compiles .templ templates to Go)
templ generate
# Build Tailwind CSS (processes styles)
npm run css
# Copy environment template and configure
cp .env.example .env
# Edit .env with your Salesforce credentialsAfter running these commands, edit .env with your actual Salesforce credentials from the Connected App setup.
| Variable | Description |
|---|---|
SF_CLIENT_ID |
Salesforce Connected App Consumer Key |
SF_CLIENT_SECRET |
Salesforce Connected App Consumer Secret |
SF_LOGIN_URL |
https://login.salesforce.com or https://test.salesforce.com |
PORT |
Server port (default: 8080) |
# Load environment variables and run
source .env && go run ./cmd/serverUsing Air for hot reload:
go run github.com/air-verse/air@latestAir handles everything: templ generation, Tailwind CSS build, and Go compilation on each change.
Note: If your environment variables aren't in your shell profile (e.g.,
.zshenv), copy.env.exampleto.envand runsource .envfirst.
├── cmd/server/ # Application entry point
├── internal/
│ ├── config/ # Environment configuration
│ ├── handlers/ # HTTP handlers
│ └── salesforce/ # Salesforce API client
├── templates/ # Templ templates
├── static/ # Static assets (CSS)
└── tailwind.config.js # Tailwind configuration
Ensure $(go env GOPATH)/bin is in your PATH:
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrcNode.js is not installed. Follow the Node.js installation steps in Prerequisites.
Make sure you've run both:
templ generate # Generates Go code from .templ files
npm run css # Builds Tailwind CSSIf using Air for development, either:
- Add variables to your shell profile (
~/.zshrcor~/.bashrc) - Or run
source .envbefore starting Air
Change the PORT variable in your .env file to an unused port (e.g., 8081).