How xuxinzhi007/moe_social works
Moe Social is a Flutter social-network client backed by Go API and RPC services. Its principal workflow is client interaction with authenticated API endpoints, domain operations in the RPC service, and persisted social/account state; the API also exposes real-time chat and LLM features. README capabilities and the route tree support the domain branches shown, while sampled code confirms API-to-RPC setup, RPC database initialization, and raw Ollama forwarding. Flutter implementation details and most handler-to-RPC call sites were not sampled, so those internal links are intentionally summarized or omitted.
Main entry points: routes.go REST routes · servicecontext.go Super RPC client · main.dart Flutter app · user Accounts & profiles
Components 19
Flutter client
- Flutter app
lib/main.dart
HTTP API
- REST routes
backend/api/internal/handler/routes.go - Accounts & profiles
backend/api/internal/handler/user - Posts & groups
backend/api/internal/handler/post - Messages & notices
backend/api/internal/handler/privatemsg - Virtual goods
backend/api/internal/handler/gift - Image service
backend/api/internal/handler/image - API service context
backend/api/internal/svc/servicecontext.go - Super RPC client
backend/api/internal/svc/servicecontext.go
RPC services
- RPC server
backend/rpc/internal/server/superserver.go - Domain operations
backend/rpc/internal/logic - RPC service context
backend/rpc/internal/svc/servicecontext.go - Domain records
backend/model/user.go
Real-time
- WebSocket manager
backend/api/internal/websocket/manager.go - Chat endpoints
backend/api/internal/handler/chat
AI integration
- LLM endpoints
backend/api/internal/handler/llm - Raw chat proxy
backend/api/internal/handler/llm/rawchathandler.go
Other components
- App user
- Ollama service
Connections 20
- App user → Flutter app: uses
- Flutter app → REST routes: API requests
- REST routes → Accounts & profiles: routes requests
- REST routes → Posts & groups: routes requests
- REST routes → Messages & notices: routes requests
- REST routes → Virtual goods: routes requests
- REST routes → Image service: routes requests
- Accounts & profiles → Super RPC client: domain calls
- Posts & groups → Super RPC client: domain calls
- Messages & notices → Super RPC client: domain calls
- Virtual goods → Super RPC client: domain calls
- Super RPC client → RPC server: RPC calls
- RPC server → Domain operations: dispatches
- Domain operations → Domain records: reads/writes
- RPC service context → Domain records: initializes database
- REST routes → Chat endpoints: routes requests
- Chat endpoints → WebSocket manager: manages connections
- REST routes → LLM endpoints: routes requests
- LLM endpoints → Raw chat proxy: dispatches raw chat
- Raw chat proxy → Ollama service: forwards request