feat: Implement notification service - #8
Merged
Conversation
7-task plan for a stateless, event-driven email notification service consuming user.created, order.created/cancelled, payment.completed/failed, and inventory.low_stock topics via Kafka and sending via SMTP. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd Kafka consumer - Domain event structs matching producer JSON tags for user, order, payment, and inventory topics - SMTP email sender using net/smtp stdlib with no-auth relay mode for dev (MailHog-compatible) - Notification service sends welcome email on user.created; logs and skips order/payment events since those event payloads carry user_id (UUID) but not the user email address - Multi-topic Kafka consumer with one kafka.Reader per topic, group notification-service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er-compose wiring - Health handler + route (only HTTP surface; no auth middleware needed) - cmd bootstrap: config reads SMTP_HOST/PORT/FROM/USER/PASS/SECURE and KAFKA_BROKERS; dotenv loader for dev; kafka setup/start/close helpers; Gin router in release mode - Run() wires SMTP sender → service → Kafka consumer → HTTP server with graceful shutdown - Dockerfile: golang:1.25-alpine builder → alpine:3.18 runtime, binary notification-service, EXPOSE 8086 - docker-compose: added KAFKA_BROKERS and kafka service_healthy dependency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
user.created,order.created,order.cancelled,payment.completed,payment.failed,inventory.low_stockuser.createdvia SMTP; logs and skips order/payment events (event payloads carryuser_idUUID but not user email — no cross-service call to keep services decoupled)net/smtpstdlib; no-auth relay mode whenSMTP_USERis empty (MailHog-compatible for dev)kafka.Readerper topic, consumer groupnotification-serviceGET /healthis the only HTTP endpoint; no auth middleware neededKAFKA_BROKERSandkafka: service_healthydependencyTest plan
/healthreturns{"status":"healthy"}user.createdKafka event triggers a welcome email to the user's addressorder.created/order.cancelledevents are consumed and logged (no email sent)payment.completed/payment.failedevents are consumed and logged (no email sent)inventory.low_stocktriggers a warn log with product_id and available quantity🤖 Generated with Claude Code