Skip to content
Projects

About

海狸 IM (Beaver)|全平台、功能齐全、易二开,一站式私有化即时通讯 & 实时音视频方案

Design & Media

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+1
in 15 days
+4
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

Beaver IM

License Version Go Go-Zero QQ Group

Beaver IM core server built on Go-Zero microservices, backing the Flutter mobile app and Electron desktop app with a complete core IM closed loop (REST / WebSocket / gRPC). beaver-server-package/ and beaver-desktop-package/ are independent, optional value-added services and capability packs—core IM works normally even without them.

Current version: 3.0.4 (see VERSION at the repository root).

English | 中文

For development and AI collaboration, read the Chinese engineering handbook first. .api / .proto files are the source of truth for contracts; goctl generates the wiring. For older docs and examples, the current source code and handbook take precedence.


Key Features

  • Authentication: Phone, email, verification code, QR code, and OAuth login; gateway_api verifies external JWTs and signs an ES256 assertion, services verify it with a public JWKS; S2S machine tickets, device management, and remote logout.
  • Messaging: 1:1 and group chats, conversations and message history, read receipts, forwarding, WebSocket delivery, and RocketMQ async pipelines.
  • Social: Friend requests and profiles, group creation and moderation, block list; circles and moments live in the optional beaver-server-social repo.
  • Files & Emoji: Uploads/downloads, emoji packs and favorites, backed by MinIO / Qiniu object storage.
  • Calls: LiveKit-backed signaling and rooms in the optional beaver-server-call repo.
  • Notifications & Push: System notifications, interaction reminders, inbox and read state; a standalone push_api gateway with realtime / offline channels mapped to MQ topics.
  • Sync: datasync incremental multi-device sync for friends, groups, messages, emoji, notifications, circles, and bots.
  • Organization: Departments, employees, workbench, feedback / reports, client telemetry, and release management in platform.
  • AI & Knowledge: Digital partners / bots, knowledge sources and skills (SKILL.md), and agent conversation sync (beaver-server-ai + open platform).
  • Online Documents: HTTP API and Yjs WebSocket in one office_api process (optional beaver-server-online).
  • Operations: Server log collection via Vector and client log ingestion into OpenSearch (beaver-server-observability).
  • Admin: User / organization / release admin endpoints in admin_api (optional beaver-server-backend).

Technology Stack

Area Technology Notes
Language / framework Go 1.26.8, go-zero 1.7.4 goctl is a separate tool; its version is not pinned in the repo (see handbook 1.1)
Communication gRPC, HTTP S2S, WebSocket, RocketMQ RPC inside this repo; HTTP machine tickets across repos and for push
Storage / search MySQL 8.0, Redis 6.0, ETCD 3.5, OpenSearch Split databases, cache, service discovery, log search
Deployment Docker Compose, build scripts deploy/<domain>/ and docker/
Other JWT (ES256 / JWKS), LiveKit, MinIO / Qiniu Auth, calls, object storage

Architecture

Clients (Flutter / Electron) reach the backend through gateway_api :20800. The gateway verifies external Beaver / Open / Admin tickets, signs an ES256 assertion, injects trusted identity headers, and forwards by path. Services verify the assertion with JWKS; cross-service and cross-repo calls use S2S machine tickets and machine / _public views. WebSocket carries long-lived connections; RocketMQ carries async messages and push delivery. The admin console reaches admin_api through the gateway.

┌──────────────┐  ┌──────────────┐  ┌──────────────┐
│ Flutter app  │  │ Electron app │  │ Admin console│
└──────┬───────┘  └──────┬───────┘  └──────┬───────┘
       └─────────────────┼─────────────────┘
                         │
              ┌──────────▼──────────┐
              │  gateway_api :20800  │
              └──────────▼──────────┘
                         │
   ┌─────────────────────┼─────────────────────┐
   │                     │                     │
account / relation   message / ws          asset / notification
platform / datasync      push :20500        (RPC inside this repo only)
   │                     │                     │
   └─────────────────────┼─────────────────────┘
                         │
        ┌────────────────┴────────────────┐
        │ MySQL · Redis · ETCD · OpenSearch │
        └─────────────────────────────────┘

  Cross-repo ──► social / call / open / office / agent / backend / observability (HTTP machine views)

Service Ports

server.md is the single port table; actual listeners are in each service's etc/*.yaml. The main repo has 9 business domains plus the standalone push service. Subrepos run single processes; old moment / circle / call_rpc / open_rpc / doc_rpc ports are no longer in use.

Service API RPC Repo Notes
gateway_api 20800 - beaver-server Client API gateway: ticket verification and forwarding
account 20100 30100 beaver-server Users + auth (merged)
relation 20200 30200 beaver-server Friends + groups (merged)
message 20300 30300 beaver-server Chat (renamed from chat)
ws 20400 - beaver-server WebSocket connections
push 20500 - beaver-server Standalone push gateway (S2S)
asset 20600 30600 beaver-server Files + emoji (merged)
notification 21000 31000 beaver-server Notifications
platform 21600 31100 beaver-server Org / feedback / telemetry / updates
datasync 21700 - beaver-server Incremental sync
call 21800 - beaver-server-call Calls (LiveKit, optional)
open 21900 - beaver-server-open Open platform: API / portal / WS / MQ (optional)
social 22100 - beaver-server-social Circles and moments (optional)
agent 22300 - beaver-server-ai AI / digital partners (Python, agent_api, optional)
office 22400 - beaver-server-online Online docs (HTTP + Yjs WS, optional)
observability 22800 - beaver-server-observability Logging & observability (OpenSearch + Vector, optional)
admin_api 40000 - beaver-server-backend Admin APIs (JWT / CORS, optional)

