feat: Add embedded frontend support with Go embed#16
Merged
nickmisasi merged 4 commits intomasterfrom Oct 1, 2025
Merged
Conversation
Implements a new Make target 'build-server-embedded' that creates a single binary containing both the server and React frontend using Go's standard embed library. Key Features: - New 'static' package with embed.go for asset embedding - Smart routing: serves static files, handles SPA routing, preserves API - Automatic detection of embedded assets vs API-only mode - Single deployable binary (~97MB with embedded frontend) - Proper MIME type detection for all asset types Changes: - Makefile: Added build-webapp and build-server-embedded targets - cmd/mcnb/server.go: Added embedded file serving with SPA routing support - static/embed.go: New package using //go:embed directive for asset embedding Usage: make build-server-embedded # Build server with embedded frontend ./build/mcnb-server server # Run server serving frontend at localhost:8070 The server automatically detects embedded assets and serves the React app while maintaining full API functionality at /api/v1/* endpoints.
- Update Go version from 1.22.0 to 1.24 to match current toolchain - Replace deprecated golint with modern staticcheck linter - Update dependencies with 'go mod tidy' - Remove unused defaultLocalServerAPI constant - Add placeholder .gitkeep file to enable embed pattern during development This resolves linting compatibility issues and ensures our new embedded frontend code passes all style checks with modern tooling.
Replace hardcoded GO_VERSION environment variable with go-version-file parameter in actions/setup-go. This ensures CI automatically uses the exact Go version specified in go.mod without manual updates. Benefits: - Eliminates version drift between go.mod and CI - Automatic updates when go.mod version changes - Reduces maintenance overhead
- Fix error string capitalization (ST1005) - Simplify boolean returns (S1008) - Replace manual loop with append operation (S1011) - Remove unused struct field (U1000) Fixed issues in: - api/response_writer_wrapper.go: Lowercase error message - model/mattermost.go: Simplify IsValid() methods - providers/aws.go: Optimize role collection loop, fix error message - providers/custom.go: Remove unused kubeClient field, fix error messages All staticcheck and go vet checks now pass successfully.
nickmisasi
approved these changes
Oct 1, 2025
nickmisasi
added a commit
that referenced
this pull request
Oct 2, 2025
This reverts commit 25cae4f.
nickmisasi
added a commit
that referenced
this pull request
Oct 7, 2025
* Add support for AWS session token * Change operator spec version * use latest * Disable telemetry * Really disable * Strip out telemetry * fix aws kube credential issues * Add better support for multiple users leveraging the bootstrapper at once * Proper state persistence * Use database config in deployemnts * Adds support for adding MattermostEnv variables via edit installation modal * Revert "feat: Add embedded frontend support with Go embed (#16)" This reverts commit 25cae4f. * Fix 400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Overview
This PR implements a new Make target that creates a single binary containing both the server and React frontend using Go's standard embed library.
✨ Key Features
🚀 Usage
✅ Testing
Comprehensive testing completed:
🔧 Technical Details
This enables true single-binary deployment while maintaining all existing functionality.