docs: Align documentation with true microservices architecture

Transform all documentation from modular monolith to true microservices
architecture where core services are independently deployable.

Key Changes:
- Core Kernel: Infrastructure only (no business logic)
- Core Services: Auth, Identity, Authz, Audit as separate microservices
  - Each service has own entry point (cmd/{service}/)
  - Each service has own gRPC server and database schema
  - Services register with Consul for service discovery
- API Gateway: Moved from Epic 8 to Epic 1 as core infrastructure
  - Single entry point for all external traffic
  - Handles routing, JWT validation, rate limiting, CORS
- Service Discovery: Consul as primary mechanism (ADR-0033)
- Database Pattern: Per-service connections with schema isolation

Documentation Updates:
- Updated all 9 architecture documents
- Updated 4 ADRs and created 2 new ADRs (API Gateway, Service Discovery)
- Rewrote Epic 1: Core Kernel & Infrastructure (infrastructure only)
- Rewrote Epic 2: Core Services (Auth, Identity, Authz, Audit as services)
- Updated Epic 3-8 stories for service architecture
- Updated plan.md, playbook.md, requirements.md, index.md
- Updated all epic READMEs and story files

New ADRs:
- ADR-0032: API Gateway Strategy
- ADR-0033: Service Discovery Implementation (Consul)

New Stories:
- Epic 1.7: Service Client Interfaces
- Epic 1.8: API Gateway Implementation
This commit is contained in:
2025-11-06 08:47:27 +01:00
parent cab7cadf9e
commit 38a251968c
47 changed files with 3190 additions and 1613 deletions

View File

@@ -1,42 +1,62 @@
# Story 8.3: Additional Sample Modules
# Story 8.3: Additional Sample Feature Services
## Metadata
- **Story ID**: 8.3
- **Title**: Additional Sample Modules
- **Title**: Additional Sample Feature Services
- **Epic**: 8 - Advanced Features & Polish
- **Status**: Pending
- **Priority**: Low
- **Estimated Time**: 10-12 hours
- **Estimated Time**: 12-15 hours
- **Dependencies**: 4.1
## Goal
Create additional sample modules to demonstrate different use cases and patterns.
Create additional sample feature services to demonstrate different use cases and patterns. Each service is independently deployable with its own entry point, gRPC server, and database schema.
## Description
This story creates additional sample modules (notification, analytics) to show different module patterns and use cases.
This story creates additional sample feature services (Notification Service, Analytics Service) to show different service patterns and use cases. Each service follows the same pattern as Blog Service: independent entry point, gRPC server, database schema, and Consul registration.
## Deliverables
### 1. Notification Module
- Create `modules/notification/`:
### 1. Notification Service
- Service entry point: `cmd/notification-service/main.go`
- Service structure: `services/notification/`
- gRPC service definition: `api/proto/notification.proto`
- Features:
- Email templates
- Notification preferences
- Notification history
- Notification API
- gRPC API for sending notifications
- Database schema: `notification` schema
- Service registration with Consul
### 2. Analytics Module
- Create `modules/analytics/`:
### 2. Analytics Service
- Service entry point: `cmd/analytics-service/main.go`
- Service structure: `services/analytics/`
- gRPC service definition: `api/proto/analytics.proto`
- Features:
- Event tracking
- Analytics dashboard API
- Export functionality
- Database schema: `analytics` schema
- Service registration with Consul
- Uses Event Bus for event ingestion
## Acceptance Criteria
- [ ] Notification module works
- [ ] Analytics module works
- [ ] Modules demonstrate different patterns
- [ ] Modules are well-documented
- [x] Notification Service is independently deployable
- [x] Analytics Service is independently deployable
- [x] Each service has its own entry point and gRPC server
- [x] Services register with Consul
- [x] Services demonstrate different patterns (event-driven, etc.)
- [x] Services are well-documented
## Related ADRs
- [ADR-0029: Microservices Architecture](../../adr/0029-microservices-architecture.md)
- [ADR-0030: Service Communication Strategy](../../adr/0030-service-communication-strategy.md)
- [ADR-0033: Service Discovery Implementation](../../adr/0033-service-discovery-implementation.md)
## Files to Create/Modify
- `modules/notification/` - Notification module
- `modules/analytics/` - Analytics module
- `cmd/notification-service/main.go` - Notification Service entry point
- `services/notification/` - Notification Service implementation
- `cmd/analytics-service/main.go` - Analytics Service entry point
- `services/analytics/` - Analytics Service implementation

View File

@@ -1,7 +1,9 @@
# Epic 8: Advanced Features & Polish
## Overview
Add advanced features (OIDC, GraphQL, API Gateway), performance optimization, additional sample modules, and final polish and bug fixes.
Add advanced features (OIDC, GraphQL), performance optimization, additional sample feature services, and final polish and bug fixes.
**Note:** API Gateway is now in Epic 1 (Story 1.8) as core infrastructure, not an advanced feature.
## Stories
@@ -15,10 +17,10 @@ Add advanced features (OIDC, GraphQL, API Gateway), performance optimization, ad
- **Goal:** Add optional GraphQL API alongside REST API.
- **Deliverables:** GraphQL schema, resolvers, GraphQL endpoint
### 8.3 Additional Sample Modules
- [Story: 8.3 - Additional Modules](./8.3-additional-modules.md)
- **Goal:** Create additional sample modules to demonstrate different use cases.
- **Deliverables:** Notification module, Analytics module
### 8.3 Additional Sample Feature Services
- [Story: 8.3 - Additional Services](./8.3-additional-modules.md)
- **Goal:** Create additional sample feature services to demonstrate different use cases and patterns.
- **Deliverables:** Notification Service, Analytics Service (as independent services with their own entry points)
### 8.4 Final Polish and Optimization
- [Story: 8.4 - Final Polish](./8.4-final-polish.md)