Skip to content

config-repo

centralised config repo

Overview

Complete Configuration Repository Structure
config-repo/
β”œβ”€β”€ application.yml                  # Global defaults
β”œβ”€β”€ shared/
β”‚   β”œβ”€β”€ base/
β”‚   β”‚   └── application.yml          # 🟒 Base profile (inherited by all)
β”‚   β”œβ”€β”€ postgres.yml                 # πŸ—ƒοΈ PostgreSQL configs
β”‚   β”œβ”€β”€ rabbitmq.yml                 # πŸ‡ RabbitMQ configs
β”‚   β”œβ”€β”€ elasticsearch.yml            # πŸ” Elasticsearch configs
β”‚   β”œβ”€β”€ redis.yml                    # πŸ›‘ Redis configs
β”‚   β”œβ”€β”€ monitoring.yml               # πŸ“Š Prometheus/Grafana/Loki
β”‚   └── vault.yml                    # πŸ” Vault integration
β”‚
β”œβ”€β”€ 🌐 gateway-service/              # API Gateway
β”‚   β”œβ”€β”€ application.yml              # Inherits shared/base
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Local dev (Port 8080, no auth)
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ UAT (Port 8080, UAT DB)
β”‚   └── application-prod.yml         # 🏭 Prod (HTTPS, prod DB)
β”‚
β”œβ”€β”€ πŸ’° payments-service/             # Payment Processing
β”‚   β”œβ”€β”€ application.yml              # Base transaction configs
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ H2 database, mock mode
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Sandbox payment gateway
β”‚   └── application-prod.yml         # 🏭 PCI-DSS compliant
β”‚
β”œβ”€β”€ πŸ“ˆ stockmarket-service/          # Market Data
β”‚   β”œβ”€β”€ application.yml              # Real-time feed configs
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Mock market data
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Test API endpoints
β”‚   └── application-prod.yml         # 🏭 Live market connections
β”‚
β”œβ”€β”€ πŸ›’ order-service/                # Order Management
β”‚   β”œβ”€β”€ application.yml              # Order validation rules
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ No inventory checks
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Partial inventory validation
β”‚   └── application-prod.yml         # 🏭 Strict validation
β”‚
β”œβ”€β”€ πŸ” discovery-service/            # Service Discovery
β”‚   β”œβ”€β”€ application.yml              # Registry config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Standalone mode
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Cluster mode
β”‚   └── application-prod.yml         # 🏭 Multi-zone deployment
β”‚
β”œβ”€β”€ βš™οΈ config-service/               # Config Server
β”‚   β”œβ”€β”€ application.yml              # Git repo config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Filesystem backend
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Git UAT repo
β”‚   └── application-prod.yml         # 🏭 Git prod + Vault
β”‚
β”œβ”€β”€ πŸ“¦ framework-commons/            # Shared Libraries
β”‚   β”œβ”€β”€ application.yml              # Common beans
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Debug logging
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Info logging
β”‚   └── application-prod.yml         # 🏭 Warn logging
β”‚
β”œβ”€β”€ πŸ‘₯ user-service/                 # User Management
β”‚   β”œβ”€β”€ application.yml              # Auth config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ In-memory auth
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ LDAP integration
β”‚   └── application-prod.yml         # 🏭 OAuth2 + MFA
β”‚
β”œβ”€β”€ πŸ†” kyc-service/                  # Identity Verification
β”‚   β”œβ”€β”€ application.yml              # ID check config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Mock verification
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Sandbox API
β”‚   └── application-prod.yml         # 🏭 Live ID checks
β”‚
β”œβ”€β”€ βœ‰οΈ notification-service/         # Notifications
β”‚   β”œβ”€β”€ application.yml              # Delivery config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Log to console
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Send to test envs
β”‚   └── application-prod.yml         # 🏭 Production SMTP
β”‚
β”œβ”€β”€ πŸ’³ wallet-service/               # Digital Wallet
β”‚   β”œβ”€β”€ application.yml              # Wallet config
β”‚   β”œβ”€β”€ application-local.yml        # πŸ–₯️ Fake balances
β”‚   β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Test blockchain
β”‚   └── application-prod.yml         # 🏭 Real transactions
β”‚
└── 🏦 core-banking/                 # Banking Core
    β”œβ”€β”€ application.yml              # Core banking config
    β”œβ”€β”€ application-local.yml        # πŸ–₯️ Simulated core
    β”œβ”€β”€ application-uat.yml          # πŸ§ͺ Banking sandbox
    └── application-prod.yml         # 🏭 Live core banking

Shared Configurations

The shared/ directory contains configurations that are shared across all services:

  • PostgreSQL (postgres.yml): Contains database credentials and service-specific database names (e.g., service-name-db).
  • RabbitMQ (rabbitmq.yml): Defines two queues per service (main queue and dead letter queue).
  • Elasticsearch (elasticsearch.yml): Configures unique indices for each service (e.g., service-name-{env:local}).
  • Redis (redis.yml): Shared Redis configurations.
  • Monitoring (monitoring.yml): Includes configurations for Grafana, Loki, and Prometheus.
  • Vault (vault.yml): HashiCorp Vault configurations for secure secret management.

Environment-Specific Configurations

Each service has the following environment-specific configuration files:

  • application-local.yml: Local development environment.
  • application-uat.yml: User Acceptance Testing (UAT) environment.
  • application-prod.yml: Production environment.

How to Use

  1. Spring Cloud Config Server: Point your Spring Cloud Config Server to this repository to serve configurations to your microservices.
  2. Environment Variables: Use environment variables to override sensitive values (e.g., database credentials, API keys).
  3. Shared Configurations: Leverage the shared/ directory for common configurations across services.

Monitoring and Observability

The repository includes configurations for monitoring and observability tools:

  • Grafana: Dashboard configurations for visualizing metrics.
  • Loki: Centralized logging configurations.
  • Prometheus: Metrics scraping configurations.

Security

  • HashiCorp Vault: Securely manage secrets such as database credentials, API keys, and tokens.

Contributing

Feel free to contribute to this repository by adding new configurations or improving existing ones. Ensure that all changes are tested in the appropriate environments.


This repository is a critical part of the infrastructure and ensures consistent and centralized configuration management for all microservices.