Documentation

KonstrukThor

A programmable, embeddable calculator platform. Domain experts create, test, and publish interactive decision tools in hours — not sprints.

v1.0 Cloud SaaS Self-Hosted Kotlin + Micronaut
Getting Started

What is KonstrukThor?

KonstrukThor is a programmable embeddable calculator platform. It lets domain experts — product managers, sales specialists, technical consultants, and marketers — create interactive calculation tools without writing frontend code or filing development tickets.

The platform turns a natural-language description into a fully functional, embeddable web widget backed by sandboxed Python logic. A domain expert can go from idea to a live, customer-facing calculator in a single afternoon, with or without any coding knowledge.

How it works

Describe your calculator

Tell the AI agent what the calculator should do in plain language — inputs, outputs, and expected behaviour.

AI generates the logic

The agent generates inputs, outputs, Python computation logic, and test cases — then runs them and self-corrects until they pass. Takes 5–15 minutes.

Test and adjust

Review in the Visual Builder. Test with your own values. Adjust parameters or Python logic if needed. The expert validates — not builds.

Publish and embed

Click Publish. Copy the one-line iframe embed code. Paste it into any website, CMS, e-shop, or internal portal. Done.

💡
The entire process — from description to live embed — typically takes 30 to 120 minutes. The same result through traditional development takes 3–6 weeks.
Getting Started

Quick Start

This guide walks you through creating your first calculator from scratch.

1. Sign in

KonstrukThor uses Google OAuth2. Click "Sign in with Google" and authenticate with your work account. You'll be placed into your organization automatically.

2. Create a new calculator

From the dashboard, click New Calculator. Either describe your calculator to the AI agent, or define it manually in the Visual Builder.

3. Define inputs and outputs

Input TypeDescriptionExample
numberNumeric value with optional min/max and unitWall length (m)
textFree text stringProject name
selectDropdown with predefined named valuesMaterial type
yes_noBoolean toggle rendered as Yes/NoInclude VAT?
intervalNumeric range with min/max validationTemperature range

4. Write or review the Python logic

Inputs are available as Python variables by their IDs. Assign results to output variable IDs.

import math

area = wall_length * wall_height
tiles_needed = math.ceil(area / tile_size) * (1 + waste_factor / 100)
total_boxes = math.ceil(tiles_needed / tiles_per_box)

5. Run tests and publish

Go to the Tests tab, add test cases, and run them. All tests must pass before publishing. Click Publish and copy your embed code from the Embed tab.

Getting Started

Core Concepts

Calculator

The central entity. A Calculator has a name, input parameters, output parameters, a Python execution script, and a test suite. It belongs to a Team. When published, it is accessible via an embeddable iframe widget.

Parameter

A typed input or output slot. Parameters have IDs (used as Python variable names), display labels, types, optional units, default values, and validation rules. The UI is entirely auto-generated — no frontend code needed.

Execution

When a user submits the form, input values are sent to the runner which executes the Python script in a sandboxed Docker container. The result is returned and displayed. Every execution is logged for analytics.

Team

The isolated unit of work within an organization. Calculators belong to Teams. Team members can only see calculators in their own team.

Organization

The top-level tenant container. One per company. All data is strictly scoped to an organization — users from Company A cannot see anything from Company B.

Platform

AI Calculator Generation

The AI agent is trained on KonstrukThor's parameter formats, naming conventions, and Python runner patterns — producing output immediately compatible with the platform.

How to prompt effectively

Be specific about what you want the calculator to do, what inputs users will provide, and what outputs they expect.

Good prompt: "Create a paint consumption calculator. Inputs: room length (m), room width (m), ceiling height (m), number of coats (default 2), paint coverage per litre (default 10 m²/L). Output: total litres needed rounded up, total cost if price per litre is an input."
⚠️
Too vague: "Make a calculator for paint." The agent will make assumptions — review the output carefully and iterate.

AI generation loop

The agent generates, runs its own test cases, checks results, and self-corrects if they fail. The loop continues until all tests pass. You see the final, working result — not intermediate failures.

After generation

Check that all inputs have sensible labels, defaults, and units. Verify the Python logic matches your business rules. Add additional test cases covering real-world edge cases before publishing.

Platform

Python Execution Sandbox

All calculator logic runs in an isolated Python environment with strict security guarantees.

ConstraintDetail
Container isolationEach execution runs in its own Docker container. Failures cannot affect the main API.
Network disabledNo outbound or inbound network access from within the sandbox.
Filesystem isolatedNo access to the host filesystem. Scripts cannot read or write persistent files.
Import restrictionsDangerous imports (os.system, subprocess, etc.) are blocked.
CPU / time / memory limitsHard caps prevent infinite loops, excessive computation, and OOM attacks.

Execution architecture

Frontend → POST /api/v1/run/{id}
  → manager publishes RunnerTaskMessage to RabbitMQ
  → task-runner consumes, forwards to runner (port 8081)
  → runner executes Python in sandbox
  → result returned via ReportConsumer
💡
The runner service (port 8081) is fully separate from the main API (port 8080). Execution failures are completely contained and cannot crash the platform.
Platform

Test Case Framework

Every calculator should have a test suite that verifies the Python logic produces expected outputs for known inputs.

Creating test cases

Under the Tests tab, add a test case with: a descriptive name, one value per input parameter, and expected result values per output parameter.

Numeric tolerance

Numeric outputs are compared with a configurable relative tolerance of 0.1% by default — accommodating floating-point differences without masking genuine errors.

The AI agent generates and runs its own test cases during generation. Add additional cases covering your real-world edge cases before publishing.
Platform

Analytics

Built-in analytics track usage without requiring any separate setup.

  • Total executions (all time)
  • Daily and monthly run counts with sparkline trends
  • Error rates and execution time distributions

Analytics are available per calculator from the dashboard. Each embed location is counted independently in the total execution count.

Platform

Frontend Customization

Calculators ship with a clean default theme that works out of the box — but every visual and behavioural aspect is fully overridable. Three independent slots let authors take control progressively, each replacing its default in isolation:

CSS Slot — Styling & Branding

Replace the default stylesheet to match brand colors, typography, spacing, and motion. Most visual tweaks need nothing else. In the builder, go to the Style tab to enter custom CSS. The widget's root element receives a kt-widget class for scoped styling. Changes preview in real time.

HTML Slot — Layout & Structure

Restructure the form entirely: SVG illustrations, image-driven choices, sliders, date pickers, custom layouts. The runtime still collects values by input id/name, so any element shape is fair game. Transform the input form to match any design vision.

JS Slot — Behavior & Interactivity

Define lifecycle hooks (onSubmit, onResult, onError, onInputChange) for conditional visibility, custom validation, animated results, or interactive charts and tables. React to calculation results in real time.

What This Unlocks

  • Match the host page so the calculator feels native rather than embedded
  • Conditional UX — show "How many kids?" only after "Do you have kids? Yes"
  • Rich output presentation — charts, tables, KPI cards rendered from the calculation result instead of plain rows
  • Custom input/output types — arrays, objects, and arrays of objects become possible by handling the data shape in the frontend hooks

There is no fixed limit on appearance or interaction: anything HTML, CSS, and JavaScript can express is reachable. The same KonstrukThor AI agent will customize the frontend for you when prompted on the Frontend tab.

Embedding

iframe Embedding

Embedding requires exactly one line of HTML. The widget handles its own layout, rendering, execution, and output display.

your-website.com/product-page
<iframe
  id="calc-frame"
  src="https://your-konstrukthor-host/api/v1/interactive/<calculator-id>"
  width="520"
  height="600"
  frameborder="0"
  allow="same-origin"
></iframe>

Finding the calculator ID

Shown under the Embed tab after publishing, and visible in the URL when viewing the calculator: /calculator/<id>.

💡
The embed works on any site that can render an iframe: WordPress, Webflow, Shopify, custom HTML, React SPAs, and internal portals.
Embedding

postMessage API

The embedding page can pre-fill calculator fields via window.postMessage, enabling wizard-style flows and deep integration with surrounding applications.

Setting values from the parent page

const frame = document.getElementById('calc-frame');

frame.contentWindow.postMessage({
  type: 'setValues',
  payload: {
    length: 12.5,          // number field
    material: 'steel',     // text or select field
    include_vat: true      // yes/no toggle
  }
}, '*');

Accepted value types

Field TypeAccepted ValueNotes
Numbernumber or numeric stringAssigned to input.value
TextstringAssigned to input.value
Selectstring matching an option valueAssigned to select.value
Yes/Notrue/false or "true"/"false"Sets checked, updates label

Waiting for the iframe to load

