Skip to content

Repository files navigation

Program Host

Build useful Windows desktop applications from a single JSON file.

Program Host is a lightweight, open-source WinForms application runtime for data entry, CRUD screens, reports, multi-form tools, and business workflows. Describe the application in Program.json; Program Host validates the project, creates the interface, connects the data, and runs it. No generated source-code project is required.

You do not have to write JSON by hand. The built-in table and interface designer can create the project, inspect an existing database, arrange controls visually, assign button actions, and save the resulting layout and workflows back to JSON.

Why Program Host

  • One portable project file: forms, controls, tables, actions, workflows, validation rules, and localization settings can live in one JSON document.
  • Visual application design: create tables and forms, drag controls, change captions, colors, and fonts, and assign actions without editing source code.
  • Workflow automation: connect buttons and events to declarative steps such as insert, update, delete, query, calculate, condition, transaction, open form, refresh, export, and message.
  • Database and file storage: Microsoft Access (.mdb/.accdb), SQL Server, Excel (.xlsx), CSV, XML, and JSON.
  • Existing database support: inspect Access or SQL Server tables, columns, primary keys, required fields, and relationships to create working screens.
  • Runtime customization: edit an application's interface and button behavior while it is running, then persist those changes to the project.
  • International UI: English, Turkish, German, French, Italian, Spanish, Russian, Arabic, Chinese, Japanese, and Korean.
  • Validation and diagnostics: validate projects without opening their UI and write actionable warnings and errors to a log.

Program Host is especially useful for internal tools, small-business software, prototypes, local-first utilities, and applications built around Access, Excel, or other files that are often underserved by web-first app builders.

Quick Start

Requirements:

  • Windows 10 or later
  • .NET 8 Desktop Runtime, or a self-contained Program Host release
  • Microsoft Access Database Engine when an Access database is used

Run Program Host with a project file:

ProgramHost.exe .\examples\inventory-json\Program.json

If no path is supplied, Program Host looks for Program.json beside the executable and then below it. If no project exists, the built-in designer opens and helps you create one.

The examples catalog includes ready-to-run English projects for JSON, CSV, Excel, XML, and Access. It also contains English adaptations of the original CRUD, multi-form, lookup, reporting, transaction, and Mini ERP templates.

A Complete App in One JSON File

This compact example creates an inventory screen backed by a local JSON data file. Program Host lays out the interface and supplies the CRUD behavior.

{
  "schema": "ProgramMakerStudio/1.0",
  "projectName": "Inventory",
  "database": {
    "type": "json",
    "database": "inventory-data.json"
  },
  "forms": [
    {
      "name": "InventoryForm",
      "text": "Inventory",
      "width": 900,
      "height": 560,
      "controls": [
        { "type": "Label", "name": "ProductLabel", "text": "Product", "left": 20, "top": 24, "width": 100, "height": 26 },
        { "type": "TextBox", "name": "ProductName", "left": 130, "top": 20, "width": 240, "height": 30 },
        { "type": "Label", "name": "QuantityLabel", "text": "Quantity", "left": 390, "top": 24, "width": 80, "height": 26 },
        { "type": "NumericUpDown", "name": "Quantity", "left": 480, "top": 20, "width": 120, "height": 30 },
        { "type": "Button", "name": "AddButton", "text": "Add", "action": "insert", "grid": "InventoryGrid", "left": 20, "top": 68, "width": 110, "height": 36 },
        { "type": "Button", "name": "UpdateButton", "text": "Update", "action": "update", "grid": "InventoryGrid", "left": 140, "top": 68, "width": 110, "height": 36 },
        { "type": "Button", "name": "DeleteButton", "text": "Delete", "action": "delete", "grid": "InventoryGrid", "left": 260, "top": 68, "width": 110, "height": 36 },
        {
          "type": "DataGridView",
          "name": "InventoryGrid",
          "tableName": "Inventory",
          "left": 20,
          "top": 124,
          "width": 840,
          "height": 370,
          "columns": [
            { "name": "id", "text": "ID", "type": "int", "width": 60 },
            { "name": "ProductName", "text": "Product", "type": "string", "width": 260 },
            { "name": "Quantity", "text": "Quantity", "type": "decimal", "width": 120 }
          ]
        }
      ]
    }
  ],
  "tables": [
    {
      "name": "Inventory",
      "storage": "json",
      "columns": [
        { "name": "id", "type": "int" },
        { "name": "ProductName", "type": "string" },
        { "name": "Quantity", "type": "decimal" }
      ]
    }
  ],
  "workflows": []
}

Projects can grow from this foundation into multiple forms, lookup fields, filtered reports, timers, exports, and transactional workflows. The visual designer can produce and refine the same JSON model, so hand-authoring is optional.

Storage Support

Storage Typical use Notes
Microsoft Access Local multi-table business apps Supports .mdb and .accdb; requires the matching Access Database Engine
SQL Server Shared and multi-user systems Supports Windows or SQL authentication; the target database must already exist
Excel Portable spreadsheet-backed tools Reads and writes real .xlsx workbooks
CSV Simple interoperable datasets File-backed table storage
XML Structured local data File-backed table storage
JSON Local-first and portable apps File-backed table storage; pairs naturally with a JSON project

Storage can be selected for the project or overridden per table. Database-backed projects support generated tables and columns; the designer can also inspect existing Access and SQL Server schemas.

Workflows

Most application behavior can remain declarative. Available workflow concepts include database transactions, insert/update/delete, row selection, SQL queries, grid and combo-box loading, calculations, conditions, variables, form navigation, messages, delays, exports, printing, and process execution.

Executable scripts and external processes are treated as trusted-project features. Program Host asks for permission when a project contains executable content, unless the project explicitly defines its trust policy. Review JSON from unknown sources before running it.

PowerShell events run through the Windows PowerShell executable. Scripts receive a read-only JSON snapshot in $FormState and can update the interface through a small command bridge such as $Form.SetControlValue("Status", "Done"). File, network, calculation, and external-tool features of PowerShell remain available, but scripts do not receive unrestricted access to live WinForms objects.

Build

dotnet restore .\ProgramHost.sln
dotnet build .\ProgramHost.sln -c Release --no-restore

Run all 17 smoke scenarios from the repository root:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\run-tests.ps1

The regular smoke suite runs from build output. Verify the published single-file package separately because it extracts assemblies to a temporary directory:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\verify-package.ps1

Release Packages

Create a portable, single-file x86 executable:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\publish.ps1

The portable release requires the .NET 8 Desktop Runtime (or a newer compatible runtime). To embed the runtime and create a package that does not require .NET to be installed, use:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\publish.ps1 -Standalone

Both variants are written below dist/. The portable build is much smaller; the standalone build is larger because it includes the .NET runtime.

Project Status

Program Host is being prepared as a clean .NET 8 open-source release. APIs and the JSON schema may evolve before the first stable release. Real project samples, bug reports, focused pull requests, and documentation improvements are welcome.

Contributing and Security

Read CONTRIBUTING.md before submitting a change. For security issues, follow SECURITY.md and avoid publishing sensitive details in a public issue.

License

Licensed under the Apache License 2.0.

About

You can create your own programs by designing the user interface without writing any code; the interface design and behavior of the program you create can be configured in a single JSON file.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages