How jonathangunawan30/microgreens works
MicroGreens is a Go grocery marketplace split into five independently running services. The main customer path is account access, browsing products and managing a cart, placing an order, completing payment, then receiving status notifications; administrators also manage catalog, roles, and order status. The README documents REST traffic through an Nginx gateway, RabbitMQ event processing, search, caching, and image storage. App wiring and selected handlers support the shown internal links; some cross-service event details are documented only at a high level, so those links are deliberately broad.
Main entry points: product_handler.go Product API · notification_service.go Notification logic · product_repository.go Product data · user_service.go Accounts and roles
Components 32
Identity and access
- User API
user-service/internal/adapter/handler/user_handler.go - Accounts and roles
user-service/internal/core/service/user_service.go - User data
user-service/internal/adapter/repository/user_repository.go - Profile images
user-service/internal/adapter/storage/supabase.go
Catalog and cart
- Product API
product-service/internal/adapter/handler/product_handler.go - Catalog and search
product-service/internal/core/service/product_service.go - Categories
product-service/internal/core/service/category_service.go - Cart API
product-service/internal/adapter/handler/cart_handler.go - Cart logic
product-service/internal/core/service/cart_service.go - Product data
product-service/internal/adapter/repository/product_repository.go - Cart cache
product-service/internal/adapter/repository/cart_repository.go - Product images
product-service/internal/adapter/storage/supabase_storage.go
Orders and payment
- Order API
order-service/internal/adapter/handler/order_handler.go - Checkout and lifecycle
order-service/internal/core/service/order_service.go - Order data
order-service/internal/adapter/repository/order_repository.go - Order search
order-service/internal/adapter/repository/elasticsearch_repository.go - Payment API
payment-service/internal/adapter/handler/payment_handler.go - Payment processing
payment-service/internal/core/service/payment_service.go - Payment records
payment-service/internal/adapter/repository/payment_repository.go
Events and alerts
- RabbitMQ
- Notification API
notification-service/internal/adapter/router/notification_router.go - WebSocket alerts
notification-service/internal/adapter/handler/websocket_handler.go - Notification logic
notification-service/internal/core/service/notification_service.go - Alert records
notification-service/internal/adapter/repository/notif_repository.go
Shared infrastructure
- Redis caches
- Supabase storage
- PostgreSQL
- Elasticsearch
Other components
- Client app
- Nginx gateway
- Midtrans gateway
- SMTP email
Connections 47
- Client app → Nginx gateway: HTTPS
- Nginx gateway → User API: REST
- Nginx gateway → Product API: REST
- Nginx gateway → Cart API: REST
- Nginx gateway → Order API: REST
- Nginx gateway → Payment API: REST
- Nginx gateway → Notification API: REST
- Nginx gateway → WebSocket alerts: WebSocket
- User API → Accounts and roles: calls
- Accounts and roles → User data: reads/writes
- Accounts and roles → RabbitMQ: publishes events
- User API → Profile images: uploads
- Profile images → Supabase storage: stores files
- Product API → Catalog and search: calls
- Product API → Categories: calls
- Product API → Product images: uploads
- Catalog and search → Product data: reads/writes
- Catalog and search → RabbitMQ: publishes events
- Categories → Product data: reads/writes
- Product images → Supabase storage: stores files
- Cart API → Cart logic: calls
- Cart logic → Cart cache: reads/writes
- Cart logic → Product data: checks products
- Order API → Checkout and lifecycle: calls
- Checkout and lifecycle → Order data: reads/writes
- Checkout and lifecycle → RabbitMQ: publishes events
- Order search → Elasticsearch: searches
- Payment API → Payment processing: calls
- Payment processing → Payment records: reads/writes
- Payment processing → Midtrans gateway: requests payment
- Payment processing → RabbitMQ: publishes events
- Notification API → Notification logic: calls
- WebSocket alerts → Notification logic: serves alerts
- Notification logic → Alert records: reads/writes
- Notification logic → SMTP email: sends email
- Notification logic → RabbitMQ: consumes events
- Accounts and roles → Redis caches: uses cache
- Product API → Redis caches: uses cache
- Order API → Redis caches: uses cache
- Payment API → Redis caches: uses cache
- Notification API → Redis caches: uses cache
- Product data → PostgreSQL: reads/writes
- User data → PostgreSQL: reads/writes
- Order data → PostgreSQL: reads/writes
- Payment records → PostgreSQL: reads/writes
- Alert records → PostgreSQL: reads/writes
- Product data → Elasticsearch: search/index