Skip to main content
Glama

dhis2_init_webapp

Set up a new DHIS2 web application project with structured scaffolding by specifying app name, title, template, and optional features like TypeScript or PWA support.

Instructions

Initialize a new DHIS2 web application project with proper scaffolding

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appDescriptionNoDescription of the application
appNameYesName of the application (e.g., "my-health-app")
appTitleYesHuman-readable title of the application
appTypeNoType of DHIS2 application
namespaceNoApp namespace (defaults to appName if not provided)
outputPathNoDirectory path where to create the app (default: current directory)
pwaNoEnable Progressive Web App features
templateNoApp template to use
typescriptNoUse TypeScript (default: true)

Implementation Reference

  • Handler for dhis2_init_webapp tool: destructures input parameters and calls generateWebAppInitInstructions to produce a markdown guide for initializing a DHIS2 web application.
    case 'dhis2_init_webapp': const { appName, appTitle, appDescription, namespace, appType, template, typescript, pwa, outputPath } = args as any; const initInstructions = generateWebAppInitInstructions(appName, appTitle, appDescription, { namespace, appType, template, typescript, pwa, outputPath }); return { content: [ { type: 'text', text: initInstructions, }, ], };
  • Core generator function that creates comprehensive markdown instructions for initializing a new DHIS2 web app, including commands, structure, and configuration.
    export function generateWebAppInitInstructions( appName: string, appTitle: string, appDescription: string, options: any = {} ): string { const { namespace, appType = 'app', template = 'basic', typescript = true, pwa = false, outputPath = './' } = options; return `# DHIS2 Web App Initialization Guide ## App Configuration - **App Name**: ${appName} - **App Title**: ${appTitle} - **Description**: ${appDescription || 'A DHIS2 web application'} - **Namespace**: ${namespace || appName} - **App Type**: ${appType} - **Template**: ${template} - **TypeScript**: ${typescript ? 'Yes' : 'No'} - **PWA Enabled**: ${pwa ? 'Yes' : 'No'} - **Output Path**: ${outputPath} ## Quick Start Commands \`\`\`bash # Initialize new DHIS2 app using App Platform npx @dhis2/cli-app-scripts init ${appName} # Navigate to project directory cd ${appName} # Install dependencies yarn install # Start development server yarn start \`\`\` ## Project Structure \`\`\` ${appName}/ ├── src/ │ ├── App.js${typescript ? 'x' : ''} │ ├── components/ │ └── index.js${typescript ? 'x' : ''} ├── public/ │ └── manifest.webapp ├── d2.config.js ├── package.json ${typescript ? '├── tsconfig.json' : ''} ${pwa ? '├── workbox.config.js' : ''} └── README.md \`\`\` ## Next Steps 1. Configure your DHIS2 instance connection 2. Set up proxy for development 3. Add CORS allowlist configuration 4. Implement your app components 5. Test with different DHIS2 versions ## Template-Specific Features ${generateTemplateFeatures(template)} ${pwa ? generatePWAConfiguration() : ''} `; }
  • Registers dhis2_init_webapp in TOOL_PERMISSIONS map, associating it with 'canConfigureApps' permission for access control.
    // Web App Platform Tools ['dhis2_init_webapp', 'canConfigureApps'], ['dhis2_configure_app_manifest', 'canConfigureApps'], ['dhis2_configure_build_system', 'canConfigureApps'], ['dhis2_setup_dev_environment', 'canConfigureApps'], ['dhis2_generate_app_runtime_config', 'canConfigureApps'], ['dhis2_create_datastore_namespace', 'canConfigureApps'], ['dhis2_manage_datastore_key', 'canConfigureApps'], ['dhis2_setup_authentication_patterns', 'canConfigureApps'], ['dhis2_create_ui_components', 'canUseUITools'], ['dhis2_generate_test_setup', 'canConfigureApps'],
  • References dhis2_init_webapp as a trigger in development-pipeline workflow for multi-server composition.
    triggers: ['dhis2_init_webapp']

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dradebo/dhis2-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server