How sbezhuk/beebase-inspection-service works
BeeBase Inspection Service records and serves hive inspections. A beekeeper’s authenticated HTTP request is routed to inspection handlers, which validate input and invoke application use cases. Creation and updates verify hive writability; image references are checked with media-service, and inspection data is persisted in PostgreSQL. The service also exposes filtered listings, assessment and health/report endpoints, hive-status data for other services, and internal cleanup operations. Wiring and core use cases are sampled; several endpoint behaviors are documented in the README and router but their full implementations were not inspected.
Main entry points: service.go Inspection service · router.go HTTP router · handler.go Inspection handlers · client.go Reminder cleanup client
Components 20
HTTP transport
- HTTP router
internal/transport/http/router.go - Inspection handlers
internal/transport/http/inspection/handler.go - Health/report handlers
internal/transport/http/inspection/report.go - Health/readiness
internal/transport/http/health.go
Inspection use cases
- Inspection service
internal/application/inspection/service.go - Inspection domain
internal/domain/inspection/inspection.go - Assessment rules
internal/domain/inspection/assessment.go - Repository port
internal/domain/inspection/repository.go
Inspection storage
- Postgres repository
internal/repository/postgres/inspection_repository.go - PostgreSQL
migrations/000001_create_inspections_table.up.sql
Peer integrations
- Hive client
internal/platform/hiveclient/client.go - Media client
internal/platform/mediaclient/client.go - Reminder cleanup client
internal/platform/notificationclient/client.go
Other components
- Beekeeper/client
- Hive service
- Media service
- Notification service
- Auth JWKS
- Session Redis
- Hive/statistics peers
Connections 21
- Beekeeper/client → HTTP router: sends request
- HTTP router → Auth JWKS: verifies tokens
- HTTP router → Session Redis: checks revocation
- HTTP router → Inspection handlers: dispatches routes
- HTTP router → Health/readiness: dispatches health
- Inspection handlers → Inspection service: calls use cases
- Health/report handlers → Inspection service: requests report data
- Inspection service → Repository port: uses repository
- Repository port → Postgres repository: implemented by
- Postgres repository → PostgreSQL: reads/writes
- Inspection service → Hive client: verifies hive
- Hive client → Hive service: checks ownership/writability
- Inspection service → Media client: verifies/deletes media
- Media client → Media service: checks/deletes media
- Inspection service → Assessment rules: validates assessment
- Inspection service → Inspection domain: creates/updates
- Inspection handlers → Reminder cleanup client: cleans reminders
- Inspection service → Reminder cleanup client: cleans hive reminders
- Reminder cleanup client → Notification service: sends cleanup
- Hive/statistics peers → HTTP router: calls internal endpoints
- Health/readiness → PostgreSQL: checks readiness