This guide explains the structure and common patterns in the config.json file for the Catalog Reference Application.
The application uses a multi-tenant configuration system where each "endpoint" (e.g., /retail, /evcharging, /healthcare) has its own complete theme and view configuration. This allows you to run multiple domain-specific instances from a single deployment.
[
{
"endpoint": "/retail", // URL path for this configuration
"app": { ... }, // Browser metadata (title, favicon)
"theme": { ... }, // Visual theme settings
"layout": { ... }, // Header and sidebar configuration
"network": { ... }, // Beckn protocol domain
"schemas": { ... }, // Schema registry for this domain
"views": { ... } // Page configurations (discovery, catalog-publish)
},
// ... additional configurations for other endpoints
]The following values are identical across all three reference themes (Retail, EV Charging, Healthcare). When creating a new theme, these are good defaults to start with:
"theme": {
"discovery": {
"locationBgOpacity": 0.08,
"radiusBgOpacity": 0.10,
"jsonpathBgOpacity": 0.12,
"borderOpacity": 0.20
}
}Purpose: Controls the visual appearance of the Discovery view's input sections (Location, Radius, JSONPath). These opacity values create subtle backgrounds that work well on any color scheme.
"theme": {
"icons": {
"upload": "CloudUpload",
"success": "CheckCircle"
}
}Note: Other icons (appLogo, heroSearch, networkDiscovery, publish) are theme-specific.
"views": {
"discovery": {
"api": "/beckn/discover",
"context": {
"action": "discover"
}
},
"catalog-publish": {
"api": "/beckn/v2/catalog/publish",
"context": {
"action": "catalog_publish",
"ttl": "PT30S"
}
}
}"palette": {
"primary": {
"contrastText": "#ffffff" // White text on primary color
},
"background": {
"paper": "#ffffff" // White for cards/modals
}
}While themes can vary, most use similar values:
"shape": {
"borderRadius": 12, // Standard: 12-16px
"searchBarRadius": 40, // Standard: 40-50px (very round)
"buttonRadius": 20 // Standard: 20-24px
}- Copy an existing configuration (e.g., Retail)
- Update the endpoint: Choose a unique path like
/mobility - Customize colors:
palette.primary.main: Your brand color- Derive
light/darkvariants (use a color tool) - Adjust
background.defaultfor subtle tinting
- Choose typography: Select a Google Font or system font stack
- Configure icons: Pick Material Icons that match your domain
- Customize labels: Update all
labelsin views to match your domain language
- Primary color: Should be your brand's main color with enough contrast for white text
- Light variant: ~20-30% lighter than main (for hover states, backgrounds)
- Dark variant: ~20-30% darker than main (for emphasis, pressed states)
- Action colors: Use your primary color with low opacity (0.05-0.12) for hover/selected states
"typography": {
"fontFamily": "'Your Font', fallback1, fallback2, sans-serif",
"h3": {
"fontSize": "2.25rem", // Hero headings
"fontWeight": 700
},
"h4": {
"fontSize": "1.25rem", // Section headings
"fontWeight": 600
}
}The Discovery view supports two modes:
- AI Search: Natural language search with AI assistance
- Network Discovery: Manual filtering with location, radius, and JSONPath
Common fields:
"discovery": {
"type": "search",
"api": "/beckn/discover",
"search": {
"radius": 1000 // Default search radius in meters (varies by domain)
},
"filters": [
// Category or connector type filters
]
}Domain-specific:
- Retail:
radius: 1000(1km for grocery delivery) - EV Charging:
radius: 5000(5km for finding stations) - Healthcare:
radius: 10000(10km for finding doctors/labs)
Identical across all themes:
"catalog-publish": {
"type": "form",
"api": "/beckn/v2/catalog/publish",
"context": {
"action": "catalog_publish",
"ttl": "PT30S"
}
}Only the labels change per domain to provide context-appropriate terminology.
The config.schema.json file provides:
- Type safety: Ensures all fields are the correct type
- Defaults: Common values are defined as defaults
- Descriptions: Inline documentation for each field
- Validation: Requires essential fields, validates color formats and URLs
In VS Code or compatible editors:
- The
"$schema": "./config.schema.json"reference enables autocomplete - Hover over any field to see its description
- Get warnings for missing required fields or invalid values
✅ Use descriptive, domain-specific labels throughout
✅ Test your theme on both desktop and mobile viewports
✅ Ensure sufficient color contrast (use a contrast checker tool)
✅ Keep common values (discovery opacities, common icons) consistent
✅ Use semantic color names in your palette
❌ Hardcode colors in multiple places (use the palette)
❌ Use extremely small font sizes (minimum 0.75rem)
❌ Create too many border radius variations (3 is enough)
❌ Forget to update all labels when changing domains
❌ Use custom icons without ensuring they exist in Material Icons
- Verify the icon name exists in Material Icons
- Icon names are case-sensitive (e.g.,
CloudUpload, notcloudupload)
- Check contrast ratios (minimum 4.5:1 for text)
- Ensure
contrastTextis readable on your primary color - Test in both light and dark mode if supported
- Check for missing commas or quotes in JSON
- Verify all required fields are present
- Ensure color values match the pattern:
#RRGGBBorrgba(...)
{
"endpoint": "/mobility",
"app": {
"title": "Mobility Network",
"logo": "/assets/mobility-logo.png",
"favicon": "/favicon.ico"
},
"theme": {
"mode": "light",
"palette": {
"primary": {
"main": "#0066cc",
"light": "#3385d6",
"dark": "#004a99",
"contrastText": "#ffffff"
}
},
"icons": {
"appLogo": "DirectionsCar",
"heroSearch": "Search",
"networkDiscovery": "Map",
"upload": "CloudUpload",
"publish": "Publish",
"success": "CheckCircle"
},
"discovery": {
"locationBgOpacity": 0.08,
"radiusBgOpacity": 0.10,
"jsonpathBgOpacity": 0.12,
"borderOpacity": 0.20
}
},
// ... rest of configuration
}For more information, refer to the inline comments in config.schema.json or explore the existing theme configurations in config.json.