System Architecture ๐๏ธ
PostPipe 2.0 uses a modern Monorepo architecture managed by TurboRepo. This allows us to maintain the core SaaS platform, the CLI tools, and shared UI libraries in a single, cohesive repository.
Directory Structure
The high-level structure of the codebase is as follows:
PostPipe-2.0/
โโโ apps/ # Next.js Applications
โ โโโ web/ # The Main SaaS Platform (Dynamic Lab)
โ โโโ dynamic/ # Dynamic App components (Internal)
โ โโโ static/ # Static Site Generation components (Internal)
โโโ cli/ # The CLI Ecosystem
โ โโโ create-postpipe-connector/ # Scaffolder for connectors
โ โโโ components-cli/ # Storage for CLI Templates & Logic
โโโ packages/ # Shared Libraries
โ โโโ ui/ # Shared React/Shadcn UI components
โโโ documentation/ # You are here!
โโโ templates/ # Standard templates for various tech stacks
Key Components
1. The SaaS Platform (apps/web)
This is the heart of PostPipe's cloud offering. It is a Next.js 14 application that handles:
- User Authentication (Dashboard login)
- Connector Management (Registration, Heartbeats)
- Form Building & Management
- Data Ingestion & Relay (The "Pipe" in PostPipe)
2. The CLI Ecosystem (cli/)
PostPipe allows developers to scaffold complex systems locally.
- Wrapper: The CLI tools are typically run via
npx. - Templates: The actual logic for generating code (e.g., Auth systems, E-commerce backends) resides in
cli/components-cli. This modular approach allows us to update templates without forcing users to update a global binary.
3. Shared Packages (packages/)
To ensure design consistency between the SaaS platform and the generated user dashboards (where applicable), we share UI components (buttons, inputs, layouts) via the packages/ui workspace.
Data Flow: The Zero Trust Model
The architecture is designed to support the Zero Trust flow:
- Ingress: A request hits
apps/web(The Lab). - Routing: The Lab looks up the
ConnectorIDand prepares the signed payload. - Tunneling: The Lab forwards the payload to the specific active Connector instance.
- Verification: The Connector verifies the
X-PostPipe-Signature. - Smart Execution: The Connector resolves the
Target DatabaseandDB Type(Smart Resolution) and executes the operation. - Egress: The result is sent back to
apps/weband displayed to the user.