The Problem

Organizations that need an on‑premise ticketing system must stitch together a web UI, a Go‑based API, and a database, then keep the stack patched. Existing self‑hosted solutions are often split into many services, require complex orchestration, or expose secrets in the repo.

What This Does

libredesk delivers a single‑binary Go server (cmd/main.go) that serves a Vue + Tailwind front‑end (frontend/). The UI lives under frontend/src/ and communicates with the back‑end via HTTP/WebSocket endpoints defined in cmd/websocket.go and the various cmd/*.go command files (e.g., cmd/auth.go, cmd/conversation.go). Configuration is read from config.sample.toml (renamed by the user to config.toml). Database schema lives in internal/ and is accessed through Go modules such as internal/db, internal/automation, and internal/api. All source is compiled into one executable that can be run directly or inside the supplied Docker image (Dockerfile).

How It Is Wired

Execution starts in cmd/main.go:

  1. Bootstrap – parses config.toml, initializes the logger, and opens the Postgres connection (internal/db.New).
  2. Router setup – registers HTTP routes from cmd/handlers.go; most routes delegate to service layers in internal/api/ (e.g., ConversationService, AgentService).
  3. WebSocket – cmd/websocket.go upgrades /ws connections; messages are routed to the same service layer, allowing real‑time updates to the UI.
  4. CLI commands – the other cmd/*.go files expose sub‑commands (libredesk auth, libredesk ai, etc.) that reuse the same service packages, keeping business logic centralized.

The front‑end entry point is frontend/src/main.js, which creates a Vue app, registers Pinia stores (frontend/src/stores/), and opens a WebSocket via frontend/src/websocket.js. UI components (e.g., frontend/src/components/ui/auto-form/AutoForm.vue) call the API through the generated client in frontend/src/api/index.js.

Import‑graph analysis shows 139 internal Go modules with only 19 import edges and no circular dependencies, indicating a shallow dependency tree. The most connected front‑end modules are frontend/src/main and frontend/src/websocket, each importing a handful of utilities (instability = 1), so changes there have a limited blast radius.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/libredesk
cd libredesk

# Build the binary (requires Go 1.22+)
make build          # targets cmd/main.go → ./libredesk

# Or build the container
docker build -t libredesk:local .

# Prepare configuration
cp config.sample.toml config.toml
# Edit config.toml – set DB URL, JWT secret, etc.

# Initialise or upgrade the DB
./libredesk --install      # creates schema; repeat with --upgrade if needed
./libredesk --set-system-user-password   # set the initial System password

# Run (binary)
./libredesk

# Or run via Docker Compose (uses the Dockerfile)
docker compose up -d

The UI is then reachable at http://localhost:9000. All CLI sub‑commands are listed in cmd/ (e.g., ./libredesk auth login).

Real‑World Use

A SaaS provider can deploy libredesk behind its internal network, point the front‑end to the internal PostgreSQL instance, and integrate ticket events with existing CRMs via the built‑in webhook system (cmd/webhooks.go). Because the server runs as a single process, scaling is achieved by container replication behind a load balancer, while the Vue UI remains unchanged.

Code Health & Issues

Measured findings (static analysis)

  • High – Deep nesting – 25 files (e.g., frontend/src/components/sidebar/Sidebar.vue) contain indentation depth 9, making control flow hard to follow.
  • High – Duplicated code blocks – 811 identical 6‑line snippets across 312 files (e.g., cmd/auth.go, cmd/login.go).
  • Medium – High branching density – 13 files (e.g., frontend/src/utils/strings.js) have >20 branch points in <100 lines.
  • Medium – Oversized files – 9 files exceed 600 lines (e.g., frontend/src/api/index.js), increasing change impact.

Code‑health audit (12 findings)

  • HIGH Untrack .env that is already ignored – frontend/.env.
  • HIGH Pin GitHub Actions to commit SHAs (crowdin, docker/setup‑buildx, docker/login, goreleaser).
  • HIGH Upgrade vulnerable vue-i18n@9 (CVE‑2025‑53892).
  • HIGH Remove committed .env and rotate its secrets.
  • MEDIUM Declare least‑privilege GITHUB_TOKEN permissions in crowdin.yml.
  • MEDIUM Enable Dependabot or Renovate for Go and npm manifests.
  • MEDIUM Pin Docker base image (alpine:3.18) by digest.
  • MEDIUM Add a dependency‑vulnerability scan step to CI workflows.
  • MEDIUM Add a pre‑commit secret‑scan hook.
  • MEDIUM Set persist-credentials: false on the checkout step in frontend-ci.yml.

No critical findings were reported.

The Bottom Line

libredesk offers a complete, single‑binary ticketing platform with a modern Vue UI and a well‑structured Go back‑end, making local deployment straightforward. The codebase suffers from maintainability concerns—deep nesting, duplicated snippets, and outdated dependencies—that should be addressed before heavy production use. Teams comfortable with Go and Vue can adopt it quickly, provided they remediate the high‑severity security and hygiene issues.