⚙️ Technical Solution Document

FlowClick Implementation Blueprint for Test

CLIENT: TestINDUSTRY: TechDOCUMENT: Technical ArchitectureVERSION: 1.0STATUS: Draft

1 System Requirements

Infrastructure and platform prerequisites.

Platform Requirements

Integration Prerequisites

Browser Compatibility

2 Architecture Overview

Three-tier architecture built entirely within FlowClick.

🌐 Presentation Tier
Public Folder + SSI Pages
Session Authentication
HTML/CSS/JS Content Nodes
/pub/FlowClick/Test/public/*
⚙️ Application Tier
42+ Step Type Flows
AI Agent Steps
Webhooks + HTTP Integrations
Table Triggers + Schedules
🗄️ Data Tier
Semantic Databases + Tables
21 Column Types
OData Query API
Aggregate Analytics
⬇ ⬆
🔌 External Integrations
REST APIs via HTTP step
Inbound Webhooks
SMTP/IMAP Email
SMS via Twilio
🤖 AI Layer
Agent Step (Claude AI)
MCP Server Tools
NLP Query Processing
Content Generation
🛡️ Security Layer
RBAC Groups + Permissions
API Tokens + MFA
WORM Retention
Audit Logs

3 Database Schema Design

FlowClick database and table definitions with semantic column types.

// Application: Test
// Database: TestDB

Database: TestDB
├── Users
├── Projects
├── Tasks
├── Integrations
├── AuditTrail
└── Settings

Table: Users

Core user management with semantic validation and authentication.

ColumnSemantic TypeData TypeNotes
idRecord IDautoAuto-generated UUID primary key
emailEmailstringAuto-validated (format + MX + disposable check)
passwordPasswordpasswordSHA-256 hashed, never exposed on read. Auth via filter match.
full_nameFull NamestringDisplay name
phonePhonestringAuto-normalized to E.164 format
roleCategorystringEnum: admin, manager, developer, viewer
statusStatusstringActive / Inactive / Suspended
last_loginTimestampdatetimeUpdated via table trigger on login flow
created_atCreated AtdatetimeAuto-set on creation

Table: Projects

Project tracking with owner references and status management.

ColumnSemantic TypeData TypeNotes
idRecord IDautoAuto-generated UUID
nameNamestringProject name, indexed
descriptionRich TexttextMarkdown/HTML project description
ownerReferencereference→ Users.full_name (onDelete: restrict)
statusStatusstringPlanning / Active / On Hold / Completed / Archived
priorityCategorystringCritical / High / Medium / Low
start_dateDatedateProject start
target_dateDatedateTarget completion
budgetCurrencydecimalAllocated budget
created_atCreated AtdatetimeAuto-set

Table: Tasks

Task management with project references, assignment tracking, and priority.

ColumnSemantic TypeData TypeNotes
idRecord IDautoAuto-generated UUID
titleNamestringTask title
projectReferencereference→ Projects.name (onDelete: cascade)
assigneeReferencereference→ Users.full_name (onDelete: nullify)
statusStatusstringBacklog / To Do / In Progress / Review / Done
priorityCategorystringCritical / High / Medium / Low
due_dateDatedateTask deadline
estimate_hoursNumberdecimalEstimated effort
actual_hoursNumberdecimalActual effort logged
created_atCreated AtdatetimeAuto-set

Table: Integrations

ColumnSemantic TypeData TypeNotes
idRecord IDautoAuto-generated
nameNamestringIntegration name (e.g. 'GitHub', 'Jira')
typeCategorystringwebhook / api / email / sms
endpoint_urlURLstringExternal system endpoint
api_keyPasswordpasswordpasswordMode: encrypt — AES-encrypted, readable by flows
statusStatusstringActive / Inactive / Error
last_syncTimestampdatetimeLast successful sync time
error_countCounterintegerConsecutive error count

Table: AuditTrail

ColumnSemantic TypeData TypeNotes
idRecord IDautoAuto-generated
actorReferencereference→ Users.full_name
actionCategorystringcreate / update / delete / login / export
entity_typeCategorystringproject / task / user / integration
entity_idShort TextstringRecord ID of affected entity
detailsJSONtextJSON payload of change details
ip_addressIP AddressstringSource IP
created_atCreated AtdatetimeAuto-set, WORM retention enabled

4 Flow Definitions

Core automation workflows with step-by-step configurations.

Flow: UserLogin

Session-based authentication flow invoked via SSI from the login page.

ValidateInputlogic_fn
Check is_empty({{input.email}}) and is_empty({{input.password}}). If either blank, abort with error.
AuthQuerycrud_record
Operation: list on Users table. Filter: email eq '{{input.email}}' and password eq '{{input.password}}'. Password auto-hashes for comparison. iterate=false, top=1.
CheckResultlogic_fn
Function: is_empty on {{steps.AuthQuery.result.rows}}. If empty → invalid credentials.
UpdateLastLogincrud_record
Operation: update on Users. Set last_login to {{steps.Now.result}}. Record ID from AuthQuery result.
Outputmerge
Template: {"success":true,"user":"{{steps.AuthQuery.result.rows[0].full_name}}","role":"{{steps.AuthQuery.result.rows[0].role}}"}

Flow: CreateTask

Task creation with validation, notification, and audit logging.

ValidateProjectcrud_record
Operation: read on Projects. Verify project exists and is Active.
GuardInactiveif_else
Condition: {{steps.ValidateProject.result.status}} != 'Active'. If true → abort with "Project is not active".
CreateRecordcrud_record
Operation: create on Tasks. Fields mapped from input: title, project, assignee, priority, due_date, estimate_hours. Status defaults to "Backlog".
LogAuditcrud_record
Operation: create on AuditTrail. Action: "create", entity_type: "task", entity_id: {{steps.CreateRecord.result.id}}.
NotifyAssigneesend
Email to assignee: subject "New Task Assigned: {{input.title}}". Body built via merge template with task details.
Outputmerge
Return created task JSON for SSI display.

Flow: SyncIntegrations

Scheduled flow (runs every 15 min) to poll external systems and sync data.

ListActivecrud_record
Operation: list on Integrations. Filter: status eq 'Active'. iterate=true — subsequent steps execute per integration.
CallExternalhttp
GET to {{steps.ListActive.item.endpoint_url}}/api/sync. Headers include API key from encrypted column. Timeout: 30s.
CheckResponseif_block
Condition: {{steps.CallExternal.result.statusCode}} == 200. True branch: update last_sync, reset error_count. False branch: increment error_count.
UpdateSynccrud_record
Operation: update on Integrations. Fields vary based on if_block branch.
Scheduleschedule
cronExpression: */15 * * * * — every 15 minutes.

