Token导航 LogoToken导航

Agent Skill · 研究检索

teamgram-server-architecture(Teamgram 服务器架构)

teamgram-server-architecture 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

teamgram-server-architecture 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 17,296。

总安装 6,683周安装 273GitHub Stars 公开资料未说明下载 2,140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.1

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:teamgram-server-architecture(Teamgram 服务器架构)
来源仓库:https://github.com/zhihang9978/teamgram-server-architecture
安装命令:
openclaw skills install teamgram-server-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install teamgram-server-architecture

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

构建 Telegram 兼容后端的系统性架构设计方案。涵盖服务拆分原则与水平扩展策略建议。teamgram-server-architecture 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适用于自建私有化消息服务平台规划参考。包含 MTProto 服务与 WebApp 桥接实现思路。

非开箱即用解决方案,需二次开发适配业务需求。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install teamgram-server-architecture;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

teamgram-server-architecture 怎么安装?

在终端执行 openclaw skills install teamgram-server-architecture。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

teamgram-server-architecture 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

teamgram-server-architecture 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

teamgram-server-architecture 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

teamgram-server-architecture 用的人多吗?

公开数据是累计安装 6,683 次,近一周安装 273 次,下载 2,140 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

teamgram-server-architecture 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
teamgram-server-architecture

Teamgram 服务器架构 · 本页

6,683—接触敏感数据MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
teamgram-server-architecture
description
Teamgram Server architecture guide for building Telegram-compatible backends. Use when designing service topology, implementing MTProto services, or self-hosting Teamgram. Covers service拆分, data flow, deployment patterns, and development workflows based on the official teamgram/teamgram-server repository.
version
1.0.1

Teamgram Server Architecture

Complete architecture guide based on the official teamgram/teamgram-server repository.

⚠️ 免责声明与安全提示

本技能基于对开源项目 teamgram/teamgram-server 的分析整理,仅供学习参考。 重要提示: - 内容可能随官方仓库更新而过时,请以官方最新版本为准 - 生产环境使用前请自行验证所有配置和代码 - 部署配置中的密码、密钥等必须使用强密码并通过安全方式注入 - 建议直接参考官方文档: https://github.com/teamgram/teamgram-server - 生产环境部署前请进行安全审计和渗透测试

Overview

Teamgram Server is an unofficial open-source MTProto server implementation in Go, compatible with Telegram clients and supporting self-hosted deployment.

API Layer: 223 (截至技能创建时,请以官方仓库最新版本为准) MTProto Versions: Abridged, Intermediate, Padded intermediate, Full

Core Features

  • ✅ Private Chat - End-to-end encrypted messaging
  • ✅ Basic Group - Small group chats (up to 200 members)
  • ⚠️ Super Group - Large groups (requires additional implementation)
  • ✅ Contacts - Contact management and sync
  • ✅ Web - Web client support

Service Architecture

High-Level Topology

                    ┌─────────────────┐
                    │   Load Balancer │
                    │    (Nginx/HA)   │
                    └────────┬────────┘
                             │
        ┌────────────────────┼────────────────────┐
        │                    │                    │
┌───────▼───────┐   ┌────────▼────────┐   ┌──────▼──────┐
│   gnetway     │   │   httpserver    │   │   session   │
│  (TCP/MTProto)│   │   (HTTP API)    │   │ (WebSocket) │
└───────┬───────┘   └────────┬────────┘   └──────┬──────┘
        │                    │                    │
        └────────────────────┼────────────────────┘
                             │
                    ┌────────▼────────┐
                    │   BFF Layer     │
                    │ (Business Logic)│
                    └────────┬────────┘
                             │
        ┌────────────────────┼────────────────────┐
        │                    │                    │
┌───────▼───────┐   ┌────────▼────────┐   ┌──────▼──────┐
│   Service     │   │    Service      │   │   Service   │
│   Layer       │   │    Layer        │   │   Layer     │
└───────────────┘   └─────────────────┘   └─────────────┘

Interface Layer (app/interface)

ServiceProtocolPurpose
gnetwayTCP/MTProtoMain client gateway, handles MTProto encryption
httpserverHTTP/RESTBot API and webhooks
sessionWebSocketWeb client connections

BFF Layer (app/bff)

Backend-for-Frontend aggregation layer:

  • Aggregates multiple service calls
  • Handles client-specific logic
  • Reduces client-side complexity

Service Layer (app/service)

ServiceResponsibilityKey Features
authsessionAuthentication & SessionAuth key management, session validation
bizCore Business LogicChat, message, user, dialog, updates
dfsDistributed File StorageFile upload/download, MinIO integration
geoipGeo-locationIP geolocation for security
idgenID GenerationSnowflake-style distributed IDs
mediaMedia ProcessingThumbnail generation, FFmpeg integration
statusOnline StatusUser presence, last seen

Messenger Layer (app/messenger)

ServicePurpose
msgMessage routing and delivery
syncMulti-device synchronization

Biz Service Breakdown

The biz service is a monolithic business logic container:

app/service/biz/
├── biz/        # Core business operations
├── chat/       # Group/channel management
├── code/       # Verification codes (SMS/email)
├── dialog/     # Conversation management
├── message/    # Message storage and retrieval
├── updates/    # Real-time updates push
└── user/       # User profiles and settings

Recommended Refactoring

