mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
Renames the product across user-facing text -- 1475 lines, i18n and the defaultMessage strings that must match it -- while leaving the names that are code rather than prose: upstream copyright, Go import paths, the @mattermost npm scope, i18n keys, Go template fields, and legacy theme identifiers like AuthorType.Mattermost and the 'Mattermost' key that maps an old theme to a new one. The rule is a word boundary on identifier characters; MattermostEntry is a symbol, "Mattermost" in a sentence is the product. The theme goes monochrome. Hanzo and Hanzo Dark are the two built-ins and Hanzo is the default, with the CSS custom properties that carry brand colour outside the theme object -- sidebar, buttons, links, titles -- moved to black. Status colours stay: online, away, do-not-disturb and error encode state, not brand, and flattening them to grey would cost meaning to buy consistency. The sign-in header drops the TEAM EDITION badge. It advertised which licence tier you were on, and there are no tiers here. Booting without a licence is now logged at debug rather than warned about, because it is this server's normal condition rather than a fault. Co-authored-by: Hanzo Dev <[email protected]>
86 lines
3.8 KiB
Go
86 lines
3.8 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
/*
|
|
Package app provides the business logic layer for Hanzo Team Channels.
|
|
|
|
This package serves as the core business logic layer that sits between the API layer (api4)
|
|
and the data access layer (store). It contains the primary application logic for all
|
|
Hanzo Team functionality including user management, channel operations, post handling,
|
|
notifications, authentication, authorization, and integrations.
|
|
|
|
# Architecture
|
|
|
|
The app package follows a layered architecture pattern:
|
|
|
|
┌─────────────────────────────────────────────────────────────────┐
|
|
│ API Layer (api4) │
|
|
├─────────────────────────────────────────────────────────────────┤
|
|
│ Business Logic (app) │
|
|
├─────────────────────────────────────────────────────────────────┤
|
|
│ Data Access (store) │
|
|
└─────────────────────────────────────────────────────────────────┘
|
|
|
|
# Core Components
|
|
|
|
## App Structure
|
|
|
|
The App struct is the main entry point for business logic operations. It is a pure
|
|
functional component that does not hold state, constructed per request and provides
|
|
access to business logic methods through its association with the Channels struct.
|
|
|
|
## Server
|
|
|
|
The Server struct manages the HTTP server, routing, middleware, and service lifecycle.
|
|
It coordinates between platform services, manages enterprise features, handles
|
|
clustering, and provides the runtime environment for the application.
|
|
|
|
## Channels
|
|
|
|
The Channels struct contains all channels-related state and enterprise interface
|
|
implementations. It manages plugins, file storage, image processing, and coordinates
|
|
various enterprise features like compliance, LDAP, and SAML.
|
|
|
|
## Platform Service
|
|
|
|
The platform service handles non-entity related functionalities required by the
|
|
application including database access, configuration management, caching, licensing,
|
|
metrics, and search engines.
|
|
|
|
# Design Patterns
|
|
|
|
## Request Context Pattern
|
|
All business logic methods accept a request.CTX parameter for request-scoped
|
|
logging, tracing, and cancellation.
|
|
|
|
## Interface Segregation
|
|
Enterprise features are accessed through interfaces in the einterfaces package,
|
|
allowing for modular enterprise functionality.
|
|
|
|
## Dependency Injection
|
|
Services and dependencies are injected through the Server and Channels structs,
|
|
enabling testability and modularity.
|
|
|
|
## Event-Driven Architecture
|
|
The application uses WebSocket events and plugin hooks for real-time updates
|
|
and extensibility.
|
|
|
|
# Key Responsibilities
|
|
|
|
- Business logic: Core application rules and workflows
|
|
- Data orchestration: Coordinate between multiple stores and services
|
|
- External integrations: Third-party service calls and API interactions
|
|
- Cache management: Handle cache invalidation and updates
|
|
- Event handling: Trigger notifications, webhooks, and background jobs
|
|
|
|
# Error Handling
|
|
|
|
The package uses model.AppError for consistent error handling across the
|
|
application. Errors include structured information for logging, user
|
|
messages, and HTTP status codes.
|
|
|
|
This package is central to the Hanzo Team server architecture and provides
|
|
the foundation for all collaboration features in the platform.
|
|
*/
|
|
package app
|