Skip to main content

Service Dependencies

This document provides a comprehensive overview of service dependencies, event publishing, API consumption, and event subscriptions across the ReptiDex platform’s 6 consolidated services.
Architecture: 6 consolidated services with database-per-service isolation
Communication: REST APIs + Event-driven via AWS SNS/SQS
Dependencies: Foundation service (repti-core) supports all domains

Consolidated Services

repti-core

Purpose: Foundation service for authentication, configuration, billing, events, and telemetry
Port: 8001
Database: repti_core_db
External Dependencies:
  • Stripe/PayPal (payment processing)
  • AWS KMS (key management)
  • Email/SMS providers (via integrations)
  • AWS SNS/SQS (event infrastructure)
Publishes Events:
  • auth.user.created, auth.user.updated, auth.session.*
  • org.created, org.updated, org.member.*
  • config.updated, config.feature.toggled
  • billing.subscription.*, billing.invoice.*
  • events.published, telemetry.tracked
API Dependencies: None (foundation service) Event Subscriptions:
  • All service events (for telemetry and audit)
  • System health events (for monitoring)

repti-animal

Purpose: Animal registry, lineage tracking, genetics, and breeding management
Port: 8002
Database: repti_animal_db
External Dependencies: None (internal business logic) Publishes Events:
  • animal.created, animal.updated, animal.transferred
  • lineage.updated, lineage.validated, pedigree.generated
  • breeding.paired, breeding.clutch.*, breeding.offspring.*
  • genetics.prediction.*, genetics.trait.*
  • taxonomy.species.*, taxonomy.morph.*
API Dependencies:
  • repti-core (authentication, configuration)
Event Subscriptions:
  • auth.user.created (setup initial data)
  • org.member.added (access control updates)
  • media.uploaded (animal photo attachments)

repti-commerce

Purpose: Marketplace, sales transactions, and inventory management
Port: 8003
Database: repti_commerce_db
External Dependencies:
  • Payment processing (via repti-core)
Publishes Events:
  • marketplace.listing.*, marketplace.search.*
  • sales.inquiry.*, sales.transaction.*
  • inventory.reserved, inventory.transferred, inventory.available
  • order.created, order.updated, order.completed
API Dependencies:
  • repti-core (authentication, billing)
  • repti-animal (product data, ownership validation)
Event Subscriptions:
  • animal.created (auto-create inventory)
  • animal.transferred (update ownership)
  • billing.subscription.updated (access control)
  • payment.completed (order fulfillment)

repti-media

Purpose: File storage, rendering, embeds, and content management
Port: 8004
Database: repti_media_db
External Dependencies:
  • AWS S3 (file storage)
  • CDN services (content delivery)
Publishes Events:
  • file.uploaded, file.processed, file.deleted
  • render.pedigree.*, render.chart.*, render.export.*
  • embed.widget.*, embed.profile.*
  • content.updated, content.published
API Dependencies:
  • repti-core (authentication, configuration)
Event Subscriptions:
  • animal.created (auto-generate placeholders)
  • lineage.updated (re-render pedigree charts)
  • profile.updated (refresh embedded widgets)

repti-community

Purpose: Search, notifications, community features, and advertising
Port: 8005
Database: repti_community_db
External Dependencies:
  • Email/SMS providers (notifications)
  • Search indexing services
Publishes Events:
  • search.indexed, search.query.*
  • notification.sent, notification.delivered
  • community.post.*, community.interaction.*
  • advertising.campaign.*, advertising.impression.*
API Dependencies:
  • repti-core (authentication, configuration)
  • repti-animal (search content indexing)
Event Subscriptions:
  • animal.created (index for search)
  • marketplace.listing.created (index for discovery)
  • profile.updated (update search data)
  • breeding.clutch.created (community notifications)

repti-ops

Purpose: Administrative tools, audit logging, integrations, and system monitoring
Port: 8006
Database: repti_ops_db
External Dependencies:
  • Grafana (monitoring and alerting)
  • Third-party integration APIs
Publishes Events:
  • admin.action.*, admin.moderation.*
  • audit.logged, audit.compliance.*
  • integration.sync.*, integration.error.*
  • monitoring.alert.*, monitoring.health.*
API Dependencies:
  • repti-core (authentication, events access)
Event Subscriptions:
  • All service events (for audit logging)
  • System events (for monitoring and alerting)
  • User actions (for compliance tracking)

Dependency Patterns

Foundation Service Pattern

All services depend on repti-core as the foundation service:
  • Authentication & Authorization: JWT tokens, user context, RBAC
  • Configuration Management: Feature flags, service configuration
  • Event Orchestration: Event publishing and coordination
  • Billing Integration: Subscription and payment processing
  • Telemetry Collection: Monitoring and observability data

Service Interaction Patterns

Real-time API Calls:
  • User-facing operations requiring immediate response
  • Cross-service data validation and retrieval
  • Administrative operations and health checks
  • Service-to-service authentication validation
Common API Patterns:
  • repti-animalrepti-core (auth validation, config)
  • repti-commercerepti-animal (product data, ownership)
  • repti-mediarepti-core (auth, file permissions)
  • repti-communityrepti-animal (search indexing data)
Event-Driven Processing:
  • Cross-domain data synchronization
  • Business process workflows
  • Audit and compliance logging
  • Search indexing and caching
Event Categories:
  • Core Events: Authentication, configuration, billing
  • Business Events: Animals, lineage, breeding, genetics
  • Commerce Events: Marketplace, transactions, inventory
  • Media Events: File processing, rendering, embeds
  • Community Events: Search, notifications, engagement
  • System Events: Admin actions, audit, monitoring

External Integration Patterns

  • Payment Processing: Stripe/PayPal integration via repti-core
  • File Storage: AWS S3 integration via repti-media
  • Notifications: Email/SMS providers via repti-community
  • Monitoring: Grafana integration via each service
  • Authentication: Optional OAuth IdPs via repti-core

Service Dependency Graph

Event Flow Examples

User Registration Flow

Animal Sale Transaction Flow


Database Dependencies

Database-Per-Service Isolation

Each service owns its database completely:
ServiceDatabasePurpose
repti-corerepti_core_dbAuth, config, billing, events, telemetry
repti-animalrepti_animal_dbAnimals, lineage, genetics, breeding
repti-commercerepti_commerce_dbMarketplace, sales, transactions
repti-mediarepti_media_dbFile metadata, rendering jobs
repti-communityrepti_community_dbSearch indexes, notifications
repti-opsrepti_ops_dbAdmin tools, audit logs, monitoring

Cross-Service Data Access Rules

  • No Direct Database Access: Services can only access their own database
  • API-Only Integration: Cross-service data via REST APIs
  • Event-Driven Sync: Data consistency via event publishing
  • Service Ownership: Each service owns its domain data completely

This dependency mapping reflects our consolidated 6-service architecture optimized for operational simplicity while maintaining proper service boundaries and data isolation.