Developer Resources
API reference, database schema, compliance architecture, IAM, analytics, and integration guides for the Taackk platform. This page is restricted to authorised personnel only.
Data Handling Notice
This documentation page contains architectural and configuration information classified as internal. It must not be shared externally, cached by search engines, or included in public-facing assets. Access is restricted to authorised engineering and compliance personnel. All information on this page is subject to Taackk's internal data classification policy.
REST API Endpoints
All endpoints are registered in src/server/entry.ts. Backend handlers live in src/server/api/. Auth middleware is noted per endpoint.
/api/contact/:formNameNoneDescription
Submit a contact or intake form. Supported formName values: business-onboarding, leader-application.
Body / Params
Structured fields in conversation.data; free-text in messages_attributes[0].bodyResponse
200 OK — { success: true }/api/healthNoneDescription
Server health check. Returns 200 when the API is reachable.
Body / Params
—Response
200 OK — { status: "ok" }/api/stripe/create-checkout-sessionNone (pre-auth flow)Description
Create a Stripe Checkout session for a leader subscription tier.
Body / Params
{ priceId: string, tier: "tier1" | "tier2" | "tier3", successUrl: string, cancelUrl: string }Response
200 OK — { sessionId: string, url: string }/api/stripe/session/:sessionIdNone (session ID is the credential)Description
Retrieve a Stripe Checkout session by ID. Used on the success page to confirm payment.
Body / Params
—Response
200 OK — Stripe Session object/api/admin/gdpr-anonymizerequireAdminAuth (super_admin)Description
GDPR Article 17 Right to Erasure. Anonymises PII across users, executive_profiles, and historic audit log payloads. Records a final ANONYMIZE compliance event.
Body / Params
{ userId: string (UUID), adminActorId: string (UUID) }Response
200 OK — { success: true, userId, logsScrubbed: number }/api/admin/audit-queryrequireAdminAuthDescription
Paginated read-only audit log inspection for compliance reporting.
Body / Params
?tableName=&actorId=&recordId=&action=&limit=50&offset=0Response
200 OK — { rows: AuditLog[], count: number, limit, offset }/api/admin/audit-logrequireAdminAuthDescription
Feature-flag audit log (DB-backed). Filterable by employeeId, action, scope, and date range.
Body / Params
?employeeId=&action=&scope=&from=&to=&limit=50&offset=0Response
200 OK — { rows: FeatureFlagAuditLog[], count: number }/api/admin/incidentsrequireAdminAuth (super_admin)Description
List all data breach / incident response records. Restricted to super_admin role.
Body / Params
?status=&severity=&limit=50&offset=0Response
200 OK — { incidents: Incident[], count: number }/api/admin/incidentsrequireAdminAuth (super_admin)Description
Create a new incident record. Starts the GDPR 72-hour DPA notification countdown.
Body / Params
{ title, severity, description, affectedUserCount, dataCategories }Response
201 Created — { incident: Incident }/api/admin/incidents/:incidentIdrequireAdminAuth (super_admin)Description
Update incident status, severity, or resolution notes.
Body / Params
Partial Incident fieldsResponse
200 OK — { incident: Incident }/api/admin/security-scanrequireAdminAuth (super_admin)Description
Retrieve historical security scan reports from DB. Each report includes severity counts and full output log.
Body / Params
—Response
200 OK — { reports: SecurityScanReport[] }/api/admin/security-scanrequireAdminAuth (super_admin)Description
Trigger a new security scan. Creates a running record, executes the scan, then updates with results.
Body / Params
{ type: "full" | "quick" | "pentest" }Response
200 OK — { report: SecurityScanReport }/api/admin/email-templatesrequireAdminAuthDescription
List all email templates from DB. Seeded from defaults on first access.
Body / Params
—Response
200 OK — { templates: EmailTemplate[] }/api/admin/email-templates/:keyrequireAdminAuthDescription
Update subject and HTML body of an email template by key.
Body / Params
{ subject?: string, html?: string }Response
200 OK — { template: EmailTemplate }/api/business/analytics/entitlementrequireBusinessAuthDescription
Returns the authenticated business organisation's subscription tier and enabled feature flags.
Body / Params
—Response
200 OK — { tier: string, features: Record<string, boolean> }/api/leader/analytics/*requireLeaderAuthDescription
Leader analytics suite — 10 endpoints covering KPIs, engagement, performance, AI report generation, and export (CSV/XLSX/JSON/PDF by tier).
Body / Params
Varies by endpoint; see src/server/api/leader/analytics/Response
200 OK — variesMySQL Schema (Drizzle ORM)
11 tables with SOC 2 / GDPR-compliant soft deletes on all core entities. Schema defined in src/server/db/schema.ts. Migrations in scripts/migrations/.
usersCore identity table. Stores credentials, subscription tier, Stripe customer ID, and soft-delete columns. Contains PII — subject to GDPR Article 17 anonymization.
executive_profilesLeader profiles with sectors, functions, engagement types, availability, and verification status. Contains PII — subject to GDPR Article 17 anonymization.
business_profilesCompany profiles capturing industry, size, leader needs, and engagement budget.
profile_verificationsVerification workflow state machine for both executive and business profiles.
audit_activity_logsImmutable append-only compliance log. Application role may only INSERT/SELECT — never UPDATE or DELETE. Satisfies SOC 2 CC6.8 and ISO 27001 A.12.4.
leader_applicationsCaptures /apply wizard submissions across all 4 steps. Linked to Stripe session on tier selection.
business_onboarding_submissionsCaptures /onboarding wizard submissions across all 4 steps.
feature_flag_audit_logDB-backed audit trail for all feature flag changes. Replaces prior in-memory array. Satisfies SOC 2 CC6.1 change management controls.
email_templatesStores all transactional email templates. Seeded from defaults on first access. Editable via admin UI at /admin/templates.
security_scan_reportsPersistent security scan history. Each run creates a running record then updates with full report JSON and severity counts.
data_breach_incidentsIncident response records for data breaches. Tracks GDPR 72-hour DPA notification countdown and affected user scope.
Soft Delete Rule
Hard DELETE statements on core tables are prohibited. All deletions must set deleted_at, deleted_by, and deletion_reason. Application queries must always filter WHERE deleted_at IS NULL.
Audit & Compliance Architecture
SOC 2 Type II, GDPR, and ISO 27001 controls implemented across the platform. Audit middleware in src/server/lib/audit.ts.
Audit Context Middleware
Every mutating API handler calls buildAuditContext(req) to extract actor identity, then passes the context to writeAuditLog().
from '../lib/audit.js';
// In your handler:
const ctx = buildAuditContext(req);
await writeAuditLog(ctx, {
tableName: 'users',
recordId, action: 'UPDATE',
oldData, newData, changedFields,
});
GDPR Article 17 Anonymization
PII is anonymised in-place across users, executive_profiles, and historic audit_activity_logs JSON payloads. Audit rows are never deleted — structural integrity is preserved. A final ANONYMIZE event is appended to the audit log.
{
"userId": "<uuid>",
"adminActorId": "<uuid>"
}
Audit Action Types
INSERTNew record created
UPDATERecord fields modified
SOFT_DELETEdeleted_at set — record hidden from application queries
RESTOREdeleted_at cleared — record made active again
DELETEHard delete — prohibited on core tables; logged if it occurs
ANONYMIZEGDPR Article 17 PII erasure — PII fields overwritten, audit row preserved
CC6.1Actor attribution via JWT sub on every mutating request; feature-flag changes logged to DB
CC6.2Role-based access control with 4 admin roles and 14+ granular permissions
CC6.8 / CC7.2Append-only audit log — application role has INSERT/SELECT only, never UPDATE/DELETE
Art. 5(1)(f)Full JSON payload snapshots on all mutating operations; PII redacted on ANONYMIZE
Art. 17Right to Erasure — PII anonymised in-place; audit row structural integrity preserved
Art. 33Data breach incidents tracked with 72-hour DPA notification countdown
A.9.4Brute-force defence and account lockout on authentication endpoints
A.10.1AES-256-GCM field-level encryption for sensitive data at rest
A.12.4NDJSON structured logger with PII redaction; all logs include correlation_id
A.16.1Incident response workflow with severity classification and DPA notification tracking
Identity & Access Management
Identity and Access Management (IAM) system covering employee roles, team assignments, policy enforcement, break-glass access, and customer impersonation with dual-control approval. Migrations 0015–0016.
IAM Database Tables
iam_employees — admin staff with roles and MFA statusiam_teams — organisational groupingsiam_policies — named permission setsiam_role_assignments — employee ↔ policy bindingsiam_break_glass_requests — emergency access with dual-control approvalimpersonation_tickets — customer impersonation with step-up MFAleader_impersonation_sessions — scoped JWT (15-min max) with red/black hazard banneriam_audit_log — all IAM mutations logged
Compliance Requirements
- Dual-control approval required for all customer impersonation sessions
- Break-glass requests require two approvers from separate IAM teams
- Leader impersonation tokens are scoped JWTs with 15-minute maximum TTL
- All IAM mutations are written to iam_audit_log — append-only
- Step-up MFA required before impersonation ticket launch
Read-only access to admin portal
Can manage applications and customers
Full admin portal access
Security scan, incidents, IAM management, impersonation approval
Stripe Configuration
Platform-managed Stripe integration (AU). Secrets are provisioned automatically — do not add STRIPE_SECRET_KEY or STRIPE_PUBLISHABLE_KEY manually. Account and price IDs are stored in platform secrets, not in this document.
Stripe (AU)AUDAUD $149/moAUD $349/moAUD $699/moSTRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY (platform-managed — do not add manually)Checkout Flow
The /apply wizard POSTs to POST /api/stripe/create-checkout-session on step 4 tier selection, then redirects to the Stripe-hosted checkout URL. On success, the browser lands on /checkout/success?session_id=… which calls GET /api/stripe/session/:sessionId to confirm payment.
Security Note
Stripe account identifiers, price IDs, and webhook secrets are not documented here. Retrieve them from the platform secrets store or the Stripe dashboard under authorised credentials only. Do not commit these values to source control.
Leader Auth & Subscription Tiers
JWT HS256 HTTP-only SameSite=strict cookies. Leader auth gate requires status = 'approved'. Admin auth uses a separate credential store — not the users table. Client-side auth context in src/portal/auth/.
guestFree
- Public profile view
- Browse executive directory
- Submit application
tier1AUD $149/mo
- Social listening
- Smart Inbox
- Executive Profile Hub
- Inbound Matching
tier2AUD $349/mo
- All Tier 1 features
- AI Content Co-Pilot
- Social Proof Builder
- Content Scheduler
- Playbook Library
tier3AUD $699/mo
- All Tier 2 features
- Taackk Amplify
- Engagement Configurator
- Pricing Calculator
- Contracting & Escrow
Key Auth Files
src/portal/auth/types.tsLeaderUser, SubscriptionTier, PermissionFlags interfaces — 12-feature permission matrix across 4 tiers
src/portal/auth/context.tsxLeaderAuthProvider — React context wrapping the entire app via RootLayout
src/portal/auth/hooks.tsuseLeaderPermissions() — resolves feature flags from current tier
src/components/TierGate.tsxSubscription-tier gating component with blurred locked previews and upgrade modal
Test Credentials
Test account credentials are not documented on this page. Retrieve them from the internal secrets store or request access through the IAM portal. Do not share credentials in documentation, chat, or version control.
Admin Routes & RBAC
14 admin routes with role-based access control. All routes require requireAdminAuth middleware. Minimum role is noted per route.
/adminOverview KPIs, recent activity, system health.
/admin/featuresToggle platform features per scope. All changes written to feature_flag_audit_log.
/admin/customersLeader and business account management, status changes, tier overrides.
/admin/auditPaginated compliance log viewer with filters for actor, table, action, and date range.
/admin/iamEmployee management, team assignments, policy configuration, effective permissions.
/admin/impersonationCustomer impersonation tickets with step-up MFA and dual-control approval workflow.
/admin/applicationsLeader application review queue with asset review and status management.
/admin/customer-lifecycleOnboarding funnel, churn risk, and lifecycle stage management.
/admin/templatesEdit transactional email subject and HTML body. Changes persist to DB.
/admin/email-validationDuplicate detection, cluster merge/split, and application flag management.
/admin/algorithm-libraryMatching algorithm versioning, promotion, and A/B test configuration.
/admin/pricingSubscription plan management, archiving, and pricing overrides.
/admin/security-scanTrigger and review security scans. Results persisted to security_scan_reports.
/admin/incidentsData breach incident response. GDPR 72-hour DPA countdown, DPA notification modal.
Pages & Routes
All routes registered in src/routes.tsx. RootLayout (header + footer) wraps every public page. SSR via React Router v8 data router.
//pricing/about/onboarding/apply/login/profiles/portal/*/leader-portal/*/admin/*/developersTechnology Stack
Key dependencies and architectural decisions.
Frontend
- React 19 + TypeScript
- Vite (SSR via React Router v8)
- Tailwind CSS + shadcn/ui
- Motion (animations)
- @dr.pogodin/react-helmet (SSR head)
Backend
- Express.js (API routes)
- MySQL + Drizzle ORM
- Custom TypeScript migrations (scripts/migrations/)
- Stripe (AU, AUD, platform-managed)
- WebSocket server (real-time messaging)
Security
- JWT HS256 HTTP-only SameSite=strict cookies
- AES-256-GCM field-level encryption at rest
- NDJSON logger with PII redaction
- Rate limiting + brute-force defence
- security.txt at /.well-known/security.txt
Compliance
- SOC 2 Type II architecture
- GDPR Art. 17 anonymization + Art. 33 incident response
- ISO 27001 A.9.4 / A.10.1 / A.12.4 / A.16.1
- Immutable append-only audit log
- Data retention scheduler
- GDPR data export endpoint
Content Layer
- src/content/ — all user-visible copy
- virtual:content imports only
- No content prop-drilling into sub-components
- Inline .map() bodies for editable lists
Key Rules
- No hardcoded hex colors in components
- No VITE_ prefix on secrets
- Secrets via getSecret() from #airo/secrets
- .js extensions required in API route imports
- No .returning() in MySQL (use insertId pattern)
- db.execute<T>() returns [T[], FieldPacket[]] tuple