MCPcopy Index your code
hub / github.com/teamgram/teamgram-server

github.com/teamgram/teamgram-server @v1.012.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.012.0 ↗
13,391 symbols 30,503 edges 1,407 files 3,829 documented · 29%
README

Teamgram - Unofficial open source mtproto server written in golang

open source mtproto server implemented in golang with compatible telegram client.

Introduce

Open source mtproto server implementation written in golang, support private deployment.

Features

  • MTProto 2.0
  • Abridged
  • Intermediate
  • Padded intermediate
  • Full
  • API Layer: 179
  • private chat
  • basic group
  • contacts

Architecture

Architecture

Installing Teamgram

Teamgram relies on open source high-performance components:

Privatization deployment Before Teamgram, please make sure that the above five components have been installed. If your server does not have the above components, you must first install Missing components.

If you have the above components, it is recommended to use them directly. If not, it is recommended to use docker-compose-env.yaml.

Source code deployment

Install Go environment. Make sure Go version is at least 1.17.

Get source code

git clone https://github.com/teamgram/teamgram-server.git
cd teamgram-server

Init data

  • init database

    1. create database teamgram 2. init teamgram database mysql -uroot teamgram < teamgramd/sql/1_teamgram.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220321.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220326.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220328.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220401.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220412.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220419.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220423.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220504.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220721.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220826.sql mysql -uroot teamgram < teamgramd/sql/migrate-20220919.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221008.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221011.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221016.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221023.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221101.sql mysql -uroot teamgram < teamgramd/sql/migrate-20221127.sql mysql -uroot teamgram < teamgramd/sql/migrate-20230707.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240107.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240108.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240111.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240112.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240113.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240114.sql mysql -uroot teamgram < teamgramd/sql/migrate-20240420.sql mysql -uroot teamgram < teamgramd/sql/z_init.sql

  • init minio buckets

    • bucket names
    • documents
    • encryptedfiles
    • photos
    • videos
    • Access http://ip:xxxxx and create

Build

make

Run

cd teamgramd/bin
./runall2.sh

Docker deployment

Install Docker

Install Docker Compose

Get source code

git clone https://github.com/teamgram/teamgram-server.git
cd teamgram-server

Run

# run dependency
docker-compose -f ./docker-compose-env.yaml up -d

# run docker-compose
docker-compose up -d

Compatible clients

Important: default signIn verify code is 12345

Android client for Teamgram

iOS client for Teamgram

tdesktop for Teamgram

Feedback

Please report bugs, concerns, suggestions by issues, or join telegram group Teamgram to discuss problems around source code.

Notes

If need enterprise edition:

  • sticker/theme/wallpaper/reactions/2fa/sms/push(apns/web/fcm)/secretchat/scheduled/...
  • channel/megagroup
  • audiocall/videocall/groupcall
  • bots

please PM the author

Give a Star! ⭐

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Extension points exported contracts — how you extend this code

Codec (Interface)
(no doc) [420 implementers]
app/interface/gnetway/internal/server/codec/codec.go
InboxClient (Interface)
(no doc) [6 implementers]
app/messenger/msg/inbox/client/inbox_client.go
UserClient (Interface)
(no doc) [5 implementers]
app/service/biz/user/client/user_client.go
ContactsClient (Interface)
(no doc) [3 implementers]
app/bff/contacts/client/contacts_client.go
VerifyCodeInterface (Interface)
(no doc) [2 implementers]
pkg/code/send_sms_helper.go
SessionClient (Interface)
(no doc) [5 implementers]
app/interface/session/client/session_client.go
MsgClient (Interface)
(no doc) [5 implementers]
app/messenger/msg/msg/client/msg_client.go
ChatClient (Interface)
(no doc) [5 implementers]
app/service/biz/chat/client/chat_client.go

Core symbols most depended-on inside this repo

Errorf
called by 3035
app/interface/gnetway/internal/server/logger.go
Debugf
called by 1075
app/interface/gnetway/internal/server/logger.go
Context
called by 432
app/interface/gateway/internal/server/codec/mtproto_full_codec.go
Invoke
called by 300
app/bff/bff/client/bff_proxy_client.go
Encode
called by 228
app/interface/gnetway/internal/server/codec/codec.go
Decode
called by 219
app/interface/gnetway/internal/server/codec/codec.go
Error
called by 208
app/service/dfs/internal/imaging/jpeg/reader.go
Infof
called by 198
app/interface/gnetway/internal/server/logger.go

Shape

Method 10,928
Function 1,286
Struct 1,018
Interface 112
TypeAlias 28
FuncType 19

Languages

Go100%

Modules by API surface

app/service/biz/user/user/user.tl.pb.go897 symbols
app/service/biz/dialog/dialog/dialog.tl.pb.go546 symbols
app/service/biz/chat/chat/chat.tl.pb.go487 symbols
app/service/biz/user/user/codec_schema.tl.pb.go448 symbols
app/service/biz/user/user/user.tl_grpc.pb.go403 symbols
app/service/biz/dialog/dialog/codec_schema.tl.pb.go292 symbols
app/service/biz/message/message/message.tl.pb.go270 symbols
app/service/biz/chat/chat/codec_schema.tl.pb.go256 symbols
app/service/authsession/authsession/authsession.tl.pb.go251 symbols
app/messenger/msg/msg/msg/msg.tl.pb.go227 symbols
pkg/goffmpeg/models/media.go217 symbols
app/service/media/media/media.tl.pb.go205 symbols

Dependencies from manifests, versioned

github.com/Shopify/saramav1.38.1 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/bwmarrin/snowflakev0.3.1-0.20221123153 · 1×
github.com/cespare/xxhash/v2v2.2.0 · 1×
github.com/chai2010/webpv1.1.2-0.20220219151 · 1×
github.com/coreos/go-semverv0.3.1 · 1×
github.com/dgryski/go-rendezvousv0.0.0-2020082301473 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add teamgram-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact