GOTRS Architecture Review - v0.5.0
Review Summary
Overall Architecture Assessment: EXCELLENT ⭐
GOTRS v0.5.0 represents a significant maturation of the platform, completing the Customer Portal vertical slice and substantially enhancing admin module coverage. The architecture maintains its revolutionary foundations while adding production-critical features.
| Metric | v0.4.0 | v0.5.0 | Change |
|---|---|---|---|
| Admin Modules | ~60% | ~90% | +30% |
| Customer Portal | Partial | Complete | ✅ |
| Test Coverage | Growing | Comprehensive | +++ |
| CI/CD | Legacy | Containerized | ✅ |
Key Architectural Achievements
1. Customer Portal Completion
The customer-facing vertical slice is now fully implemented:
Customer Portal Features (v0.5.0)
├── Authentication (JWT with refresh)
├── Ticket Creation (Tiptap rich text)
├── Ticket Viewing (list + detail)
├── Ticket Replies (public/internal)
├── Ticket Closure
├── Service Filtering (customer-user assignment)
├── Default Services (auto-select on create)
├── i18n (EN/DE, 12 templates)
└── Email Threading (RFC-compliant)
Architecture Impact: Clean separation between agent and customer interfaces, shared service layer with customer-specific view rendering.
2. Admin Modules Expansion
| Module | v0.4.0 | v0.5.0 | Tests |
|---|---|---|---|
| Users | ✅ | ✅ | +++ |
| Groups | ✅ | ✅ | +++ |
| Queues | ✅ | ✅ | +++ |
| Priorities | ✅ | ✅ | +++ |
| States | ✅ | ✅ | +++ |
| Types | ✅ | ✅ | +++ |
| SLA | ✅ | ✅ | UX improved |
| Services | ❌ | ✅ | 31 unit |
| Roles | ❌ | ✅ | +++ |
| Dynamic Fields | ❌ | ✅ | 52+ unit |
| Templates | ❌ | ✅ | 18 unit |
| Customer Users | ✅ | ✅ | +extended |
| Customer Companies | ✅ | ✅ | +extended |
| Customer User Services | ❌ | ✅ | new |
3. Self-Registering Handler Architecture
Revolutionary Change: Handlers now register via init() functions:
// Before: Manual registration in main.go
func init() {
routing.RegisterHandler("/admin/users", HandleAdminUsers)
}
// After: Self-registration via init()
func init() {
routing.RegisterHandler(&routing.RouteConfig{
Path: "/admin/users",
Handler: HandleAdminUsers,
Template: "pages/admin/users.pongo2",
})
}
Benefits:
- Eliminates manual
main.gomaintenance - Test validates all YAML handlers registered (
yaml_handler_wiring_test.go) - Automatic discovery prevents orphaned routes
- Supports dynamic module expansion
4. Email Integration Pipeline
Complete RFC-compliant email threading and connector support:
┌──────────────────────────────────────────┐
│ Email Pipeline │
├──────────────────────────────────────────┤
│ Inbound: │
│ ├── POP3 Connector (factory pattern) │
│ ├── IMAP Connector (v2, TLS support) │
│ ├── Postmaster Processor │
│ ├── Ticket Token Filters │
│ └── External Ticket Rules │
│ │
│ Outbound: │
│ ├── RFC Threading (Message-ID, refs) │
│ ├── BuildEmailMessageWithThreading() │
│ └── GenerateMessageID() │
│ │
│ Caching: │
│ └── Valkey for poll status │
└──────────────────────────────────────────┘
5. CI/CD Pipeline Overhaul
Complete rewrite of GitHub Actions workflows:
| Workflow | Purpose | Tools |
|---|---|---|
| Security | Go security scanning | gosec, govulncheck, Semgrep, Hadolint, GitLeaks |
| Build | Multi-stage Docker | GHCR publishing, SLSA Level 2 |
| Test | Containerized testing | make test, Codecov integration |
Key Improvements:
- Removed references to non-existent Dockerfile.dev/frontend
- Container-first approach (Go+HTMX monolith)
- OIDC authentication for Codecov
- VCS stamping for coverage reproducibility
6. Dynamic Fields System
7 field types with 52+ unit tests and OTRS-compatible YAML config:
| Field Type | Screen Configuration | Validation |
|---|---|---|
| Text | AgentTicketZoom | Alpine.js |
| TextArea | AgentTicketCreate | Server-side |
| Dropdown | AgentTicketPhone | i18n |
| Multiselect | AgentTicketEmail | EN/DE |
| Checkbox | AgentTicketBulk | |
| Date | CustomerTicketMessage | |
| DateTime | CustomerTicketCreate |
Architecture Evolution
v0.4.0 → v0.5.0 Delta
v0.4.0 Foundation v0.5.0 Production
┌─────────────────────┐ ┌─────────────────────┐
│ • Basic modules │ │ • Full admin suite │
│ • Partial portal │ → │ • Complete portal │
│ • Legacy CI │ │ • Container CI │
│ • Manual handlers │ │ • Self-reg handlers │
│ • Basic email │ │ • RFC threading │
└─────────────────────┘ └─────────────────────┘
Architectural Patterns Strengthened
Cross-Database Compatibility
ConvertPlaceholders()used consistentlyInsertWithReturning()for MySQL/PostgreSQL- Test parity (Postgres + MySQL containers)
Handler Pattern Standardization
- Dual content-type support (HTMX + JSON)
- Init-based registration
- YAML-driven routing consistency
Testing Maturity
- 100+ unit tests added (Services, Dynamic Fields, Templates)
- YAML handler wiring test
- Integration fixtures parity
Technology Stack Assessment
| Component | Version | Assessment | Notes |
|---|---|---|---|
| Go | 1.24 | ✅ Excellent | Generics support, stable |
| Gin | 1.9.1 | ✅ Excellent | Mature, well-tested |
| Pongo2 | 6.0.0 | ✅ Excellent | Template flexibility |
| Goja | ES5.1 | ⚠️ Consider | Lambda sandbox limited |
| Valkey | 7+ | ✅ Excellent | Redis-compatible cache |
| MariaDB | 10.6+ | ✅ Excellent | Default database |
| MySQL | 8+ | ✅ Excellent | Full compatibility |
| PostgreSQL | 14+ | ✅ Excellent | Supported |
| HTMX | latest | ✅ Excellent | Hypermedia-driven |
| Alpine.js | latest | ✅ Excellent | Lightweight interactivity |
Critical Patterns
Database Access Pattern (Enforced)
// All queries use ConvertPlaceholders
rows, err := db.Query(database.ConvertPlaceholders(
"SELECT * FROM ticket WHERE queue_id = $1", queueID))
// Cross-database INSERT
result, err := database.GetAdapter().InsertWithReturning(
" INTO sla (name, first_response_time) VALUES ($1, $2) RETURNING id",
name, firstResponseTime)
Self-Registering Handler
// internal/api/users_init.go
func init() {
routing.RegisterHandler(&routing.RouteConfig{
Path: "/admin/users",
Method: "GET",
Handler: HandleAdminUsers,
Template: "pages/admin/users.pongo2",
})
}
Service Layer Pattern
// Clear separation: Repository → Service → Handler
type TicketService interface {
Create(ctx context.Context, ticket *Ticket) error
GetByID(ctx context.Context, id int) (*Ticket, error)
UpdateStatus(ctx context.Context, id int, statusID int) error
}
Areas for Enhancement
1. Observability (Still Pending)
- Current: Basic logging
- Opportunity: OpenTelemetry integration
- Impact: Production debugging, SLO monitoring
2. Lambda Functions (Unchanged)
- Current: ES5.1 via Goja
- Opportunity: v8go for ES2022+ if CGO acceptable
- Note: Still industry-first, still sandboxed
3. Performance Testing (Gap)
- Current: No documented load tests
- Opportunity: k6 or wrk integration
- Impact: Production capacity planning
4. E2E Test Coverage (Growing)
- Current: Playwright harness exists
- Opportunity: Expand beyond queue preferences
- Note: 29MB gotrs-tests image for test runner
Security Posture
| Aspect | Status | Notes |
|---|---|---|
| Container Security | ✅ Non-root (UID 1000) | SLSA Level 2 |
| Authentication | ✅ JWT + refresh | Token rotation |
| Database Access | ✅ Parameterized | ConvertPlaceholders |
| Input Validation | ✅ Alpine.js + server | Dynamic fields |
| Secret Scanning | ✅ CI integration | GitLeaks, gosec |
| Email Security | ✅ RFC-compliant | Threading, TLS |
Competitive Position
vs. v0.4.0
- ✅ Complete customer journey
- ✅ Full admin functionality
- ✅ Production-ready CI/CD
- ✅ Comprehensive testing
vs. OTRS/Znuny
- ✅ Modern tech stack (Go vs Perl)
- ✅ Container-native deployment
- ✅ Dynamic modules (zero duplication)
- ✅ Lambda customization (config-driven)
- ✅ HTMX hypermedia (no SPA complexity)
vs. Modern Ticketing (Zendesk, Freshdesk)
- ✅ Self-hosted option
- ✅ Full customization (lambdas)
- ✅ Open-source transparency
- ✅ No per-user pricing model
Recommendations
Immediate (Next 30 Days)
- Load testing: k6 or wrk for customer portal under load
- Observability: OpenTelemetry tracing for hot paths
- Performance profiling: pprof analysis of lambda execution
Medium Term (3-6 Months)
- Lambda expansion: Add crypto, HTTP utility functions
- Visual lambda editor: Low-code for business logic
- E2E pipeline: Expand Playwright beyond queue preferences
Long Term (6-12 Months)
- Multi-tenant architecture: Leverage dynamic modules
- AI integration: Lambda-powered extensions
- 1.0 Release: Production hardening based on field data
Architecture Maturity
| Aspect | v0.4.0 | v0.5.0 |
|---|---|---|
| Code Quality | Excellent | Excellent |
| Security | Excellent | Excellent |
| Scalability | Good | Good+ |
| Maintainability | Excellent | Excellent |
| Test Coverage | Good | Excellent |
| Documentation | Excellent | Excellent |
| Customer Ready | Partial | Near-complete |
| Production Ready | No | Yes |
Conclusion
GOTRS v0.5.0 achieves production-ready status with:
- Complete customer portal vertical slice
- Comprehensive admin module coverage
- Containerized CI/CD with security scanning
- RFC-compliant email integration
- Self-registering handler architecture
The architecture maintains its revolutionary foundation (dynamic modules, lambda functions) while adding the operational maturity required for production deployment. The separation of concerns (repository → service → handler) and cross-database compatibility patterns provide a solid foundation for enterprise deployment.
Readiness: ✅ Production-ready (subject to organizational readiness factors)
Review conducted: January 3, 2026 Reviewer: Architecture Analysis System Version: GOTRS v0.5.0 Based on: ARCHITECTURE_REVIEW_2025.md (August 2025)