Skip to main content
Glama

dhis2_init_webapp

Initialize a DHIS2 web application project with proper scaffolding by specifying app name, type, and template to create structured health information system applications.

Instructions

Initialize a new DHIS2 web application project with proper scaffolding

Input Schema

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

Implementation Reference

  • Primary handler for the dhis2_init_webapp tool. Destructures input parameters and invokes generateWebAppInitInstructions to produce a comprehensive 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 helper function that generates detailed Markdown instructions for DHIS2 web app setup, including project structure, commands, templates, PWA config, and next steps.
    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 permission requirement for dhis2_init_webapp tool: requires 'canConfigureApps' permission. Part of TOOL_PERMISSIONS map used for filtering tool access.
    ['dhis2_init_webapp', 'canConfigureApps'],
  • Configures dhis2_init_webapp as a trigger for the 'development-pipeline' multi-server composition workflow, enabling automated follow-up actions like git commits and notifications.
      triggers: ['dhis2_init_webapp']
    });

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