Skip to content
/ cmnw Public

CMNW - Intelligence Platform | A sophisticated microservices architecture specializing in Open Source Intelligence (OSINT), Data Market Analysis (DMA), and financial valuations.

License

Notifications You must be signed in to change notification settings

alexzedim/cmnw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3,673 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CMNW Logo

๐ŸŽฏ CMNW

Intelligence Always Wins

Website License Version

NestJS TypeScript PostgreSQL MongoDB Redis RabbitMQ Docker


๐Ÿ“– About

CMNW is a sophisticated NestJS-based microservices platform specializing in Open Source Intelligence (OSINT) and Data Market Analysis (DMA) for World of Warcraft. Built on a distributed architecture with 13 microservices and 7 shared libraries, CMNW provides comprehensive intelligence gathering, real-time market analytics, and advanced financial valuations using XVA-based pricing models.

๐ŸŽฏ Key Features

  • ๐Ÿ•ต๏ธ Advanced OSINT Capabilities: Comprehensive character and guild intelligence gathering with Battle.net API integration
  • ๐Ÿ“Š Real-Time Market Analysis: Auction house monitoring with historical price tracking and trend detection
  • ๐Ÿ’ฐ XVA Financial Valuations: Sophisticated pricing engine with risk assessment and portfolio analytics
  • ๐Ÿ”„ Distributed Job Processing: RabbitMQ-based message queuing with priority queues and dead letter exchanges
  • ๐Ÿณ Cloud-Native Architecture: Full Docker containerization with multi-platform support (ARM64 & x64)
  • ๐Ÿ”’ Enterprise Authentication: Battle.net OAuth and Discord OAuth integration via Passport
  • ๐Ÿ“ˆ Monitoring & Observability: Prometheus metrics, Loki logging, and Bull Board queue monitoring
  • ๐Ÿงช Comprehensive Testing: Jest unit tests, Playwright E2E tests, and extensive mock data

๐Ÿ—๏ธ Architecture

CMNW Ignition

Microservices Architecture Overview

๐Ÿงฉ Microservices

CMNW operates as a pnpm monorepo with 13 specialized microservices:

Service Port Description Key Features
๐ŸŽฏ Core 3000 Central management service Realms & Keys management, Authentication, System configuration
๐ŸŒ API Gateway 8080 REST API gateway Request routing, Swagger docs at /api/docs, Rate limiting
๐Ÿ•ต๏ธ OSINT 3000 Intelligence gathering 3 workers (characters, guilds, profile), Battle.net integration
๐Ÿ“Š DMA 3004 Data Market Analysis 2 workers (auctions, items), Real-time AH monitoring
๐Ÿ’ฐ Market 3002 Market operations XVA calculations, Contracts, Gold tracking, Evaluation
๐Ÿ‘ค Characters - Character management Player profiles, Statistics tracking, Entity indexing
๐Ÿฐ Guilds - Guild analytics Member tracking, Roster management, Activity logs
๐Ÿ“ˆ Analytics - Metrics aggregation Character/Guild/Market/Contract metrics services
๐Ÿ† Ladder - Ranking system Competitive rankings, Leaderboards
๐Ÿงช Tests - Testing infrastructure E2E tests, Mock data, Benchmarking
๐Ÿ“Š Warcraft Logs - Raid analytics Combat log parsing, Performance metrics
๐ŸŒ WoW Progress - Progress tracking Guild progression, Raid completion tracking
๐Ÿ’Ž Valuations - Financial modeling XVA calculations, Risk assessments, Portfolio analytics

๐Ÿ“š Shared Libraries

7 shared libraries provide common functionality across microservices:


๐Ÿ› ๏ธ Technology Stack

๐ŸŽฏ Backend Framework

  • NestJS 11.1.9 - Progressive Node.js framework
  • TypeScript 5.9.3 - Type-safe JavaScript development
  • Node.js >=24.0.0 - JavaScript runtime
  • RxJS 7.8.2 - Reactive programming with observables

๐Ÿ—„๏ธ Data Layer

  • PostgreSQL 17.4 - Primary relational database with SnakeNamingStrategy
  • MongoDB - Document store with Mongoose 9.0.1
  • Redis 7.4.3 - In-memory caching and session storage
  • TypeORM 0.3.28 - Database ORM with migration support

๐Ÿ”„ Message Queuing

  • RabbitMQ - Primary distributed message broker with @golevelup/nestjs-rabbitmq@7.1.1
  • BullMQ 5.66.0 - Redis-based job queue for secondary processing
  • Bull Board 6.15.0 - Queue monitoring dashboard

๐Ÿ”Œ External Integrations

  • @alexzedim/blizzapi 2.7.0 - Battle.net API client
  • Warcraft Logs API - Combat log analytics
  • Raider.IO API - Mythic+ and raid progress
  • AWS S3 - Object storage with @aws-sdk/client-s3@3.948.0

๐Ÿ” Authentication & Security

  • Passport 0.7.0 - Authentication middleware
  • Battle.net OAuth - Blizzard authentication
  • Discord OAuth - Discord integration via passport-discord@0.1.4

๐Ÿณ DevOps & Deployment

  • Docker - Containerization with multi-platform builds
  • GitHub Actions - CI/CD pipeline with self-hosted runners
  • pnpm 10.28.1 - Fast, disk space efficient package manager

๐Ÿ”ง Development Tools

  • Jest 30.2.0 - Testing framework with comprehensive coverage
  • Playwright 1.57.0 - End-to-end testing automation
  • ESLint & Prettier - Code quality and formatting
  • Swagger/OpenAPI - API documentation with @nestjs/swagger@11.2.3

๐Ÿ“Š Monitoring & Observability

  • Prometheus - Metrics collection with @willsoto/nestjs-prometheus@6.0.2
  • Loki - Log aggregation
  • Bull Board - Queue monitoring and management

๐Ÿš€ Quick Start

Prerequisites

  • Node.js >=24.0.0
  • pnpm >=10.0.0 (managed via corepack)
  • Docker & Docker Compose
  • PostgreSQL 17+
  • MongoDB (latest)
  • Redis 7.4+
  • RabbitMQ (latest)

Note: This project uses pnpm 10.28.1. The correct version is managed via corepack and specified in package.json.

๐Ÿ”ง Installation

# Clone the repository
git clone https://github.com/alexzedim/cmnw.git
cd cmnw

# Enable corepack for pnpm version management
corepack enable

# Install dependencies
pnpm install

# Copy environment configuration
cp .env.example .env
cp .env.docker.example .env.docker

๐Ÿณ Docker Development Setup

Start infrastructure services and microservices using Docker Compose:

# Start database services (PostgreSQL, MongoDB, Redis, RabbitMQ)
docker-compose -f docker-compose.db.yml up -d

# Start core services
docker-compose -f docker-compose.core.yml up -d

# Start OSINT services
docker-compose -f docker-compose.osint.yml up -d

# Start DMA services
docker-compose -f docker-compose.dma.yml up -d

# Start analytics services
docker-compose -f docker-compose.analytics.yml up -d

# Or start all development services
docker-compose -f docker-compose.dev.yml up -d

๐Ÿ› ๏ธ Local Development

# Build all microservices
pnpm build:all

# Start development server with watch mode
pnpm start:dev

# Run specific microservice
nest start core --watch
nest start api --watch
nest start osint --watch
nest start dma --watch
nest start market --watch

# Start with debug mode
pnpm start:debug

๐ŸŒ Access Points

After starting the services:


๐Ÿ’ผ Core Modules

๐Ÿ•ต๏ธ OSINT (Open Source Intelligence)

Comprehensive character and guild intelligence gathering with Battle.net API integration:

Architecture:

Key Features:

  • Character Analysis: Player profiles, equipment, achievements, professions
  • Guild Monitoring: Member tracking via guild-member.service.ts, roster management, activity logs
  • Raid Progress: Warcraft Logs and Raider.IO integration
  • Collection System: Character collection management via character-collection.service.ts

Services:

๐Ÿ“Š DMA (Data Market Analysis)

Real-time auction house monitoring and market intelligence:

