How sbezhuk/beebase-hive-service works
BeeBase Hive Service manages hive records and queen histories, and can assemble and render Pro-only hive reports. The main workflow is an authenticated HTTP request routed to a hive or queen handler, then an application service that enforces ownership and entitlement, calls repositories and relevant peer services, and returns a response. Hive deletion also cascades to dependent services. The report flow gathers hive, queen, inspection, harvest, and apiary data before PDF rendering. Wiring for unsampled subsystems follows the README and entry-point excerpts; uncertain call details are omitted.
Main entry points: hive/service.go Hive use cases · report/service.go Report assembly · queen/service.go Queen use cases · handler.go Hive handlers
Components 26
HTTP transport
- HTTP router
internal/transport/http/router.go - Hive handlers
internal/transport/http/hive/handler.go - Queen handlers
internal/transport/http/queen/handler.go
Application services
- Hive use cases
internal/application/hive/service.go - Queen use cases
internal/application/queen/service.go - Hive model
internal/domain/hive/hive.go - Queen model
internal/domain/queen/queen.go
Persistence
- Hive repository
internal/repository/postgres/hive_repository.go - Queen repository
internal/repository/postgres/queen_repository.go - PostgreSQL
internal/platform/postgres/postgres.go
Peer services
- Apiary client
internal/platform/apiaryclient/client.go - Inspection client
internal/platform/inspectionclient/client.go - Harvest client
internal/platform/harvestclient/client.go - Media client
internal/platform/mediaclient/client.go - Subscription client
internal/platform/subscriptionclient/client.go - Notification client
internal/platform/notificationclient/client.go
Reporting
- Report assembly
internal/application/report/service.go - PDF renderer
internal/report/pdf/renderer.go - PDF report
Other components
- API caller
- Apiary service
- Inspection service
- Harvest service
- Media service
- Subscription service
- Notification service
Connections 35
- API caller → HTTP router: sends request
- HTTP router → Hive handlers: routes hive requests
- HTTP router → Queen handlers: routes queen requests
- Hive handlers → Hive use cases: invokes use cases
- Queen handlers → Queen use cases: invokes use cases
- Hive use cases → Hive repository: reads and writes
- Hive use cases → Hive model: uses model
- Hive use cases → Apiary client: checks ownership
- Hive use cases → Subscription client: checks entitlement
- Hive use cases → Inspection client: checks or deletes inspections
- Hive use cases → Harvest client: deletes harvests
- Hive use cases → Media client: deletes media
- Hive use cases → Notification client: dispatches notices
- Queen use cases → Queen repository: reads and writes
- Queen use cases → Hive repository: checks hive ownership
- Queen use cases → Apiary client: checks writability
- Queen use cases → Subscription client: checks entitlement
- Queen use cases → Queen model: uses model
- Hive repository → PostgreSQL: queries hive data
- Queen repository → PostgreSQL: queries queen data
- Apiary client → Apiary service: calls API
- Inspection client → Inspection service: calls API
- Harvest client → Harvest service: calls API
- Media client → Media service: calls API
- Subscription client → Subscription service: calls API
- Notification client → Notification service: calls API
- Hive handlers → Report assembly: assembles report
- Report assembly → Hive use cases: reads hive
- Report assembly → Queen use cases: reads queen history
- Report assembly → Subscription client: checks Pro access
- Report assembly → Inspection client: fetches report data
- Report assembly → Harvest client: fetches report data
- Report assembly → Apiary client: fetches apiary details
- Hive handlers → PDF renderer: renders report
- PDF renderer → PDF report: produces PDF