The DecisionsDev website uses an automated categorization system to organize repositories. This system analyzes repository names and descriptions to assign structured categories, making it easier for users to find relevant projects.
The categorization happens during the build process via the build-repositories.js script:
npm run build:reposThis script:
- Fetches all repositories from the DecisionsDev GitHub organization
- Analyzes each repository using the
topic-analyzer.jslogic - Assigns categories based on keywords in the repository name, description, and existing topics
- Generates
src/data/repositories.jsonwith both original topics and new categories
Each repository gets a categories object with three arrays:
{
"name": "odm-ondocker",
"description": "Deploy ODM with Docker Compose",
"topics": ["docker", "ibm-odm", "odm"],
"categories": {
"products": ["odm"],
"components": ["container"],
"types": ["sample"]
},
"url": "https://github.com/DecisionsDev/odm-ondocker"
}Identifies which IBM product the repository relates to:
odm- Operational Decision Managerdecision-intelligence- Decision Intelligence (ADS)bai- Business Automation Insightscp4ba- Cloud Pak for Business Automation
Identifies specific components or technologies:
decisioncenter- Decision Centerruleexecutionserver- Rule Execution Servercontainer- Docker/Kubernetes/containersai- AI/ML/LLM integrationsdesigner- Designer/modeling toolsanalytics- Analytics/dashboardsevents- Event processing/Kafka
Identifies the repository type:
sample- Code samples and examplestool- Utilities and toolstutorial- Step-by-step tutorialsdocumentation- Documentation and guidesdeployment- Deployment configurationsintegration- Integration connectorslibrary- Libraries and SDKs
The website's repository browser uses these categories to provide:
- All - Shows all repositories
- ODM - Operational Decision Manager repositories
- DI - Decision Intelligence repositories
- BAI - Business Automation Insights repositories
- CP4BA - Cloud Pak for Business Automation repositories
- Other - Repositories without product categorization
- Component Filter - Filter by component (e.g., container, ai, decisioncenter)
- Type Filter - Filter by type (e.g., sample, tool, tutorial)
- Search - Free-text search across names and descriptions
The topic-analyzer.js module contains the categorization logic:
Each category has associated keywords. For example:
odmproduct: keywords include "odm", "operational decision manager", "ibm-odm"containercomponent: keywords include "docker", "kubernetes", "helm", "openshift"sampletype: keywords include "sample", "example", "demo"
The system applies intelligent inference rules:
- ODM Component Inference: If a repository mentions Decision Center or Rule Execution Server, it's automatically categorized as ODM
- Decision Intelligence Detection: Repositories with "decision-assistant" are categorized as Decision Intelligence
- Decision Engine: Repositories with "decision-engine" are categorized as ODM
- Component Exclusion: Decision Intelligence repos exclude ODM-specific components
- Default Type: Repositories with products/components but no type get "sample" as default
Each category has a priority score (1-10) that helps determine the most relevant categorization when multiple matches occur.
To add a new category, edit tools/topic-analyzer.js:
const TOPIC_RULES = {
products: {
'newproduct': {
keywords: ['newproduct', 'new-product'],
priority: 10
}
},
// ... other categories
};To improve categorization accuracy, add keywords to existing categories in topic-analyzer.js:
'odm': {
keywords: ['odm', 'operational decision manager', 'new-keyword'],
priority: 10
}After modifying the categorization logic:
-
Run the build script:
npm run build:repos
-
Check the output statistics:
Categorization Summary: Repositories with products: 45 Repositories with components: 35 Repositories with types: 49 Repositories without products (will appear in "Other"): 13 -
Review
src/data/repositories.jsonto verify categorization -
Test the website locally:
npm run dev
-
Navigate to
/repositoriesand verify the tabs and filters work correctly
The categorization is integrated into the deployment pipeline:
Both deploy.sh and deploy.bat scripts automatically run build:repos before building:
# In deploy.sh
npm run build:repos # Fetches and categorizes repositories
npm run build # Builds the siteThe npm run build command includes build:repos:
{
"scripts": {
"build:repos": "node tools/build-repositories.js",
"build": "npm run build:repos && gatsby build"
}
}This ensures the repository data is always fresh when deploying.
The system maintains backward compatibility:
- Original Topics Preserved: GitHub topics are kept in the
topicsfield - Additive Approach: The
categoriesfield is added without removing existing data - Graceful Degradation: The UI handles repositories without categories
If repositories aren't being categorized correctly:
- Check if keywords match the repository name/description
- Review the inference rules in
topic-analyzer.js - Add more specific keywords for better matching
- Run
npm run build:reposto regenerate
If too many repositories appear in "Other":
- Review repositories without product categorization
- Add appropriate keywords to
topic-analyzer.js - Consider adding inference rules for common patterns
- Regenerate with
npm run build:repos
If categories don't show in the browser:
- Verify
src/data/repositories.jsonhas thecategoriesfield - Check browser console for JavaScript errors
- Clear Gatsby cache:
npm run clean - Rebuild:
npm run build
Potential improvements to the categorization system:
- Machine learning-based categorization
- User feedback mechanism for improving accuracy
- Category suggestions for new repositories
- Automated topic management via GitHub API
- Multi-language support for descriptions
For more information, see:
- TOPICS_GUIDE.md - Guide for repository topics
- README-TOPICS-SCRIPT.md - Topics script documentation
- topic-analyzer.js - Categorization logic
© 2025 IBM Corporation