Skip to content

matias-devv/online-store-config-server

Repository files navigation

Config Server – Online Store

Overview

This repository contains the Spring Cloud Config Server for the online-store microservices ecosystem.


The Config Server acts as a centralized configuration authority, externalizing application configuration from individual microservices and enabling a cleaner, more scalable architecture aligned with enterprise best practices.


This project is intentionally minimal and infrastructure-focused, designed to support future growth without introducing unnecessary complexity at early stages.



Responsibilities

The Config Server is responsible for:

  • Centralizing configuration for all microservices in the online-store system

  • Loading configuration from a dedicated Git repository

  • Serving environment-agnostic configuration to services at startup

  • Acting as an internal infrastructure component (never exposed to clients)

  • Registering itself with the Service Discovery server (Eureka)


Important:

Microservices do not currently consume configuration from this server. It is implemented proactively to follow industry standards and prepare the architecture for future evolution.



Architecture Positioning

Client
  ↓
API Gateway
  ↓
Business Microservices
  ↓
──────────────────────────
Config Server (internal)
Service Discovery (Eureka)
──────────────────────────
  • The Config Server is not part of the business flow

  • It is not accessed directly by clients

  • It exists purely as a platform-level component

This separation is deliberate and aligns with traditional, proven microservice architectures.



Tech Stack

  • Java 17+

  • Spring Boot

  • Spring Cloud Config Server

  • Spring Cloud Netflix Eureka Client

  • Git-based configuration backend



Configuration Source

All configurations are stored in this repository:

  • Structure: one YAML file per microservice

Example structure:

config-data/
 ├── products-service.yml
 ├── shopping-carts-service.yml
 ├── users-service.yml

Each file is a direct conversion from the microservice’s original application.properties to YAML format.



application.yml (Config Server)

server:
  port: 8081

spring:
  application:
    name: config-server

  cloud:
    config:
      server:
        git:
          uri: https://github.com/matias-devv/repository-config-server.git
          search-paths: config-data
          username: ${GIT_USERNAME}
          password: ${GIT_PASSWORD}

Notes

  • Git credentials are injected via environment variables
  • No hardcoded sensitive data is stored in the repository
  • No profiles are currently used


Main Class

@SpringBootApplication
@EnableDiscoveryClient
@EnableConfigServer
public class ConfigServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigServerApplication.class, args);
    }
}

Enabled Features

  • @EnableConfigServer: activates Config Server capabilities
  • @EnableDiscoveryClient: registers the service in Eureka


Service Discovery

  • The Config Server registers successfully with Eureka

  • Discovery is enabled but not actively used at this stage

  • This is a forward-looking decision to ensure compatibility with:

    • dynamic environments
    • cloud-native deployments
    • future scaling strategies


Security Considerations

Current state:

  • No encryption

  • No authentication filters

  • No secret management

Rationale:

This project is intentionally kept simple and transparent, focusing on:

  • architectural correctness

  • separation of concerns

  • learning objectives

Security hardening is planned for future iterations.



Why This Design

This Config Server exists because:

  • Centralized configuration is a long-standing enterprise standard

  • It decouples infrastructure from business logic

  • It prepares the system for:

    • multiple environments

    • configuration changes without redeployments

    • scalable DevOps workflows

Even if not consumed yet, its presence signals architectural maturity.



Future Improvements

Potential enhancements:

  • Microservices consuming config at startup

  • Environment-specific profiles

  • Encryption of sensitive values

  • Spring Cloud Bus for dynamic refresh

  • Role-based access to configuration



Scope Disclaimer

This repository:

  • Is infrastructure-only

  • Contains no business logic

  • Is intentionally minimal by design

Simplicity here is a strategic decision, not a limitation.



Author

Matias

Backend Java Developer



Status

✔ Stable

✔ Production-architecture ready

✔ Designed for future extensibility

About

Centralized Spring Cloud Config Server for the online-store microservices ecosystem. Infrastructure-focused service that externalizes configuration, enforces clean separation of concerns, and prepares the architecture for scalable, enterprise-grade growth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages