This guide covers building QueryBox for development and production.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/felixdotgo/querybox/llms.txt
Use this file to discover all available pages before exploring further.
Development Mode
The fastest way to develop QueryBox is using the built-in hot-reload mode:- Frontend hot-reload - Changes to Vue components reflect immediately
- Backend hot-reload - Go changes trigger an automatic rebuild
- Debug mode - Additional logging and development tools enabled
Custom Port
To use a different port:Building Plugins
Plugins must be built before running the application:- Creates the
bin/plugins/directory if it doesn’t exist - Builds all executables in the
plugins/directory - Outputs binaries to
bin/plugins/
Cross-Platform Plugin Builds
Build plugins for different platforms using Go’s cross-compilation:.exe suffix.
Plugin Discovery
At startup, the application:- Copies plugins from
bin/plugins/to the user config directory - Scans both locations for available plugins
- User directory plugins take precedence over bundled ones
Production Builds
Build a production-ready executable:bin/ and includes:
- Optimized frontend bundle
- Compiled Go backend
- Embedded assets
- Platform-specific packaging
Platform-Specific Builds
Build for your current platform:Package for Distribution
Create a distributable package:- Builds all plugins
- Builds the main application
- Creates a platform-specific package:
- Windows:
.exeinstaller - macOS:
.appbundle and.dmg - Linux:
.AppImageor.deb
- Windows:
build/bin/ directory.
Server Mode
QueryBox can run as a headless HTTP server without the GUI:Build Server Mode
Run Server Mode
Docker Server Mode
Build and run QueryBox in a Docker container:- Remote database management
- CI/CD integrations
- Headless environments
- API-only deployments
Creating a New Plugin
To create a new database plugin:1. Copy the Template
2. Implement the Plugin Interface
Editplugins/your-plugin-name/main.go and implement the four required commands:
-
info- Return plugin metadata (name, version, type) -
authforms- Return auth form definitions for the UI -
exec- Execute a query and return results -
connection-tree- Return a browsable object hierarchy
3. Build the Plugin
4. Test the Plugin
The running app will discover the new plugin automatically (no restart needed if already running). For detailed plugin development, see the Plugin System documentation.Protobuf Code Generation
If you modify.proto files, regenerate the Go code:
protoc(Protocol Buffer compiler)protoc-gen-go(Go code generator)protoc-gen-go-grpc(Go gRPC code generator)
rpc/contracts/plugin/v1/.
Build Scripts
QueryBox uses Task for build automation. Available tasks:| Task | Description |
|---|---|
task dev | Run in development mode with hot-reload |
task build | Build for current platform |
task package | Create distributable package |
task build:plugins | Build all plugins |
task build:server | Build in server mode (no GUI) |
task run:server | Run server mode |
task build:docker | Build Docker image |
task run:docker | Run Docker container |
task proto:generate | Generate code from .proto files |
task setup:docker | Setup Docker for cross-compilation |
Troubleshooting
Plugin Not Discovered
- Verify binary is in
bin/plugins/or user config directory - Ensure binary is executable:
chmod +x bin/plugins/your-plugin - Check the Plugins window for errors in
PluginInfo.LastError - Use the Rescan button in the Plugins window to re-probe
Build Fails on Windows
Ensure you have a C compiler installed:Frontend Build Errors
Clear the build cache:Next Steps
Testing
Learn how to run and write tests
Plugin System
Deep dive into plugin architecture