frame.addEventListener('load', function () {
  frame.contentWindow.postMessage({
    type: 'setValues',
    payload: { length: 12.5, material: 'steel' }
  }, '*');
});
⚠️
The iframe accepts messages from any origin by default. If embedding only on known domains, restrict the target origin: postMessage({...}, 'https://your-site.com'). The embed never exposes sensitive data back to callers — it only sets form values.

Finding parameter IDs

Parameter IDs are assigned in the Visual Builder. You can also inspect the rendered embed HTML — each input carries id="<parameter-id>" and name="<parameter-id>".

Teams & Access

Organizations

Every account belongs to an Organization — the top-level isolation boundary. Data from one organization is completely inaccessible to another, enforced at the database query level.

Teams within an organization

Organizations contain one or more Teams, each an isolated workspace with its own calculators and members. A user can be in multiple teams with different roles in each.

💡
When a new organization is created, a default team is automatically provisioned. The first user becomes Organization Admin and Team Leader of the default team.
Teams & Access

Roles & Permissions

Org Admin
Whole Organization
  • Access all teams
  • Create / delete teams
  • Manage billing & settings
  • Acts as Leader everywhere
  • Emergency recovery
Team Leader
One Team
  • Full CRUD on calculators
  • Invite / remove members
  • Configure deletion policy
  • Approve deletion requests
  • Rename / delete team
Member
One Team
  • Full CRUD on calculators
  • Deletion per team policy
  • Cannot invite others
  • Cannot change team settings
ActionMemberLeaderOrg Admin
View calculator (own team)
View calculator (other team)✗ (404)✗ (404)
Create / edit calculator
Delete calculatorPolicy-dependent
Invite team members
Configure deletion policy
Create / delete teams
💡
404 Rule: Cross-team requests return 404 Not Found, not 403 Forbidden — deliberately, to avoid revealing that data exists in other teams.
Teams & Access

Inviting Members

Team Leaders can invite colleagues by email. No Org Admin action required.

Leader sends invitation

Click Invite Member from the team management page, enter the colleague's email. A unique token is generated with a 7-day expiry.

Invitee receives email

The link shows team name, inviter, and expiry — no account needed to preview.

Invitee accepts

Signs in with Google. Email must match the invitation exactly. Added to the org as Member and team as Member automatically.

⚠️
Invitations use exact email matching, not domain matching. The invitee must accept with the exact email address the invitation was sent to.
Teams & Access

Deletion Policies

Each team has a configurable Calculator Deletion Policy set by the Team Leader.

Open Collaboration

Member clicks Delete → immediate soft-delete. No approval needed.

Best for: small, high-trust teams
Leader Approval (default)

Member deletion creates a pending request. Leader approves → soft-delete.

Best for: corporate teams, compliance tools
Leader Only

Members cannot delete. Only the Team Leader can.

Best for: regulated industries, audit requirements
💡
All deletes are soft deletes — the calculator is marked deleted but not removed. Org Admins can recover a soft-deleted calculator at any time.
Deployment

Cloud SaaS

Fully managed by KonstrukThor. No infrastructure to manage.

  • Deployment on AWS (EC2/ECS, RDS PostgreSQL, RabbitMQ)
  • Custom domain and SSL configuration
  • All updates and security patches
  • Backups and monitoring included
  • Support per tier SLA
TierSLASupport Response
Starter99%Email, best effort
Standard99%4-hour response
Enterprise99.9%Dedicated, custom SLA
Deployment

Self-Hosted Deployment

Full data sovereignty for organizations that require on-premise deployment or restricted network environments.

Infrastructure requirements

ComponentRecommended
Server / VM4 vCPU, 8 GB RAM, 50 GB disk
Container runtimeDocker with Compose
SSL certificateProvided by you
Backups & monitoringYour responsibility

Services in the Docker Compose package

ServicePortRole
manager8080Main API + static React frontend
runner8081Sandboxed Python execution (RabbitMQ consumer)
postgres5432Primary database
rabbitmq5672Message queue for execution tasks

Key environment variables

