How appleboy/gorush works
Main Components Identification
a) Core Services:
• HTTP/HTTPS Server (Port 8088)
• gRPC Server (Optional, Port 9000)
• Queue System (Local Channel, NSQ, NATS, or Redis)
• Storage System (Memory, Redis, BoltDB, BuntDB, LevelDB, or BadgerDB)
b) Push Notification Services:
• APNS (Apple Push Notification Service)
• FCM (Firebase Cloud Messaging)
• HMS (Huawei Mobile Services)
┌─────────────────────────────────────────────────────────────┐
• Client Requests │
• (HTTP/HTTPS REST API, gRPC, Command Line Interface) │
• ┬─────────────────────┬─────────────────┘
┌───────────────────▼─────────────────────▼─────────────────┐
• Gorush Server │
• ┌───────────────┐ ┌────────────┐ ┌─────────────┐ │
• API Router │ │ Metrics │ │ Health Check│ │
• ┬───────┘ └────────────┘ └─────────────┘ │
• ┌───────▼───────┐ ┌────────────┐ ┌─────────────┐ │
• Queue System │ │ Worker Pool│ │ Status/Stats│ │
• ┬───────┘ └─────┬──────┘ └─────────────┘ │
• ┌───────▼────────────────▼──────┐ ┌──────────────┐ │
• Notification Manager │ │Storage System │ │
• ┬──────────┬───────┘ └──────────────┘ │
• ┬┴──────────┴─────────┬────────────────────┘
┌─────────────▼─────┐ ┌──────────▼────────┐ ┌─────────┐
• APNS │ │ FCM │ │ HMS │
• (iOS Platform) │ │(Android Platform) │ │(Huawei) │
• ┘ └───────────────────┘ └─────────┘
Component Details
For each component, include:
a) API Router:
• HTTP endpoints (/api/push, /api/stat/go, /api/stat/app)
• gRPC service endpoints
• Configuration endpoints
b) Queue System:
• Support for multiple queue backends
• Worker pool configuration
• Queue size and worker numbers
c) Notification Manager:
• Platform-specific handlers (iOS, Android, Huawei)
• Retry mechanism
• Error handling
d) Storage System:
• Multiple storage backend options
• Stat storage
• Configuration storage
Additional Elements
Include:
• Configuration components
• Monitoring and metrics endpoints
• Health check endpoints
• Authentication/Security layers
• Docker/Kubernetes deployment options
• AWS Lambda integration
Deployment Options
Different deployment scenarios:
• Standalone server
• Docker container
• Kubernetes cluster
• AWS Lambda function
• High availability
• Scalability
• Multiple platform support
• Flexible storage options
• Monitoring and metrics
• Multiple deployment options