How profitble/auto works
File Structure
• Top-level files:
• README.md (project summary and usage)
• package.json, tsconfig.json (build/runtime config)
• src/ (code root)
• src/ contains:
• workflow.ts: central orchestrator that imports and chains node modules
• nodes/: each file is a self-contained “node” or step in the pipeline
• types.ts: shared type definitions
• There are no separate frontend/backend folders—this is purely a headless automation engine.
Extract Additional Architecture Insights
• README’s “Architecture” section confirms that each step is its own module and that workflow.ts wires them together.
Main Components
a. Trigger & Input Layer
• Webhook Trigger (receives data from Fillout/Tally)
b. Processing/Transformation Nodes
• Set Fields (field normalization & mapping)
• DocuSeal Contract (contract creation & signing link)
• Send Contract Email (email delivery)
• Wait for Signature (DocuSeal webhook handler)
• Notion Coaching Board (Notion API page & Kanban entry)
• Stripe Onboarding (Stripe Connect setup)
• Welcome Email (final onboarding email)
c. Orchestration Layer
• workflow.ts (imports nodes in sequence, handles errors, passes data context)
d. Shared Types
• types.ts (data contracts passed between nodes)
e. External Services
• Fillout/Tally form service
• DocuSeal API
• Email service (SMTP or SendGrid)
• Notion API
• Stripe API
Relationships and Interactions
• Data flow is strictly linear/sequential: Webhook → Set Fields → DocuSeal → Email → Wait → Notion → Stripe → Welcome.
• workflow.ts invokes each node, passing a context object that contains normalized fields and any tokens/IDs returned by external services.
Architectural Patterns & Principles
• Modular single-responsibility nodes (each TypeScript file in nodes/ focuses on one task)
• Orchestration via composition (workflow.ts assembles the pipeline)
• Strong typing and shared interfaces (types.ts)
• Event-driven trigger/input (webhook) and webhook-based callback (DocuSeal signature)
Relevant Technologies & Frameworks
• TypeScript (language)
• Node.js (runtime)
• npm scripts for dev tasks
• HTTP client libraries (e.g., axios or node-fetch) for API calls
• GitDiagram (for auto-visualizing import graph)
• Webhook → Fillout/Tally service
• DocuSeal Contract & Wait for Signature → DocuSeal API
• Send Contract Email & Welcome Email → Email service
• Notion Coaching Board → Notion API
• Stripe Onboarding → Stripe API