JWT_ACCESS_SECRET         # JWT access token secret
JWT_REFRESH_SECRET        # JWT refresh token secret
GOOGLE_CLIENT_ID          # Google OAuth2 client ID
GOOGLE_CLIENT_SECRET      # Google OAuth2 client secret
GOOGLE_REDIRECT_URI       # OAuth2 redirect URI
FRONTEND_URL              # Base URL of your deployment
JDBC_DATABASE_URL         # PostgreSQL JDBC URL
DATABASE_USERNAME         # Database user
DATABASE_PASSWORD         # Database password
RABBIT_MQ_URI             # RabbitMQ connection URI
ANTHROPIC_API_KEY         # Claude API key for AI generation
CORS_ALLOWED_ORIGIN       # Your domain (e.g. https://calc.yourcompany.com)
⚠️
CORS_ALLOWED_ORIGIN is required in production. Without it, POST, PUT, and DELETE requests from the frontend will be blocked by CORS policy.
Deployment

Authentication

KonstrukThor uses Google OAuth2 with JWT tokens for session management.

  1. User clicks "Sign in with Google"
  2. Redirected to Google OAuth2 consent screen
  3. On success, receives a short-lived access token (expires 60s) and a refresh token stored in PostgreSQL
  4. Access token sent as Bearer in API headers. Expired tokens refreshed via POST /oauth/access_token
💡
SSO (SAML/OIDC) and custom identity provider integration is available on the Enterprise tier. Contact sales to discuss your requirements.
Reference

Pricing Reference

Detailed Pricing Coming Soon

We're currently finalizing our pricing structure to ensure it meets the diverse needs of our users. Complete pricing details, including all tier options and add-ons, will be published shortly.

Need pricing information now? Contact our sales team for a personalized quote.

Cloud SaaS

Startup
9 250 Kč
Kč / month · setup 6 000 Kč
  • EC2 instance + Docker
  • Daily backups (7-day retention)
  • 50 AI generations
  • Email support
Enterprise
46 750 Kč
Kč / month · setup 15 000 Kč
  • Multi-AZ RDS (t3.medium)
  • Two c5.xlarge instances
  • 99.9% SLA
  • Daily backups (30 days)

Self-Hosted (Annual Licence)

Professional
60–80k
Kč / year
  • Docker Compose package
  • Docs & runbook
  • Email support (4h SLA)
  • Security updates
💰
Pilot offer: First month free or 50% off for 3 months on SaaS. Annual subscriptions: 10–15% discount. Ask during your demo call.
ℹ️
Custom configurations: The Startup tier uses shared infrastructure. If you need dedicated infrastructure, higher SLA guarantees, or compliance-specific deployments, contact us for a tailored enterprise solution.
Reference

Frequently Asked Questions

General

Do domain experts need to know Python?

No. The AI agent generates all Python logic. Experts review outputs and test results. Optionally, experts comfortable with Python can edit logic directly — but it's never required.

Can I use KonstrukThor without the AI agent?

Yes. The Visual Builder lets you define inputs, outputs, and Python logic manually. The AI agent accelerates the process significantly but is not mandatory.

What happens if the Python script has an error?

Execution errors are caught by the sandbox, logged, and returned as an error message — they cannot crash the platform. The error rate is tracked in analytics.

Embedding

Can I embed on multiple websites?

Yes. A single calculator can be embedded on any number of pages. Each embed is an independent iframe. Analytics tracks total executions across all locations.

Does embedding require JavaScript?

No. The basic iframe embed works without any JavaScript on the parent page. The postMessage API (for pre-filling values) requires a small JavaScript snippet but is entirely optional.

Security & Data

Where is data stored?

For Cloud SaaS: AWS PostgreSQL RDS, EU region. For self-hosted: entirely on your own infrastructure — we have no access to it.

Can scripts access external services or data?

No. Network access is completely disabled in the sandbox. Scripts cannot make HTTP requests, connect to databases, or access any external service.

Teams & Access

Can a user belong to multiple teams?

Yes. A user can be a member of multiple teams within the same organization, with different roles in each. Teams are accessible from the dashboard.

What happens to calculators if a Team Leader leaves?

The Organization Admin can access all teams regardless of membership and can manage any team leadership transition.

Billing & Plans

Can I start with a trial?

Yes. Cloud SaaS offers the first month free or 50% off for 3 months. Self-hosted plans offer a 30-day trial via Docker Compose locally. Ask during your demo call.

What does the setup fee cover?

The setup fee (6,000–20,000 Kč for SaaS) covers deployment to AWS, environment configuration, custom domain and SSL, and an onboarding session. It's a one-time cost — the monthly subscription covers hosting, maintenance, support, and updates.

Can I switch between SaaS and self-hosted?

Yes. Migration between the two deployment models is possible. Contact us to discuss the migration process for your data and configuration.