For large-scale deployments, split biz into:

chat-service/      - Group & channel management
message-service/   - Message CRUD and search
user-service/      - User profiles and contacts
notification-service/ - Push notifications

Data Flow

Message Sending Flow

Client → gnetway → session → msg → message (biz)
                                           ↓
                                    MySQL (persist)
                                           ↓
                                    Kafka (broadcast)
                                           ↓
                              sync → updates → Client

Authentication Flow

Client → gnetway → authsession
                        ↓
                   MySQL (auth_keys)
                        ↓
                   Redis (sessions)

File Upload Flow

Client → gnetway → dfs → MinIO
                  ↓
               MySQL (file_metadata)

Infrastructure Dependencies

ComponentPurposeRequired
MySQL 5.7+Primary data store✅ Yes
RedisCache, sessions, deduplication✅ Yes
etcdService discovery & config✅ Yes
KafkaMessage pipeline, events✅ Yes
MinIOObject storage✅ Yes
FFmpegMedia transcoding⚠️ Optional

Project Structure

teamgram-server/
├── app/
│   ├── bff/              # Backend-for-Frontend
│   ├── interface/        # Gateway layer
│   │   ├── gnetway/      # MTProto gateway
│   │   ├── httpserver/   # HTTP API
│   │   └── session/      # WebSocket session
│   ├── messenger/        # Message routing
│   │   ├── msg/          # Message service
│   │   └── sync/         # Sync service
│   └── service/          # Core services
│       ├── authsession/  # Auth & session
│       ├── biz/          # Business logic
│       ├── dfs/          # File storage
│       ├── geoip/        # Geo location
│       ├── idgen/        # ID generator
│       ├── media/        # Media processing
│       └── status/       # Online status
├── pkg/                  # Shared packages
│   ├── code/             # Error codes
│   ├── conf/             # Configuration
│   ├── net2/             # Network utilities
│   └── ...
├── clients/              # Client SDKs
├── data/                 # SQL schemas
├── docs/                 # Documentation
└── specs/                # Architecture specs

Development Workflow

1. Code Generation

Teamgram uses TL (Type Language) schema:

# Generate Go code from TL schema
make generate
# or
dalgenall.sh

2. Database Migration

# Initialize database
mysql -u root -p < data/teamgram.sql

# Run migrations
make migrate

3. Service Development Pattern

Each service follows this structure:

app/service/<name>/
├── cmd/              # Entry point
├── etc/              # Configuration
├── internal/
│   ├── config/       # Config structures
│   ├── core/         # Business logic
│   ├── dao/          # Data access
│   ├── server/       # gRPC/HTTP handlers
│   └── svc/          # Service context
└── <name>.go         # Main service file

4. Adding New RPC

  1. Define in TL schema (specs/mtproto.tl)
  2. Run code generation
  3. Implement handler in internal/core/
  4. Register in internal/server/
  5. Update client SDKs

Configuration

Service Configuration (YAML)

# app/service/biz/etc/biz.yaml
Name: biz
Host: 0.0.0.0
Port: 20001

MySQL:
  DataSource: user:password@tcp(localhost:3306)/teamgram?charset=utf8mb4

Redis:
  Host: localhost:6379

Etcd:
  Hosts:
    - localhost:2379
  Key: biz

Environment Variables

# .env file
MYSQL_DATA_SOURCE=user:password@tcp(localhost:3306)/teamgram
REDIS_HOST=localhost:6379
ETCD_ENDPOINTS=localhost:2379
KAFKA_BROKERS=localhost:9092
MINIO_ENDPOINT=localhost:9000

Deployment Patterns

Docker Compose (Development)

docker-compose up -d

Kubernetes (Production)

# Example deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: teamgram-biz
spec:
  replicas: 3
  selector:
    matchLabels:
      app: teamgram-biz
  template:
    spec:
      containers:
      - name: biz
        image: teamgram/biz:latest
        resources:
          requests:
            memory: "512Mi"
            cpu: "500m"
          limits:
            memory: "2Gi"
            cpu: "2000m"

Scaling Considerations

Horizontal Scaling

  • Stateless services: biz, httpserver, dfs (easy to scale)
  • Stateful services: gnetway (connection-based), session (session affinity)
  • Database: MySQL read replicas, Redis Cluster

Vertical Scaling

  • Media service: CPU-intensive (FFmpeg)
  • Message service: Memory-intensive (caching)
  • Auth service: Low resource usage

Security Best Practices

  1. Network Isolation

- Internal services behind VPC - Only gnetway/httpserver exposed publicly

  1. Encryption

- MTProto end-to-end encryption - TLS for HTTP/WebSocket - mTLS between services (optional)

  1. Authentication

- Auth keys in secure storage - Session tokens with expiration - Rate limiting per user/IP

  1. Data Protection

- Database encryption at rest - MinIO bucket encryption - Backup encryption

Monitoring

Metrics

- Request rate per service
- Response latency (p50, p95, p99)
- Error rates
- Active connections
- Message throughput

Logging

// Structured logging
log.Info().
    Str("service", "biz").
    Str("method", "messages.sendMessage").
    Int64("user_id", userID).
    Int64("msg_id", msgID).
    Dur("latency", duration).
    Msg("request processed")

References

See Also

平台分布

OpenClaw

74.73%
按下载量换算1,599

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills