Skip to content

Conversation

@tariqksoliman
Copy link
Member

Closes #749

With Claude (bedrock)

Overview

This PR implements a flexible plugin system that allows MMGIS to support multiple private
backend and tool directories through wildcard pattern matching. Previously, MMGIS only
supported single hardcoded directories for private plugins (/API/MMGIS-Private-Backend and
/src/essence/MMGIS-Private-Tools). This enhancement enables teams to maintain multiple
plugin sources from different repositories while keeping them gitignored.

Changes Made

  1. Backend Plugin System (API/setups.js)
  • Modified getBackendSetups() to dynamically discover and load all directories matching
    patterns:
    • Private-Backend (e.g., My-Private-Backend, MMGIS-Private-Backend)
    • Plugin-Backend (e.g., NASA-Plugin-Backend, Custom-Plugin-Backend-v2)
  • Added informative logging when plugins are loaded
  • Maintains backward compatibility with existing MMGIS-Private-Backend
  1. Tool Plugin System (API/updateTools.js)
  • Modified updateTools() to dynamically discover and load all directories matching patterns:
    • Private-Tools (e.g., My-Private-Tools, MMGIS-Private-Tools)
    • Plugin-Tools (e.g., NASA-Plugin-Tools, Mission-Plugin-Tools-v2)
  • Added informative logging when tools are loaded
  • Maintains backward compatibility with existing MMGIS-Private-Tools
  1. Git Configuration (.gitignore)
  • Added wildcard patterns to automatically ignore all plugin directories:
    /API/*Private-Backend*
    /API/*Plugin-Backend*
    /src/essence/*Private-Tools*
    /src/essence/*Plugin-Tools*
  1. Documentation Updates
  • README.md: Added new "Plugins" section explaining the plugin system
  • CONTRIBUTING.md: Added comprehensive plugin development instructions for both tools and
    backends
  • Documentation Site: Added plugin system overview to the Contributing guide
  • Configure UI: Added informational "Custom Tools" card in the Tools tab

Benefits

  • Multiple Plugin Sources: Teams can maintain separate plugin repositories (e.g.,
    mission-specific, organization-specific)
  • Flexible Naming: Any directory containing the keywords works (e.g., Mars-Private-Tools-v2,
    JPL-Plugin-Backend)
  • Override Capability: Plugins can override standard tools/backends by using the same names
  • Backward Compatible: Existing private directories continue to work
  • Zero Configuration: All plugin directories are automatically discovered and gitignored

Usage Examples

Backend Plugins:

  • /API/NASA-Plugin-Backend/
    • /CustomDraw/
      • setup.js
      • routes/
      • models/

Tool Plugins:

  • /src/essence/Mission-Private-Tools/
    • /CustomInfo/
      • config.json
      • InfoTool.js
      • InfoTool.css

Testing

  • Created test plugin directories to verify automatic discovery
  • Confirmed plugins are loaded with npm start (backends) and npm run build (tools)
  • Verified git properly ignores all plugin directories
  • Tested that plugins can override standard tools/backends

Notes

  • Backend plugins only require npm start to be loaded (no build step needed)
  • Tool plugins require npm run build to be included in the frontend bundle
  • Plugin loading order is deterministic (alphabetical within each category)
  • All plugin directories matching the patterns are automatically gitignored

This implementation provides a clean, flexible way for teams to maintain private or
mission-specific functionality while benefiting from MMGIS core updates.

@tariqksoliman tariqksoliman self-assigned this Sep 10, 2025
@tariqksoliman tariqksoliman merged commit bad6c03 into development Sep 10, 2025
1 check passed
@tariqksoliman tariqksoliman deleted the ts-749 branch September 10, 2025 17:16
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Feature]: Support Multiple Private Backends/Tools

2 participants