Skip to content

izzywdev/FuzeInfra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

276 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FuzeInfra - Shared Infrastructure Platform

A comprehensive containerized shared infrastructure platform providing databases, monitoring, networking, and deployment tools for microservices development. Features include local DNS management, HTTPS certificates, tunnel management, and webhook automation.

✨ New Features

  • πŸ” Service Discovery (Consul) - Industry-standard service registration and discovery
  • 🌐 Local DNS Server (dnsmasq) with wildcard *.dev.local support
  • πŸ”’ HTTPS Certificates (mkcert) for all services with browser trust
  • πŸš‡ Cloudflare Tunnel integration for secure external access
  • πŸ”— Webhook Management with automatic URL updates for GitHub/Atlassian
  • πŸ“Š Comprehensive Monitoring with Prometheus, Grafana, and Loki
  • πŸ”§ Development Orchestrator with port allocation and clean URLs

πŸš€ Quick Start

FuzeInfra runs two ways β€” pick one:

A) Docker Compose (fastest local path)

  1. Clone repository: git clone --recursive https://github.com/izzywdev/FuzeInfra.git
  2. Set up environment: python scripts-tools/setup_environment.py
  3. Generate certificates: ./tools/cert-manager/setup-local-certs.sh
  4. Start infrastructure: ./infra-up.bat (Windows) or ./infra-up.sh (Linux/Mac)

Note: Use --recursive to automatically clone the envmanager submodule. If already cloned, run git submodule update --init --recursive.

B) Kubernetes on kind (production parity)

Mirrors the EKS/Contabo prod deployment locally. Prereqs: docker, kind, kubectl, helm.

make kind-up            # cluster + ingress + cert-manager + full chart
make kind-validate      # prove every enabled service is Ready + reachable
make kind-test          # functional smoke (pytest via port-forward)
make kind-down          # tear down

Windows (no make): .\k8s\kind\setup-kind.ps1. Deploy a subset with make kind-profile PROFILE=minimal. Full guide: docs/LOCAL_KUBERNETES.md.

πŸ“ Repository Structure

FuzeInfra/
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ templates/           # Project templates for applications
β”‚   └── PROJECT_TEMPLATES.md # How to use templates
β”œβ”€β”€ scripts-tools/           # Infrastructure management tools
β”œβ”€β”€ monitoring/              # Monitoring configurations
β”œβ”€β”€ monitoring-shared/       # Shared monitoring configs
β”œβ”€β”€ envmanager/              # Environment management submodule (git submodule)
β”œβ”€β”€ docker-compose.FuzeInfra.yml # Main infrastructure services
β”œβ”€β”€ environment.template     # Environment variables template
└── README.md

πŸ”§ Environment Configuration

First-time Setup

# Run the interactive environment setup script
python scripts-tools/setup_environment.py

The setup script will:

  • Create a .env file from the template
  • Generate secure passwords for all services
  • Allow customization of project settings
  • Provide security reminders

Manual Setup (Alternative)

# Copy the template and edit manually
cp environment.template .env
# Edit .env with your preferred settings

Key Environment Variables

  • COMPOSE_PROJECT_NAME: Project name (default: fuzeinfra)
  • NETWORK_NAME: Docker network name (default: FuzeInfra)
  • Database credentials and ports
  • Monitoring service credentials
  • Security keys and tokens

See environment.template for all available options.

πŸ—οΈ Infrastructure Services

Databases

  • PostgreSQL: localhost:5432 - Primary relational database
  • MongoDB: localhost:27017 - Document database
  • Redis: localhost:6379 - In-memory cache/store
  • Neo4j: localhost:7474 - Graph database
  • ChromaDB: localhost:8003 - Vector database for AI/ML applications

Service Discovery

  • Consul: http://localhost:8500 - Service registry with health checking and Web UI
  • Consul DNS: localhost:8600 - DNS interface for service queries

Monitoring & Observability

  • Grafana: http://localhost:3001 - Dashboards and visualization
  • Prometheus: http://localhost:9090 - Metrics collection
  • Loki: Log aggregation
  • Promtail: Log shipping

Message Queues

  • Kafka: localhost:9092 - Event streaming
  • RabbitMQ: localhost:5672 - Message broker

Workflow Orchestration

  • Airflow: localhost:8082 - Workflow orchestration and scheduling

Management UIs (HTTP & HTTPS)

New Service Features

  • πŸ” Service Discovery: Register and discover services dynamically with Consul
  • 🌐 DNS Server: Automatic *.dev.local domain resolution
  • πŸ”’ HTTPS Support: Trusted certificates for all services
  • πŸš‡ Tunnel Access: External webhook endpoints via Cloudflare
  • πŸ“ˆ Enhanced Monitoring: Complete observability stack

🎯 Using with Your Projects

1. Start Infrastructure

# Start shared infrastructure first
./infra-up.sh  # or infra-up.bat on Windows

2. Use Project Templates

Copy and customize project templates for your applications:

# Copy project startup scripts
cp docs/templates/project-up.sh.template ./your-project/project-up.sh
cp docs/templates/project-down.sh.template ./your-project/project-down.sh

# Customize for your project
# Edit PROJECT_NAME, ports, etc.

3. Connect Your Application

Your application's docker-compose.yml should use the external network:

version: '3.8'

networks:
  FuzeInfra:
    external: true

services:
  your-app:
    build: .
    networks:
      - FuzeInfra
    environment:
      - POSTGRES_HOST=postgres
      - REDIS_HOST=redis
      - MONGODB_HOST=mongodb
      - CHROMADB_HOST=chromadb