Project Structure

beaver-server/
├── app/                    # 9 domains: account relation message asset
│   │                       # notification platform datasync ws gateway (+ push)
│   ├── account/            # account_api + account_rpc + account_models
│   ├── relation/           # relation_api + relation_rpc + relation_models
│   ├── message/            # message_api + message_rpc + message_models
│   ├── asset/              # asset_api + asset_rpc + asset_models
│   ├── notification/       # notification_api + notification_rpc + notification_models
│   ├── platform/           # platform_api + platform_rpc + platform_models
│   ├── datasync/           # datasync_api + datasync_models (no RPC)
│   ├── ws/                 # ws_api (no RPC)
│   ├── push/               # push_api (no RPC, no tables)
│   └── gateway/            # gateway_api (custom proxy, no .api)
├── common/                 # Shared constants, identity, response, middleware
├── core/                   # MySQL / Redis / MQ / etcd / OpenSearch / push clients
├── commonconfig/           # Shared config structs
├── middleware/             # JWT and HTTP middleware
├── remote/                 # Outbound clients for other repos, grouped by peer
├── types/                  # Outbound request / response DTOs
├── openevent/              # Public event publishing
├── utils/                  # Logging, JWT, S2S, password, email helpers
├── template/               # Repo-specific goctl templates
├── database/               # DB seed data (not SQL migrations)
├── deploy/                 # Compose and config per domain
├── build/                  # Build / release / local start scripts
├── docs/                   # Engineering handbook (Chinese, 13 chapters)
├── main.go                 # DB init tool only: go run main.go -db
└── server.md               # Service port reference

Quick Start

See the backend docs and deployment guide, plus the local handbook chapter 7 Configuration & Deployment.

Initialize the local database (MySQL connection must be configured first; main.go is a DB init tool, not a service entry point):

go run main.go -db

Build and orchestration scripts live in build/ and deploy/<domain>/. VERSION is used by the build scripts for image tags.

Documentation & Resources

Related Projects

All repositories live under the GitHub beaver-im organization. The core repository forms a complete, self-contained IM closed loop on its own; beaver-server-package/ and beaver-desktop-package/ are independent, optional value-added services / capability packs (local container folders, not repositories themselves)—core IM works normally even without them.

Group Project Repository Description
Core Server beaver-server GitHub Core backend monorepo (self-contained closed loop, this repo)
Core Clients beaver-flutter GitHub Mobile app (Flutter, recommended)
beaver-desktop GitHub Desktop app core (Electron)
Portals / SDK / Docs beaver-web-manager GitHub Admin web console
beaver-web-oauth GitHub OAuth login portal
beaver-web-open GitHub Open platform web portal
beaver-sdk GitHub JS SDK & OpenClaw adapter
beaver-docs GitHub Official documentation site
Optional Server Add-ons beaver-server-ai GitHub AI agent (Python, optional)
(beaver-server-package) beaver-server-backend GitHub Admin APIs (admin_api, optional)
beaver-server-call GitHub Calls (LiveKit, optional)
beaver-server-observability GitHub Logging & observability (optional)
beaver-server-online GitHub Online docs (office_api, optional)
beaver-server-open GitHub Open platform / bots (optional)
beaver-server-social GitHub Circles and moments (social_api, optional)
Optional Desktop Packs beaver-desktop-ai GitHub External desktop AI capability pack (optional)
(beaver-desktop-package) beaver-desktop-online GitHub External desktop online-docs pack (optional)

Feature Showcase

Authentication & Security

Login Interface Registration Interface Password Recovery

Messaging & Communication

Message Interface Private Chat Group Chat Send Text Send Emoji Chat Details

Social Features

Friend List New Friends Friend Profile Edit Remark

Moments & Groups

Moments Send Moments Group List Create Group Group Details Add Members

User Management

User Center Profile Editing QR Code Features

System Features

Settings Update Feedback About Statement

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-change)
  3. Commit your changes (git commit -m 'Describe your change')
  4. Push to the branch (git push origin feature/my-change)
  5. Open a Pull Request

License & Legal Disclaimer

This project is licensed under the MIT License — see LICENSE.

Summary:

  • Closed-source self-use and re-open-sourcing derivatives are free if you keep the root LICENSE and show About attribution when deployed (Based on Beaver IM + repo link)
  • Closed-source delivery to third parties, removing About, or running a paid IM SaaS requires a commercial license (written contract)
  • Do not delete or alter LICENSE, whether paid or free

Full disclaimer & attribution: LEGAL.md
Commercial product lines & pricing: Copyright & Commercial Licensing
Contact: [email protected]

Star History

Sponsor

WeChat Sponsor QR Code Alipay Sponsor QR Code

Explore related projects

Loading…