Flow: DashboardAnalytics

Aggregation flow powering the project dashboard via SSI.

TasksByStatusanalyze_table
table: TestDB.Tasks, groupBy: ["status"], aggregates: [{fn:"count", as:"count"}, {field:"estimate_hours", fn:"sum", as:"total_hours"}]
ProjectSummaryanalyze_table
table: TestDB.Projects, groupBy: ["status"], aggregates: [{fn:"count", as:"count"}, {field:"budget", fn:"sum", as:"total_budget"}]
WeeklyTrendanalyze_table
table: TestDB.Tasks, timeBucket: {field:"created_at", unit:"week"}, aggregates: [{fn:"count", as:"created"}]. Shows task creation trend.
RenderDashboardmerge
Pebble template rendering HTML dashboard cards with {%raw%}{% for status in taskData %}...{% endfor %}{%endraw%}. Data bound from previous analyze steps.

Flow: AIAssistant

AI-powered chatbot for natural-language queries against project data.

LoadHistorycrud_record
Operation: list on chat session messages table. Filter by session ID. iterate=false, orderby: created_at asc.
AskAgentagent
context: "You are a project management assistant for Test. Query the TestDB database to answer questions about projects, tasks, and team members." messages: {{steps.LoadHistory.result.rows}}, prompt: {{input.userMessage}}.
SaveReplycrud_record
Operation: create. Save assistant response to messages table for conversation continuity.
Outputmerge
Template: {{steps.AskAgent.result}} — returns AI response for SSI injection.

5 Integration Points

External system connectivity architecture.

Inbound Webhooks

Outbound HTTP Integrations

Email & SMS

6 SSI Web Interface Design

Server-rendered web application using FlowClick public folders and Server-Side Includes.

Public Folder Structure