4. Service Discovery Integration

Register your service for discovery by other applications:

# Register your service with health checks
python tools/service-discovery/service-discovery.py register myproject \
  --port 3000 \
  --health-check /health \
  --tags api,web \
  --meta version=1.0.0

# Verify registration
python tools/service-discovery/service-discovery.py list

Discover other services dynamically (no hardcoded URLs):

// Node.js example - fuzereach discovering fuzeagent
const FuzeInfraServiceDiscovery = require('../FuzeInfra/tools/service-discovery/client-examples/nodejs-example.js');
const serviceDiscovery = new FuzeInfraServiceDiscovery();

// Dynamic service discovery
const fuzeagentUrl = await serviceDiscovery.getServiceUrl('fuzeagent');
const response = await fetch(`${fuzeagentUrl}/api/process`, { ... });
# Python example - FastAPI service discovery
from consul_helper import ConsulHelper
service_discovery = ConsulHelper()

# Discover service dynamically
fuzeagent_url = service_discovery.get_service_url('fuzeagent')
response = requests.post(f"{fuzeagent_url}/api/process", json=data)

Benefits:

  • βœ… No hardcoded service URLs
  • πŸ₯ Automatic health checking
  • βš–οΈ Load balancing across instances
  • 🌍 Works in Docker, local dev, and production

See tools/service-discovery/README.md for complete integration guide.

See docs/PROJECT_TEMPLATES.md and docs/PROJECT_INTEGRATION_GUIDE.md for detailed instructions.

πŸ› οΈ Management Tools

Infrastructure Management

  • ./infra-up.sh / ./infra-up.bat - Start infrastructure
  • ./infra-down.sh - Stop infrastructure

Environment Management

  • scripts-tools/env_manager.py - Manage environment variables
  • scripts-tools/setup_environment.py - Initial environment setup
  • envmanager/ - Advanced environment management submodule (cross-platform)

Version Management

  • scripts-tools/version_manager.py - Semantic versioning
  • scripts-tools/ci_cd_manager.py - CI/CD utilities

Service Discovery Management

  • tools/service-discovery/service-discovery.py - Service registration and discovery
  • tools/service-discovery/consul-helper.py - Consul wrapper for programmatic access
  • Client libraries: tools/service-discovery/client-examples/ - Node.js and Python integration

DNS and Network Management

  • tools/dns-manager/dns-manager.py - Local DNS management
  • tools/tunnel-manager/tunnel-manager.py - Webhook tunnel management
  • tools/cert-manager/setup-local-certs.sh - HTTPS certificate generation

Health Monitoring

  • docker/app/health_check.py - Infrastructure health checks
  • tools/tunnel-manager/webhook_sync.py - Webhook monitoring and sync

πŸ”’ Security Notes

  • Never commit the .env file - it contains sensitive credentials
  • Change default passwords before production use
  • Use the setup script to generate secure passwords
  • Consider using secrets management in production environments
  • The .env file is automatically added to .gitignore

πŸ›οΈ Architecture Principles

Shared Infrastructure Only

This repository contains only generic infrastructure services that can be shared across multiple applications:

  • Database services
  • Monitoring and logging
  • Message queues
  • Caching layers

Application Separation

  • Application-specific code belongs in separate repositories
  • Each application connects to shared infrastructure via the FuzeInfra network
  • Use project templates to maintain consistency

Network Architecture

All services communicate through the FuzeInfra Docker network, enabling:

  • Service discovery by name (e.g., postgres, redis)
  • Isolation from other Docker networks
  • Easy scaling and management

πŸ“Š Monitoring

The platform includes comprehensive monitoring:

  • System metrics: CPU, memory, disk usage
  • Service health: Database connectivity, message queue status
  • Application metrics: Custom metrics via Prometheus
  • Logs: Centralized logging via Loki/Promtail
  • Dashboards: Pre-built Grafana dashboards

πŸ§ͺ Testing Infrastructure

The repository includes a comprehensive test suite to verify all services are running correctly:

Quick Test Run

# Run complete test suite (recommended)
python scripts-tools/run_tests.py

Manual Testing

# Install test dependencies
pip install -r tests/requirements.txt

# Create network and start services
docker network create FuzeInfra
docker-compose -f docker-compose.FuzeInfra.yml up -d

# Run tests
pytest tests/ -v

# Cleanup
docker-compose -f docker-compose.FuzeInfra.yml down -v

Test Coverage

  • Database services: PostgreSQL, MongoDB, Redis, Neo4j, Elasticsearch
  • Messaging services: Kafka, RabbitMQ
  • Monitoring stack: Prometheus, Grafana, Alertmanager, Loki
  • Workflow orchestration: Airflow, Flower
  • Web interfaces: Mongo Express, Kafka UI, RabbitMQ Management

Continuous Integration

  • Tests run automatically on push to main branch
  • Docker images are cached in GitHub Container Registry
  • Full infrastructure validation in CI/CD pipeline

See tests/README.md for detailed testing documentation.

πŸ”„ Version Management

Current version: Check version.json

Use the version manager for releases:

cd scripts-tools
python version_manager.py current
python version_manager.py bump patch  # or minor, major

🀝 Contributing

  1. Keep infrastructure generic - no application-specific code
  2. Update templates when adding new infrastructure services
  3. Maintain backward compatibility
  4. Update documentation for new features
  5. Test with multiple projects to ensure generality

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Shared infrastructure platform for microservices development

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors