Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

122 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BC Container Manager

Electron + TypeScript desktop app for Dynamics 365 Business Central Docker containers with Claude AI troubleshooting, one-click deployment, and PowerShell integration.

Release Build Electron Next.js TypeScript License Stars Issues Last Commit

Desktop app for:

  • 🐳 Business Central container lifecycle management
  • πŸ“Š Real-time log viewing and diagnostics
  • πŸ’Ύ Automated backup operations
  • πŸ€– AI-powered troubleshooting (Claude API)
  • ⚑ One-click deployment via Install-BC-Helper.ps1

πŸš€ Quick Start

Prerequisites

Component Requirement
OS Windows 10/11
Docker Docker Desktop for Windows
Node.js 18+ (for development)
PowerShell 7.0+ (bundled scripts)
Optional Anthropic API key (AI features)

Download & Install

Option 1: Run Installer (Recommended)

# Download from GitHub Releases
# Run: BC Container Manager-Setup-1.0.0.exe
# Follow installation wizard

Option 2: Portable Executable

# Download: BC Container Manager-Portable-1.0.0.exe
# Run directly without installation

Development Setup

# Clone repository
git clone https://github.com/azullus/bc-docker-manager.git
cd bc-docker-manager

# Install dependencies
npm install

# Run Electron app in development mode
npm run electron:dev

# Or run as web app only
npm run dev

πŸ“Έ Screenshots

Dashboard

The main dashboard displays all Business Central containers with real-time status monitoring. View total containers, running/stopped counts, and backup statistics at a glance. Quick actions for Stop, Restart, Open BC, and container Details.

Dashboard

Docker Setup

Prerequisites checker validates your environment before container deployment. Monitors Docker Engine status, BcContainerHelper module, Hyper-V, WSL 2, and system memory requirements. Quick links to documentation resources.

Docker Setup

Create Container

One-click container deployment with version selection. Configure container name, authentication mode, and options like Test Toolkit and scheduled backups. Real-time deployment output panel shows progress.

Create Container

Choose from the latest stable release, preview versions, or specific BC versions (BC 13 through BC 27).

Version Selection

Backups

Centralized backup management interface. Track total backups, storage usage, and view the most recent backup date. Create new backups with one click, restore from any backup, and delete old backups. Backups grouped by container.

Backups

AI Troubleshooting

Claude-powered troubleshooting assistant for Business Central container issues. Quick action buttons for common problems: startup failures, performance issues, license problems, and extension errors. Context-aware suggestions based on your container configuration.

AI Troubleshooting

Settings

Configure your BC Container Manager preferences. Set your Anthropic API key for AI features, specify backup directory location, and adjust dashboard refresh intervals. Includes Docker diagnostics tools and app version info.

Settings


πŸ—οΈ Architecture

Electron Desktop App

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Electron Main Process           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   electron/main.js              β”‚   β”‚
β”‚  β”‚   - Window management           β”‚   β”‚
β”‚  β”‚   - IPC handlers                β”‚   β”‚
β”‚  β”‚   - PowerShell execution        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚              ↕ IPC                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Renderer Process (Next.js)    β”‚   β”‚
β”‚  β”‚   - React components            β”‚   β”‚
β”‚  β”‚   - UI/UX                        β”‚   β”‚
β”‚  β”‚   - Client-side logic           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         ↕                    ↕
   Docker API          PowerShell Scripts

Key Files:

  • electron/main.js - Electron entry point, window creation
  • electron/preload.js - Secure IPC bridge
  • electron/ipc-handlers.js - Backend operations (Docker, backups, AI)
  • lib/electron-api.ts - Unified API for renderer process

Dual-Mode Support

The app works in two modes:

  1. Electron Mode (Desktop) - Uses IPC for Docker/PowerShell operations
  2. Web Mode (Fallback) - Uses Next.js API routes via fetch

✨ Features

Container Management

  • Dashboard View - All BC containers at a glance
  • Status Monitoring - Real-time container state
  • Quick Actions - Start, stop, restart, remove with one click
  • Port Mappings - View exposed ports and services
  • Resource Stats - CPU, memory, network usage

Log Viewer

  • Real-time Streaming - Live container logs
  • Search & Filter - Find specific log entries
  • Export - Save logs to file for analysis
  • Color-coded - Error/warning/info highlighting

Backup Management

  • Automated Backups - Schedule container backups
  • Backup Browser - View all existing backups
  • Restore Operations - Restore from backup
  • Retention Policy - Auto-delete old backups
  • Size Tracking - Monitor backup disk usage

AI Troubleshooting

Powered by Claude API:

  • Diagnose container startup failures
  • Suggest fixes for common BC issues
  • License troubleshooting assistance
  • Extension deployment guidance
  • Performance optimization tips

Context-aware: AI has knowledge of Business Central Docker architecture and common issues.

One-Click Deployment

Integrated PowerShell deployment:

# Bundled script: scripts/Install-BC-Helper.ps1
# Deploys BC containers with:
- Automatic version selection
- License import
- Port configuration
- Database initialization

πŸ“‚ Project Structure

bc-docker-manager/
β”œβ”€β”€ electron/
β”‚   β”œβ”€β”€ main.js              # Electron main process
β”‚   β”œβ”€β”€ preload.js           # IPC bridge (secure)
β”‚   β”œβ”€β”€ ipc-handlers.js      # Backend operations
β”‚   └── rag-helper.js        # RAG integration for offline AI
β”‚
β”œβ”€β”€ app/                     # Next.js App Router
β”‚   β”œβ”€β”€ dashboard/page.tsx   # Container list view
β”‚   β”œβ”€β”€ setup/page.tsx       # Docker prerequisites checker
β”‚   β”œβ”€β”€ create/page.tsx      # Container creation wizard
β”‚   β”œβ”€β”€ container/page.tsx   # Container details view
β”‚   β”œβ”€β”€ backups/page.tsx     # Backup management
β”‚   β”œβ”€β”€ troubleshoot/page.tsx # AI chat interface
β”‚   β”œβ”€β”€ settings/page.tsx    # App configuration
β”‚   └── layout.tsx           # Main layout with sidebar
β”‚
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ContainerCard.tsx    # Container display component
β”‚   β”œβ”€β”€ LogViewer.tsx        # Real-time log viewer
β”‚   β”œβ”€β”€ AIChat.tsx           # AI chat interface
β”‚   β”œβ”€β”€ DeploymentModal.tsx  # Container creation dialog
β”‚   β”œβ”€β”€ HNSErrorRecovery.tsx # HNS error recovery UI
β”‚   β”œβ”€β”€ NetworkDiagnostics.tsx # Network health diagnostics
β”‚   β”œβ”€β”€ ErrorBoundary.tsx    # React error boundary
β”‚   β”œβ”€β”€ Sidebar.tsx          # Navigation menu
β”‚   └── Providers.tsx        # React context providers
β”‚
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ electron-api.ts      # Unified API layer
β”‚   β”œβ”€β”€ docker-api.ts        # Docker Engine API (web mode)
β”‚   β”œβ”€β”€ ai-client.ts         # Claude API integration
β”‚   β”œβ”€β”€ hns-error-detector.ts # HNS error pattern detection
β”‚   β”œβ”€β”€ types.ts             # TypeScript interfaces
β”‚   └── deployment-context.tsx # Deployment state management
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ Deploy-BC-Container.ps1  # Direct Docker deployment (primary)
β”‚   β”œβ”€β”€ Install-BC-Helper.ps1    # BcContainerHelper deployment (legacy)
β”‚   β”œβ”€β”€ Fix-HNS-State.ps1        # HNS cleanup script
β”‚   β”œβ”€β”€ Diagnose-HNS-Ports.ps1   # Network diagnostics
β”‚   β”œβ”€β”€ Backup-BC-Container.ps1  # Backup operations
β”‚   └── Restore-BC-Container.ps1 # Restore operations
β”‚
β”œβ”€β”€ screenshots/             # Application screenshots
β”‚   β”œβ”€β”€ dashboard.png
β”‚   β”œβ”€β”€ docker-setup.png
β”‚   β”œβ”€β”€ create-container.png
β”‚   β”œβ”€β”€ create-container-versions.png
β”‚   β”œβ”€β”€ backups.png
β”‚   β”œβ”€β”€ troubleshoot.png
β”‚   └── settings.png
β”‚
β”œβ”€β”€ electron-builder.yml     # Electron build configuration
β”œβ”€β”€ package.json             # Dependencies and scripts
└── README.md                # This file

πŸ”§ Configuration

Application Settings

Settings stored in: %APPDATA%/bc-container-manager/settings.json

{
  "anthropicApiKey": "sk-ant-...",
  "backupRoot": "C:\\BCBackups",
  "autoRefreshInterval": 5000,
  "defaultContainerPrefix": "bcserver"
}

Environment Variables (Development)

Create .env.local for development:

# Anthropic API key (optional, for AI features)
ANTHROPIC_API_KEY=sk-ant-your-key-here

# Backup directory
BACKUP_ROOT=C:\BCBackups

# Docker socket (default for Windows)
DOCKER_HOST=//./pipe/docker_engine

🎯 Usage

Creating a Container

  1. Click "New Container" button
  2. Select BC version (Latest, LTS, Specific)
  3. Configure:
    • Container name
    • License file (optional)
    • Ports (Web Client, SOAP, OData, DEV)
    • Authentication mode
  4. Click "Deploy" to run Install-BC-Helper.ps1
  5. Monitor deployment progress in real-time

Managing Containers

Start/Stop:

  • Click power icon on container card
  • Or use bulk actions from dashboard

View Logs:

  • Click container name β†’ Logs tab
  • Search for errors or specific text
  • Export to file for analysis

Create Backup:

  • Container Details β†’ Backups
  • Click "Create Backup"
  • Specify backup name and location

AI Troubleshooting

  1. Navigate to Troubleshoot page
  2. Describe your issue in chat
  3. AI provides context-aware suggestions
  4. Follow recommended fixes
  5. Run suggested PowerShell commands if needed

Example queries:

  • "Container won't start after restart"
  • "Getting license error on login"
  • "Web client shows 404 error"
  • "How do I import a BC extension?"

πŸ› οΈ Development

Available Scripts

# Development (web only)
npm run dev              # Start Next.js dev server

# Development (Electron)
npm run electron:dev     # Start Electron + Next.js

# Building
npm run build            # Build Next.js static export
npm run electron:build:win      # Build Windows installer
npm run electron:build:portable # Build portable .exe

# Testing
npm test                 # Run Jest tests
npm run test:coverage    # With coverage report
npm run lint             # ESLint validation

Build Output

After running npm run electron:build:win:

dist/
β”œβ”€β”€ BC Container Manager-Setup-1.0.0.exe    # Installer (147 MB)
β”œβ”€β”€ BC Container Manager-Portable-1.0.0.exe # Portable (145 MB)
└── win-unpacked/                            # Unpacked app files

🐳 Container Naming Convention

The app filters for containers with names containing bc (case-insensitive).

Compatible naming:

  • mybc-test
  • bcserver-dev
  • bc-production
  • sandbox-bc25

Create with BcContainerHelper:

New-BcContainer -containerName "mybc-dev" `
    -artifactUrl (Get-BcArtifactUrl -type Sandbox -version "25.0") `
    -accept_eula

πŸ§ͺ Testing

# Run all tests
npm test

# Watch mode
npm test -- --watch

# Coverage report
npm run test:coverage

Test suites:

  • __tests__/components/ - React component tests
  • __tests__/lib/ - Utility function tests

πŸ“‘ API Reference

IPC Channels (Electron Mode)

Channel Description Parameters
docker:list List containers -
docker:start Start container containerId
docker:stop Stop container containerId
docker:logs Get logs containerId, tail
powershell:run Execute script scriptPath, args
backup:create Create backup containerId, path
ai:chat Send AI message message, history

REST Endpoints (Web Mode)

Fallback API routes for non-Electron usage:

Endpoint Method Description
/api/containers GET List all containers
/api/containers POST Container action
/api/logs GET Container logs
/api/backups GET List backups
/api/backups POST Create backup
/api/ai POST AI chat

πŸ”’ Security

  • IPC Isolation: Context isolation enabled in Electron
  • No eval(): Secure script execution via spawn
  • API Keys: Stored encrypted in %APPDATA%
  • Docker Socket: Local access only (no remote exposure)

πŸ”§ Troubleshooting

Application Won't Start

Issue: Double-clicking the executable shows error or nothing happens

Solutions:

  1. Missing Dependencies

    # Check Node.js version
    node --version  # Should be 18.0.0 or higher
    
    # Check if Docker Desktop is running
    docker info
  2. Electron Build Issues

    # Clear build cache
    rm -rf node_modules .next dist
    npm install
    npm run build
  3. Port Conflict (Dev Mode)

    • Default port 3000 may be in use
    • Fix: Kill process or change port in package.json
    # Find process using port 3000
    netstat -ano | findstr :3000
    # Kill process (replace PID)
    taskkill /PID <process_id> /F

Docker Connection Issues

Issue: "Cannot connect to Docker daemon" error

Solutions:

  1. Docker Desktop Not Running

    # Check Docker status
    docker ps
    
    # If error, start Docker Desktop
    # Windows: Start menu β†’ Docker Desktop
  2. Docker Pipe Permissions

    # Test pipe access
    [System.IO.Directory]::GetFiles("\\.\pipe\") | Select-String docker
    
    # Should show: docker_engine
    • Fix: Restart Docker Desktop
    • Fix: Add user to docker-users group (Windows)
  3. WSL2 Backend Issues

    • If using WSL2 backend
    • Fix: wsl --update and restart Docker

Container Management Errors

Issue: Containers not appearing in dashboard

Solutions:

  1. Filter Pattern Mismatch

    • App filters for containers with names containing bc
    • Fix: Rename containers to include "bc" in the name:
    docker rename old-name mybc-container
  2. Container Status Polling Failed

    • Check Docker API accessibility
    docker ps --format "{{.Names}}"
    • If works in CLI but not app, check IPC handlers
  3. Refresh Dashboard

    • Click refresh icon or restart app
    • Keyboard shortcut: F5 (if implemented)

AI Troubleshooting Not Working

Issue: AI chat returns errors or no response

Solutions:

  1. Missing API Key

  2. API Key Invalid

    # Test API key manually
    curl https://api.anthropic.com/v1/messages \
      -H "x-api-key: YOUR_KEY" \
      -H "anthropic-version: 2023-06-01"
    • Fix: Regenerate key in Anthropic Console
  3. Rate Limiting

    • Anthropic free tier: Limited requests/minute
    • Fix: Wait 60 seconds or upgrade plan
  4. Network Issues

    • Corporate firewall may block api.anthropic.com
    • Fix: Use VPN or whitelist domain

PowerShell Script Failures

Issue: Install-BC-Helper.ps1 fails or doesn't run

Solutions:

  1. Execution Policy

    # Check current policy
    Get-ExecutionPolicy
    
    # Allow script execution (as Admin)
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  2. Missing BcContainerHelper Module

    # Install module
    Install-Module BcContainerHelper -Force
    
    # Verify installation
    Get-Module BcContainerHelper -ListAvailable
  3. Script Path Issues

    • Scripts bundled in scripts/ folder
    • Fix: Use absolute paths in IPC calls
  4. Admin Privileges Required

    • Some Docker operations need admin
    • Fix: Run app as administrator (right-click β†’ Run as administrator)

Backup/Restore Issues

Issue: Backup creation fails or restore doesn't work

Solutions:

  1. Backup Path Not Writable

    # Test backup directory permissions
    Test-Path "C:\BC-Backups" -PathType Container
    New-Item -Path "C:\BC-Backups\test.txt" -ItemType File
    • Fix: Choose different backup location in Settings
  2. Container Not Running

    • Cannot backup stopped container
    • Fix: Start container first, then backup
  3. Insufficient Disk Space

    # Check free space
    Get-PSDrive C | Select-Object Used,Free
    • Fix: Free up space or choose different drive
  4. Restore Overwrites Warning

    • App should warn before overwriting
    • Workaround: Manually rename container before restore

Build Errors

Issue: npm run build or npm run electron:build fails

Solutions:

  1. Dependency Issues

    # Clear npm cache
    npm cache clean --force
    rm -rf node_modules package-lock.json
    npm install
  2. TypeScript Errors

    # Run type check
    npx tsc --noEmit
    
    # Common fix: Update types
    npm install --save-dev @types/node@latest @types/react@latest
  3. Next.js Build Fails

    # Check for syntax errors
    npm run lint
    
    # Build with verbose output
    npm run build -- --debug
  4. Electron Builder Fails

    • Windows: Requires electron-builder dependencies
    # Install Windows build tools
    npm install --global windows-build-tools

Logs and Debugging

Check Application Logs:

# Electron dev console
# Press F12 in app to open DevTools

# Check Next.js logs
npm run dev  # Shows server-side errors

# Check Electron main process logs
# Look in terminal where app was launched

Enable Verbose Logging:

# Set environment variable before launching
$env:DEBUG="*"
npm run electron:dev

Common Log Locations:

  • Electron logs: %APPDATA%/bc-container-manager/logs/
  • Backup logs: Check backup directory for .log files

πŸ“¦ Technologies

Layer Technology
Desktop Electron Latest
Framework Next.js 14 (App Router)
Language TypeScript 5
Styling Tailwind CSS 3
Docker API Native IPC to PowerShell/Docker
AI Anthropic Claude API
Build electron-builder
Testing Jest + React Testing Library

πŸ”— Related Projects

PowerShell & Automation

  • cosmicbytez-ops-toolkit - PowerShell automation suite with Install-BC-Helper.ps1 and Docker management scripts
  • CosmicPing - .NET 8 C# network diagnostic tool for IT operations

Infrastructure & Deployment

Security Operations


πŸ“ License

MIT License - See LICENSE.txt for details.


Built by CosmicBytez for Business Central DevOps | Windows Desktop | Docker Orchestration

About

Electron + TypeScript desktop app for Dynamics 365 Business Central Docker containers with Claude AI troubleshooting, one-click deployment, and PowerShell integration.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages