DTECH Cloud:

Serverless Hosting & Data Capture
Back to Gateway

1. System Overview

D-TECH Cloud is a centralized platform designed to allow users to securely deploy hosted websites (or templates) and capture form submissions from those sites seamlessly. The architecture separates the user-facing dashboards and management screens (static HTML interfaces) from the backend API services (Cloudflare Workers) and the actual live site hosting (Vercel).

Primary Goals & Functions:

2. Architecture & Data Flow

The system is organized into a modular three-tier architecture:

1. Frontend UI (Static HTML):

2. Backend API (Cloudflare Worker - worker.js):

3. External Integrations:

Data Capture Flow:

1. User deploys a site. The worker bundles injection.js directly into the </body> tag of the user's HTML.

2. A visitor loads the Vercel-hosted subdomain. The injection.js script actively binds to forms and captures idle typing and form submissions.

3. Upon submission (or clicking submit-like buttons), the script prevents the default form action and uses fetch to POST the data to the Cloudflare Worker's /api/capture endpoint.

4. For multi-stage captures (Two-Page Redirect), Stage 1 data is temporarily stored in sessionStorage and redirected to /verify/ where Stage 2 gathers the rest of the inputs, combining both payloads before transmission.

3. Frontend Files Breakdown (High-Level Summary)

4. Backend Logic & API Endpoints (`worker.js`)

The Cloudflare Worker routes all requests dynamically and handles CORS headers correctly to ensure the web UI can communicate seamlessly.

Data Storage (Cloudflare KV Keys):

Key API Endpoints:

Authentication & User Management:

Public Deployments & Sites:

Data Capture:

Templates:

Payments & Upgrades:

Admin Routes (Protected by Admin Cookie):