A modern, mobile-friendly golf tee time booking application built with Go and WebAssembly.
This application provides a comprehensive golf course management system with features for booking tee times, user authentication, course administration, and an AI-powered chat assistant for customer support.
- User Authentication: Secure registration, login, and password reset
- Tee Time Booking: Search and book available tee times
- User Profiles: Manage personal information and booking history
- Course Administration: Admin interface for managing seasons, pricing, and reservations
- AI Chat Assistant: Claude-powered chat bot for customer support
- Mobile-First Design: Responsive interface optimized for mobile devices
- Progressive Web App (PWA): Installable web application with offline capabilities
- Backend: Go 1.23.4
- Frontend: Go + WebAssembly (WASM)
- Database: Neo4j (with SQLite support)
- Authentication: JWT tokens with OAuth integration
- UI Framework: go-app (Progressive Web App framework)
- AI Integration: Anthropic Claude API
- Routing: Gorilla Mux
- Session Management: Gorilla Sessions
This project uses Go workspaces with two main modules:
golf_app/
├── pkg/ # Backend module (bigfoot/golf/common)
│ ├── controllers/ # Business logic controllers
│ ├── handlers/ # HTTP request handlers
│ │ ├── admin/ # Admin-specific handlers
│ │ ├── sessionmgr/ # Session management
│ │ └── transactions/# Transaction handlers
│ ├── helper/ # Utility functions and configuration
│ ├── models/ # Data models and business logic
│ │ ├── account/ # User account models
│ │ ├── anthropic/ # AI chat integration
│ │ ├── auth/ # Authentication models
│ │ ├── db/ # Database utilities
│ │ ├── teetimes/ # Tee time booking models
│ │ └── weather/ # Weather integration
│ └── go.mod # Backend module dependencies
├── web/ # Frontend module (bigfoot/golf/web)
│ ├── app/ # WebAssembly application
│ │ ├── clients/ # API client utilities
│ │ ├── components/# Reusable UI components
│ │ ├── pages/ # Application pages
│ │ ├── routes/ # Frontend routing
│ │ └── state/ # Application state management
│ ├── public/ # Static assets (CSS, images)
│ ├── main.go # WebAssembly entry point
│ └── go.mod # Frontend module dependencies
├── mcp/ # Model Context Protocol server
│ ├── server.go # MCP server implementation
│ ├── proxy.go # Development proxy
│ └── README.md # MCP-specific documentation
├── gateway/ # agentgateway configuration
│ └── config.yaml # Gateway routing configuration
├── go.work # Go workspace configuration
├── .env.example # Environment variable template
└── README.md # This file
- Go 1.23.4 or higher
- Neo4j database
- (Optional) agentgateway for LLM proxying
-
Clone the repository
git clone <repository-url> cd golf_app
-
Install Go workspace dependencies
go work sync
-
Set up environment variables
Copy the example environment file and configure it:
cp .env.example .env
Edit
.envand set required values:DB_ADMIN- Neo4j password (required)JWT_SECRET- Secret for JWT signing (required)- See
.env.examplefor all available options
-
Initialize the database
- Ensure Neo4j is running on
bolt://localhost:7687(or configureDB_URI) - The application will automatically create the necessary schema
- Ensure Neo4j is running on
-
Build WebAssembly frontend
GOOS=js GOARCH=wasm go build -o web/public/app.wasm web/main.go
-
Run the server
MODE=dev go run web/main.go
This project uses Go workspaces. All commands should be run from the project root:
# Sync workspace dependencies
go work sync
# Build WebAssembly (note the path to web/main.go!)
GOOS=js GOARCH=wasm go build -o web/public/app.wasm web/main.go
# Run server
go run web/main.goBackend Server:
go build -o bin/web-server web/main.goWebAssembly Frontend:
GOOS=js GOARCH=wasm go build -o web/public/app.wasm web/main.goMCP Server:
cd mcp && go build -o mcp .
./mcp -mode server # Run on port 8081MODE=dev go run web/main.goThis will:
- Set up test/development data
- Enable verbose logging
- Skip certain validations
GET /papi/teetimes- Get available tee timesPOST /auth/register- User registrationPOST /auth/login- User login
GET /api/profile- Get user profilePOST /api/booking- Book a tee timePOST /api/chat- Chat with AI assistant
GET /admin/seasons- Manage golf seasonsPOST /admin/settings- Update course settings
- User: User accounts with authentication
- Season: Golf season configuration
- Reservation: Tee time bookings
- ReservationBlock: Time slot availability
- DetailedBlockSettings: Pricing and availability rules
The application supports multiple authentication methods:
- Email/password authentication
- Google OAuth integration
- Apple Sign-In integration
Pricing is configured through DetailedBlockSettings with support for:
- Weekday/weekend pricing
- Morning/midday/afternoon rates
- Seasonal adjustments
- Special event pricing
The application includes an AI-powered chat assistant using Anthropic's Claude API with Model Context Protocol (MCP) for secure tool access:
Features:
- Help users find tee times
- Answer questions about bookings
- Provide course information
- Handle cancellations and modifications
- Access real-time reservation data via MCP
MCP Server:
The MCP server provides secure, OAuth-authenticated access to reservation tools:
# Start MCP server
cd mcp && go run . -mode server
# MCP server runs on port 8081 by default
# See mcp/README.md for detailed configurationAvailable MCP Tools:
manage_reservations- Get, book, or cancel user reservationsfind_tee_times- Find available tee timesget_conditions- Get weather and course conditions
For detailed MCP documentation, see mcp/README.md
The project includes a golangci-lint configuration:
# Run linters
golangci-lint run
# Run linters on specific module
cd pkg && golangci-lint run
cd web && golangci-lint run# Format code
gofmt -s -w .
# Check imports
goimports -w .# Run from module directories (pkg/ or web/)
cd pkg && go vet ./...
cd web && go vet ./...# Run tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Generate coverage report
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out-
Build the WebAssembly frontend
GOOS=js GOARCH=wasm go build -o web/public/app.wasm web/main.go
-
Build the server binary
go build -o bin/golf-app web/main.go
-
Set production environment variables
export MODE="production" export DB_ADMIN="production-db-password" export JWT_SECRET="your-secure-jwt-secret" export SESSION_KEY="your-secure-session-key" export COOKIE_SECURE="true"
-
Deploy with your preferred method (Docker, systemd, etc.)
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY . .
RUN go build -o golf-app main.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/golf-app .
COPY --from=builder /app/web ./web
CMD ["./golf-app"]- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting:
go vet ./...andstaticcheck ./... - Submit a pull request
[Add your license information here]
For support or questions, please create an issue or contact the development team.