Skip to content

arindam31/microservices_config_management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infra Microservice Demo

A demo microservices project showcasing a central backend service managing multiple services with centralized configuration, CLI deployment, and repository patterns.


Overview

This project runs 3 microservices:

  1. Backend Service – The main service that:

    • Manages configurations in MongoDB
    • Provides REST aggregator endpoints
    • Implements repository layer and protocol abstractions
    • Includes CLI tools for environment management and deployment
  2. Users Service – Handles user data and profiles.

  3. Orders Service – Manages order data for users.


Features

  • Centralized configuration management via MongoDB
  • CLI tools (create-env, edit-env, list-envs, deploy)
  • Environment-aware deployments (dev, demo, staging, prod)
  • Dockerized setup for local demo
  • Repository and protocol pattern for clean code separation

Prerequisites

  • Docker and Docker Compose installed

  • Python 3.12+ (for running CLI tools)

  • MongoDB is containerized via Docker (no local installation required)

  • A .env file must exist inside backend folder (imagine multi machines for staging, demo or testing) with the following values

    • CONFIG_DB_URL=mongodb://mongo:27017
    • CONFIG_DB_NAME=backend_config
    • CONFIG_DB_COLLECTION=configs
    • ENV=dev

Installation

  1. Clone the repository:
git clone <repo_url>
cd FastApi_BE/backend

Create and activate a virtual environment:

python -m venv .venv .venv\Scripts\activate # Windows

or

source .venv/bin/activate # Linux/macOS

Running the Project (Docker Only)

docker compose up -d

This starts:

  • Backend service
  • Users service
  • Orders service
  • MongoDB

Project Structure

FastApi_BE/
├── backend/                 # FastAPI backend service
│   ├── config_loader.py     # Loads configuration from MongoDB or .env
│   ├── models.py            # Pydantic models for Config & FeatureFlags
│   ├── repository/          # Mongo repository layer
│   ├── protocols.py         # Protocol definitions for repo
│   ├── Dockerfile           # Backend Dockerfile
│   └── main.py              # FastAPI routes
├── docs                     # Documents Folder
├── docker-compose.yml       # Docker Compose for all services
├── requirements.txt         # Python dependencies
└── README.md                # Project documentation

About

A project that shows how we can manage configurations of projects as services

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors