How tupitsin88/stillgood-backend works
StillGood Backend is a REST backend for discounted surplus-food discovery and pickup booking. The primary flow is client or partner requests routed to domain handlers, through services and repositories to PostgreSQL; the order lifecycle includes booking, mock payment, cancellation or partner completion, and reviews. Separate capabilities include partner inventory and analytics, authentication, notifications, moderation, and media uploads. The README and sampled wiring support the domain-level map; detailed worker internals and some unsampled cross-domain calls are not expanded.
Main entry points: router.go Router and routes · adminui/handler.go Admin web panel · auth/handler.go Auth handler/service · restaurants/handler.go Restaurant discovery
Components 24
HTTP entry
- Router and routes
internal/app/router.go
Identity and admin
- Auth handler/service
internal/auth/handler.go - Auth repository
internal/auth/repository.go - Admin web panel
internal/adminui/handler.go
Food marketplace
- Category management
internal/categories/handler.go - Category repository
internal/categories/repository.go - Restaurant discovery
internal/restaurants/handler.go - Restaurant repository
internal/restaurants/repository.go - Offer management
internal/offers/handler.go - Offer repository
internal/offers/repository.go
Booking and insight
- Order lifecycle
internal/orders/handler.go - Order repository
internal/orders/repository.go - Partner analytics
internal/analytics/handler.go - Analytics repository
internal/analytics/repository.go - Notification service/API
internal/notifications/service.go - Notification repository
internal/notifications/repository.go
Storage and delivery
- PostgreSQL
- S3-compatible media
internal/pkg/filestorage/minio.go - MinIO / S3
- Email delivery
internal/email/sender.go - Resend or log
- FCM provider
internal/notifications/fcm_provider.go - Firebase Cloud Messaging
Other components
- Mobile/API clients
Connections 34
- Mobile/API clients → Router and routes: send requests
- Router and routes → Auth handler/service: dispatches auth
- Router and routes → Admin web panel: dispatches admin UI
- Router and routes → Category management: dispatches category
- Router and routes → Restaurant discovery: dispatches restaurant
- Router and routes → Offer management: dispatches offer
- Router and routes → Order lifecycle: dispatches order
- Router and routes → Partner analytics: dispatches analytics
- Router and routes → Notification service/API: dispatches notification
- Auth handler/service → Auth repository: uses repository
- Auth repository → PostgreSQL: reads and writes
- Auth handler/service → Email delivery: sends email
- Email delivery → Resend or log: delivers via
- Admin web panel → Auth handler/service: uses service
- Admin web panel → Category management: uses service
- Admin web panel → Restaurant discovery: uses service
- Category management → Category repository: uses repository
- Category repository → PostgreSQL: reads and writes
- Restaurant discovery → Restaurant repository: uses repository
- Restaurant discovery → S3-compatible media: stores images
- Restaurant repository → PostgreSQL: reads and writes
- Offer management → Offer repository: uses repository
- Offer management → S3-compatible media: stores images
- Offer repository → PostgreSQL: reads and writes
- Order lifecycle → Order repository: uses repository
- Order repository → PostgreSQL: reads and writes
- Order lifecycle → Notification service/API: requests notifications
- Notification service/API → Notification repository: uses repository
- Notification repository → PostgreSQL: reads and writes
- Notification service/API → FCM provider: dispatches push
- FCM provider → Firebase Cloud Messaging: sends push
- Partner analytics → Analytics repository: uses repository
- Analytics repository → PostgreSQL: reads analytics
- S3-compatible media → MinIO / S3: uploads media