How evolution-foundation/evolution-go works
Evolution Go is a Go-based WhatsApp API. Its principal workflow is an API client request entering authenticated HTTP routes, reaching a domain handler and service, and then operating through a WhatsApp instance; responses return through the API. The repository also documents real-time event transports, media storage, optional message persistence, and license activation. The map uses indexed imports and documented capabilities where source excerpts do not expose wiring; dashed links mark relationships that are documented but not verified in the sampled code.
Main entry points: routes.go HTTP routes · whatsmeow.go WhatsApp client runtime · producer.go Event producers · main.go Application startup
Components 31
HTTP API
- HTTP routes
pkg/routes/routes.go - API auth
pkg/middleware/auth_middleware.go - Instance API
pkg/instance/handler/instance_handler.go - Send API
pkg/sendMessage/handler/send_handler.go - Message API
pkg/message/handler/message_handler.go - Group API
pkg/group/handler/group_handler.go - User API
pkg/user/handler/user_handler.go - Chat API
pkg/chat/handler/chat_handler.go - Community API
pkg/community/handler/community_handler.go - Poll API
pkg/poll/handler/poll_handler.go
Messaging domains
- Instance lifecycle
pkg/instance/service/instance_service.go - Message sending
pkg/sendMessage/service/send_service.go - Message operations
pkg/message/service/message_service.go - Group operations
pkg/group/service/group_service.go - User operations
pkg/user/service/user_service.go - Chat operations
pkg/chat/service/chat_service.go - Community operations
pkg/community/service/community_service.go - Poll tracking
pkg/poll/service/poll_service.go
WhatsApp runtime
- WhatsApp client runtime
pkg/whatsmeow/service/whatsmeow.go
Persistence and media
- PostgreSQL
- Instance repository
pkg/instance/repository/instance_repository.go - Message repository
pkg/message/repository/message_repository.go - MinIO media
pkg/storage/minio/media_storage.go
Events and operations
- Event producers
pkg/events/interfaces/producer.go - RabbitMQ producer
pkg/events/rabbitmq/rabbitmq_producer.go - NATS producer
pkg/events/nats/nats_producer.go - Webhook producer
pkg/events/webhook/webhook_producer.go - WebSocket producer
pkg/events/websocket/websocket_producer.go - License management
pkg/core/c0.go - Application startup
cmd/evolution-go/main.go
Other components
- API client
Connections 39
- API client → HTTP routes: sends request
README.md - HTTP routes → API auth: applies auth
pkg/routes/routes.go - HTTP routes → Instance API: routes requests
pkg/routes/routes.go - HTTP routes → Send API: routes requests
pkg/routes/routes.go - HTTP routes → Message API: routes requests
pkg/routes/routes.go - HTTP routes → Group API: routes requests
pkg/routes/routes.go - HTTP routes → User API: routes requests
pkg/routes/routes.go - HTTP routes → Chat API: routes requests
pkg/routes/routes.go - HTTP routes → Community API: routes requests
pkg/routes/routes.go - HTTP routes → Poll API: routes requests
pkg/routes/routes.go - Instance API → Instance lifecycle: calls
pkg/instance/handler/instance_handler.go - Send API → Message sending: calls
pkg/sendMessage/handler/send_handler.go - Message API → Message operations: calls
pkg/message/handler/message_handler.go - Group API → Group operations: calls
pkg/group/handler/group_handler.go - User API → User operations: calls
pkg/user/handler/user_handler.go - Chat API → Chat operations: calls
pkg/chat/handler/chat_handler.go - Community API → Community operations: calls
pkg/community/handler/community_handler.go - Poll API → Poll tracking: calls
pkg/poll/handler/poll_handler.go - Instance lifecycle → WhatsApp client runtime: starts clients
pkg/instance/service/instance_service.go - Message sending → WhatsApp client runtime: uses WhatsApp
pkg/sendMessage/service/send_service.go - Message operations → WhatsApp client runtime: uses WhatsApp
pkg/message/service/message_service.go - Group operations → WhatsApp client runtime: uses WhatsApp
pkg/group/service/group_service.go - User operations → WhatsApp client runtime: uses WhatsApp
pkg/user/service/user_service.go - Chat operations → WhatsApp client runtime: uses WhatsApp
pkg/chat/service/chat_service.go - Community operations → WhatsApp client runtime: uses WhatsApp
pkg/community/service/community_service.go - Instance lifecycle → Instance repository: reads and writes
pkg/instance/service/instance_service.go - Instance repository → PostgreSQL: persists instances
README.md - Message operations → Message repository: uses repository
pkg/message/service/message_service.go - Message repository → PostgreSQL: persists messages
README.md - Poll tracking → PostgreSQL: stores votes
pkg/poll/service/poll_service.go - WhatsApp client runtime → MinIO media: uses media storage
- Application startup → HTTP routes: serves API
cmd/evolution-go/main.go - Application startup → WhatsApp client runtime: initializes runtime
cmd/evolution-go/main.go - Application startup → License management: starts heartbeat
cmd/evolution-go/main.go - WhatsApp client runtime → Event producers: emits events
pkg/whatsmeow/service/whatsmeow.go - Event producers → RabbitMQ producer: implements producer
pkg/events/rabbitmq/rabbitmq_producer.go - Event producers → NATS producer: implements producer
- Event producers → Webhook producer: implements producer
pkg/events/webhook/webhook_producer.go - Event producers → WebSocket producer: implements producer