Architecture:

  • 2 Specialized Workers: auctions.worker.ts, items.worker.ts
  • High-Frequency Updates: Real-time auction house snapshots
  • Historical Analysis: Price trend detection and forecasting

Key Features:

  • Price Tracking: Historical price analysis with technical indicators
  • Market Charts: Interactive price visualization
  • Cross-Realm Analysis: Server population and pricing comparisons
  • Commodity Monitoring: Server-wide commodity price tracking
  • Item Intelligence: Item metadata and pricing calculations

๐Ÿ’ฐ Market & Valuations Engine

Valuations Schema

XVA-based Pricing Engine Schema

Advanced financial modeling with XVA (X-Value Adjustments) calculations:

Services:

Key Features:

  • Risk Assessment: Credit, funding, and capital value adjustments
  • Price Discovery: Dynamic pricing based on market conditions
  • Portfolio Analytics: Multi-asset risk and return analysis
  • Crafting Economics: Disenchanting, milling, prospecting calculations via disenchanting.libs.ts, milling.libs.ts, prospecting.libs.ts

๐Ÿ“ˆ Analytics & Monitoring

Comprehensive metrics aggregation and monitoring:

Services:

Monitoring:

  • Prometheus Metrics: Custom metrics collection
  • Queue Monitoring: Bull Board dashboard at /queues
  • Worker Statistics: Real-time worker performance tracking via worker-stats.listener.ts

๐Ÿงช Testing

๐ŸŽฏ Test Suite

Comprehensive testing infrastructure with Jest 30.2.0 and Playwright 1.57.0:

# Run all tests
pnpm test

# Run tests with coverage
pnpm test:cov

# Run tests in watch mode
pnpm test:watch

# Run tests with debugging
pnpm test:debug

๐Ÿ“‹ Test Coverage

Extensive test suites with mock data:

๐Ÿงช Test Services

Dedicated testing microservice with:


๐Ÿš€ Deployment

๐Ÿ”„ CI/CD Pipeline

Automated deployment via GitHub Actions with self-hosted runners:

Workflows:

  • โœ… Docker Image Builds (ARM64 & x64)
  • โœ… Automated Testing (Jest + Playwright)
  • โœ… Security Scanning
  • โœ… Multi-environment Deployment
  • โœ… Container Registry Publishing

๐Ÿณ Production Deployment

1. Environment Setup:

# Configure production environment
cp .env.production .env

# Set deployment secrets
export ENC_PASSWORD="your_encryption_key"
export BNET_CLIENT_ID="your_client_id"
export BNET_CLIENT_SECRET="your_client_secret"

2. Container Registry:

# Build multi-platform images
docker buildx build --platform linux/amd64,linux/arm64 \
  -t ghcr.io/alexzedim/cmnw:6.10.9 \
  -t ghcr.io/alexzedim/cmnw:latest \
  --push .

# Pull images on production server
docker pull ghcr.io/alexzedim/cmnw:latest

3. Service Orchestration:

# Deploy infrastructure
docker-compose -f docker-compose.db.yml up -d

# Deploy core services
docker-compose -f docker-compose.core.yml up -d

# Deploy OSINT services
docker-compose -f docker-compose.osint.yml up -d

# Deploy DMA services
docker-compose -f docker-compose.dma.yml up -d

# Deploy analytics services
docker-compose -f docker-compose.analytics.yml up -d

4. Health Checks:

# Verify service health
curl http://localhost:8080/health
curl http://localhost:3000/health
curl http://localhost:3002/health
curl http://localhost:3004/health

๐Ÿ“š API Documentation

๐ŸŒ REST API Endpoints

The API Gateway (port 8080) provides comprehensive REST API access:

OSINT Endpoints:

  • GET /osint/character/:realm/:name - Character intelligence
  • GET /osint/guild/:realm/:name - Guild intelligence
  • GET /osint/realm/:slug - Realm information

DMA Endpoints:

  • GET /dma/auctions/:connectedRealmId - Auction house data
  • GET /dma/items/:itemId - Item market data
  • GET /dma/commodities - Commodity prices