Application: Test
└── Folder: public (isPublic: true, defaultDocument: index.html)
    ├── index.html          // Dashboard — SSI includes DashboardAnalytics flow
    ├── login.html           // Login form → UserLogin flow
    ├── projects.html        // Project list — SSI + Pebble loop rendering
    ├── project-detail.html  // Single project view with tasks
    ├── tasks.html           // Task board — Kanban-style SSI rendering
    ├── chat.html            // AI assistant — fetch() to AIAssistant flow
    ├── settings.html        // Admin settings page
    └── Folder: assets
        ├── style.css        // Shared stylesheet (File node)
        └── app.js           // Client-side JavaScript (File node)

SSI Pattern Examples

<!-- Dashboard: Server-rendered analytics cards -->
<div class="dashboard">
  <!--#include flow="DashboardAnalytics" -->
</div>

<!-- Login form: method=get for SSI parameter passing -->
<form method="get">
  <input name="email" type="email">
  <input name="password" type="password">
  <button>Sign In</button>
</form>
<!--#include flow="UserLogin"
  input='{"email":"","password":""}' -->

<!-- Task list with pagination -->
<!--#include flow="ListTasks"
  input='{"project":""}'
  page="1" page-size="20" -->

<!-- AI Chat: Client-side fetch for JSON API -->
<script>
async function askAI(msg) {
  const res = await fetch(
    '/pub/FlowClick/Test/public/api/chat?msg=' +
    encodeURIComponent(msg) + '&raw=true'
  );
  return res.text();
}
</script>
<!--#include flow="AIAssistant"
  input='{"userMessage":""}'
  response="json" -->

URL Routing

URL PathContent NodeDescription
/pub/FlowClick/Test/public/index.htmlDashboard (defaultDocument)
/pub/FlowClick/Test/public/login.htmllogin.htmlAuthentication page
/pub/FlowClick/Test/public/projects.htmlprojects.htmlProject listing
/pub/FlowClick/Test/public/tasks.html?project=Xtasks.htmlTask board filtered by project
/pub/FlowClick/Test/public/chat.htmlchat.htmlAI assistant interface

7 Security Considerations

Defense-in-depth security architecture.

Authentication & Authorization

Data Protection

Compliance

⚠️ Security Note: All webhook endpoints should use HMAC-SHA256 signature verification. Configure signatureType: 'hmac-sha256' with a secret stored in YOUR_WEBHOOK_SECRET.

8 Deployment Plan

Step-by-step deployment using FlowClick's blueprint import system.

Step 1: Application Scaffold

// Single blueprint_import call creates the entire application:
blueprint_import({
  applicationName: "Test",
  databases: [{
    name: "TestDB",
    tables: [
      { name: "Users", columns: [...], sampleData: [...] },
      { name: "Projects", columns: [...], sampleData: [...] },
      { name: "Tasks", columns: [...], sampleData: [...] },
      { name: "Integrations", columns: [...] },
      { name: "AuditTrail", columns: [...] }
    ]
  }],
  flows: [
    { name: "UserLogin", steps: [...] },
    { name: "CreateTask", steps: [...] },
    { name: "SyncIntegrations", steps: [...], schedules: [...] },
    { name: "DashboardAnalytics", steps: [...] },
    { name: "AIAssistant", steps: [...] }
  ],
  folders: [{
    name: "public",
    isPublic: true,
    defaultDocument: "index.html",
    contents: [
      { name: "index.html", contentType: "html", body: "..." },
      { name: "login.html", contentType: "html", body: "..." },
      // ... all pages
    ]
  }]
})

Step 2: Configuration Variables

Variables (Application-scoped):
  smtp_host      = "smtp.provider.com"
  smtp_port      = "587"
  smtp_user      = "noreply@test.com"
  smtp_password  = "***"          // encrypted
  smtp_from      = "noreply@test.com"
  JIRA_API_TOKEN = "***"          // encrypted
  SLACK_WEBHOOK  = "https://hooks.slack.com/..."
  WEBHOOK_SECRET = "***"          // for HMAC verification

Step 3: Security Configuration

Groups:
  TestAdmins     → full access (resource: "*", action: "*", effect: "allow")
  TestManagers   → read/write projects, tasks, users
  TestDevelopers → read/write tasks, read projects
  TestViewers    → read-only all tables

Table Triggers:
  Users.onCreate    → flow: AuditLog (action: "create", entity: "user")
  Tasks.onUpdate    → flow: NotifyStatusChange (condition: status changed)
  Tasks.onCreate    → flow: NotifyAssignee

Step 4: Validation & Go-Live