Market Endpoints:

  • GET /market/contracts - Active contracts
  • GET /market/gold/:region - Gold prices
  • GET /market/evaluation/:itemId - Item evaluation

Queue Monitoring:

  • GET /queues - Bull Board dashboard
  • GET /queue/metrics - Queue metrics
  • GET /queue/workers - Worker status

๐Ÿ“– Interactive Documentation

Swagger/OpenAPI documentation available at:

The API documentation is automatically generated from NestJS decorators and includes:

  • ๐Ÿ“ Request/Response schemas
  • ๐Ÿ” Authentication requirements
  • ๐Ÿงช Interactive API testing
  • ๐Ÿ“Š Model definitions

๐Ÿ”ง Development Workflow

๐Ÿ“ฆ Package Management

# Install dependencies
pnpm install

# Add dependency to specific workspace
pnpm add <package> --filter @app/osint

# Update dependencies
pnpm update

# Clean install
pnpm clean-install

๐Ÿ—๏ธ Building

# Build all microservices
pnpm build:all

# Build specific service
nest build core
nest build api
nest build osint
nest build dma
nest build market

๐Ÿ” Code Quality

# Lint and fix code
pnpm lint

# Format code
pnpm format

# Type checking
tsc --noEmit

๐Ÿ› Debugging

# Start with debugger
pnpm start:debug

# Debug specific service
nest start osint --debug --watch

# Debug tests
pnpm test:debug

๐Ÿ“Š Monitoring & Observability

๐Ÿ“ˆ Metrics Collection

Prometheus Integration:

  • Custom metrics via @willsoto/nestjs-prometheus@6.0.2
  • Service health metrics
  • Queue performance metrics
  • Database connection pool metrics

Metrics Endpoints:

  • GET /metrics - Prometheus metrics
  • GET /health - Health check endpoint

๐Ÿ“ Logging

Structured Logging:

  • Centralized logging via @app/logger
  • Loki integration for log aggregation
  • Contextual logging with request tracing
  • Log levels: error, warn, info, debug, verbose

๐Ÿ” Queue Monitoring

Bull Board Dashboard:

  • Real-time queue monitoring at /queues
  • Job status tracking
  • Failed job inspection
  • Queue metrics and statistics
  • Worker performance monitoring

๐ŸŽฏ Worker Statistics

Real-time worker performance tracking:

  • Job processing rates
  • Success/failure ratios
  • Average processing times
  • Queue depth monitoring

๐Ÿค Contributing

We welcome contributions from developers experienced in:

  • ๐ŸŽฏ Microservices Architecture - NestJS, distributed systems
  • ๐Ÿ•ต๏ธ Intelligence Gathering Systems - OSINT, data aggregation
  • ๐Ÿ“Š Financial Data Analysis - XVA calculations, risk modeling
  • ๐ŸŽฎ Gaming API Integration - Battle.net, Warcraft Logs, Raider.IO
  • ๐Ÿ”’ Security & Authentication - OAuth, JWT, API security
  • ๐Ÿณ DevOps & Infrastructure - Docker, Kubernetes, CI/CD

๐Ÿ“‹ How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ› Issues & Feature Requests

  • ๐Ÿ› Bug Reports: Create an issue
  • ๐Ÿ’ก Feature Requests: Start a discussion
  • ๐Ÿ“– Documentation: Help improve our docs
  • ๐Ÿงช Testing: Expand test coverage

๐Ÿ“ Development Guidelines

  • Follow TypeScript best practices
  • Write comprehensive tests for new features
  • Update documentation for API changes
  • Use conventional commit messages
  • Ensure all tests pass before submitting PR

๐Ÿ“„ License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.


๐ŸŒŸ Built with โค๏ธ by @alexzedim

๐ŸŒ Website โ€ข ๐Ÿ› Issues โ€ข ๐Ÿ’ฌ Discussions โ€ข ๐Ÿฆ Twitter

"Intelligence Always Wins" ๐ŸŽฏ

About

CMNW - Intelligence Platform | A sophisticated microservices architecture specializing in Open Source Intelligence (OSINT), Data Market Analysis (DMA), and financial valuations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •