Skip to content
πŸ“¦ ARCHIVED SNAPSHOT (v1.0) You are viewing historical business logic and documentation for Webpage (planovi.app) v1.0 (frozen on 2026-11-23, commit 69f9463). Switch to Latest β†’

Webpage (planovi-webpage) β€” Business Logic & Modules

Code-Verified Blueprint: 9 modules β€’ 69 documented BR-* business rules β€’ Zero-orphan file coverage.
Switch between Latest and frozen release snapshots using the Documentation Version dropdown at the top of the left sidebar.

Module Specifications Index

#Module SpecificationRule PrefixRules (BR-*)Open [TEAM_WHY]
1Routing, Configuration & Environment BootstrapBR-CFG62
2Internationalization (i18n) & Security Hardening LayerBR-SEC92
3Marketing Landing Page, Shared Layout & UI SystemBR-MKT112
4Two-Step Waitlist & Lead Qualification EngineBR-WLT101
5Contact Form & Lead Alerting PipelineBR-CNT72
6Native PHP + HTMX Blog, SEO & Media LayerBR-BLG102
7Live System Status DashboardBR-STS62
8Legal Document ViewerBR-DOC62
9Internal Docs-as-Code Portal & Deployment ToolingBR-OPS52

Repository Snapshot & Runtime Metadata

  • Repository: PA-IDEAS/planovi-webpage
  • Branch & HEAD Commit: develop @ 69f9463
  • Primary Stack & Pinned Versions:
    • Runtime (Web Application): Native PHP 8.x (target runtime PHP 8.3 per AGENTS.md; zero Composer packages, no composer.json, relies on built-in curl, dom/libxml, mbstring, json, session extensions).
    • Frontend Interactivity & Styling: Vanilla ES2020+ JavaScript (js/script.js, js/waitlist.js), Vanilla CSS (css/style.css), HTMX 1.9.12 (loaded via https://unpkg.com/htmx.org@1.9.12 in blog.php), Phosphor Icons (https://unpkg.com/@phosphor-icons/web), Cloudflare Turnstile v0 (https://challenges.cloudflare.com/turnstile/v0/api.js), Google Fonts Poppins (400;500;600;700;900, latin-ext).
    • Database & Storage Client: Direct cURL calls to Supabase PostgREST (/rest/v1/*, PostgreSQL schemas website and public) and Supabase Storage bucket blog-media (supabase/website_schema.sql).
    • Web Server / Routing Layers: Apache/LiteSpeed .htaccess, Nginx front-controller inside index.php, PHP built-in CLI server router.php.
    • Embedded Docs Sub-Project (docs/): Node.js + Astro 4.16.19 (package.json: ^4.16.1), @astrojs/starlight 0.28.6 (^0.28.2), sharp 0.33.5 (^0.33.5), typescript 5.9.3 (^5.5.4), Mermaid 10.9.0 (CDN in docs/astro.config.mjs).
    • No Dockerfile, docker-compose.yml, composer.json, or GitHub Actions workflows exist in this repository (.github/ is an empty directory after commit d40fc6b).

What This Repo Owns (and What It Explicitly Does NOT Own)

  • Owns:
    • Public marketing website (planovi.app / dev-webpage.planovi.app) with bilingual Polish (pl) and English (en) SSR pages, dark/light theme system, and Zone 1 PLANOVI brand assets (assets/brand/, BRANDING_GUIDE.md).
    • Two-step waitlist acquisition and lead qualification flow (#waitlist on homepage and /login/ gate), including Cloudflare Turnstile verification, one-time SHA-256 update tokens, persistence in website.waitlist, and optional post-response Resend contact/welcome-email dispatch.
    • Contact form submission pipeline (contact-handler.php) writing to website.website_form_messages and dispatching Google Chat webhook alerts.
    • Public SSR + HTMX blog (/blog, /blog/{slug}), dynamic XML sitemap (/sitemap.xml), llms.txt, and website PostgreSQL schema DDL (supabase/website_schema.sql).
    • Live public system status page (/status), static PDF legal document viewer (/documentation), and an embedded repo-local Astro Starlight docs site (docs/).
  • Explicitly Does NOT Own:
    • Authenticated user sessions, user accounts, tenant workspaces, RBAC, energy telemetry, billing, or e-voting (panel.planovi.app β€” owned by planovi-flutter-app and planovi-backend).
    • White-label / Zone 2 customer-embeddable widgets (Scheduler, Dealflow, Agreements) and Supabase GoTrue auth email templates (owned by planovi-microservices).
    • Blog CMS admin UI or media upload UI (content and media are pushed directly to Supabase REST API and blog-media Storage bucket via external automation such as n8n, documented in supabase/API_EXAMPLES.md).
    • app_modules / app_modules_maintenance schema definitions and maintenance toggle controls (this repo only reads them from Supabase public schema in status.php).
    • Canonical brand kit master files (synced downstream from PA-IDEAS/planovi-docs/brand-kit/ via scripts/sync-brand.sh).

Directory Map

planovi-webpage/
β”œβ”€β”€ .htaccess # Apache/LiteSpeed URL rewrites & static file deny rules
β”œβ”€β”€ .gitignore # Ignores docs/node_modules, docs/.astro, docs/dist, .env*
β”œβ”€β”€ .github/ # Empty directory (CI workflow removed in commit d40fc6b)
β”œβ”€β”€ AGENTS.md / CLAUDE.md # AI coding rules (CLAUDE.md is a symlink to AGENTS.md)
β”œβ”€β”€ BRANDING_GUIDE.md # Synced ecosystem Zone 1 / Zone 2 branding guide
β”œβ”€β”€ README.md # Repo overview (non-authoritative)
β”œβ”€β”€ index.php # Nginx front-controller + Marketing landing page SSR
β”œβ”€β”€ router.php # Local PHP built-in server router
β”œβ”€β”€ config.example.php # Template for out-of-webroot dev.php / prod.php overrides
β”œβ”€β”€ config.php # Runtime config loader & site_config()/site_url() helpers (never read/committed secrets)
β”œβ”€β”€ db.php # Dormant MySQL PDO stub (included by index.php, all PDO lines commented)
β”œβ”€β”€ i18n.php # Session bootstrap, security headers emit, PL/EN switcher, __() translator
β”œβ”€β”€ blog.php # Blog index (SSR + HTMX partial handler)
β”œβ”€β”€ blog-post.php # Single blog article view (SSR, JSON-LD, 404 handler)
β”œβ”€β”€ sitemap.php # Dynamic XML sitemap generator (/sitemap.xml)
β”œβ”€β”€ llms.txt # Static AI/LLM discovery text file
β”œβ”€β”€ status.php # Live public module status dashboard
β”œβ”€β”€ documentation.php # Canonical legal PDF viewer (/documentation)
β”œβ”€β”€ docs.php # Near-duplicate legacy legal PDF viewer
β”œβ”€β”€ contact-handler.php # POST JSON/form contact intake -> Turnstile -> Supabase -> Google Chat
β”œβ”€β”€ waitlist-handler.php # POST JSON waitlist step 1 -> Turnstile -> Supabase -> Resend
β”œβ”€β”€ waitlist-qualify-handler.php # POST JSON waitlist step 2 -> token CAS -> Supabase -> Resend
β”œβ”€β”€ cookie-banner.php # Cookie notice UI + localStorage state script
β”œβ”€β”€ deploy.sh # Legacy manual curl FTP upload script (contains hardcoded credentials)
β”œβ”€β”€ login/
β”‚ └── index.php # Public /login/ waitlist gate page (noindex)
β”œβ”€β”€ components/ # Reusable PHP view partials (navbar, footer, logo, icons, waitlist form, blog grid)
β”œβ”€β”€ includes/ # PHP domain/security libraries (blog-repository, security, waitlist)
β”œβ”€β”€ css/style.css # Full Vanilla CSS design system (994 lines, Dark/Light tokens)
β”œβ”€β”€ js/ # Client scripts (script.js, waitlist.js)
β”œβ”€β”€ lang/ # Translation JSON dictionaries (pl.json, en.json)
β”œβ”€β”€ assets/ # Images, favicons, OG image, and synced brand kit (assets/brand/)
β”œβ”€β”€ documents/ # Static PDF legal documents (pl/, en/)
β”œβ”€β”€ supabase/ # PostgreSQL website schema migration & n8n REST API guide
β”œβ”€β”€ scripts/sync-brand.sh # Brand kit sync script pulling from PA-IDEAS/planovi-docs
└── docs/ # Embedded Astro Starlight documentation project

Local Development & Testing Commands

  • Prerequisites: PHP >= 8.3 with curl, dom, mbstring, json extensions; Node.js + npm (only if building docs/); gh CLI (only for scripts/sync-brand.sh).
  • Configure Local Out-of-Webroot Secrets (optional for static pages; mandatory for waitlist endpoints):
    Terminal window
    mkdir -p ../config
    cp config.example.php ../config/dev.php
    # Edit ../config/dev.php to populate waitlist.*, resend.*, and optional overrides
  • Run PHP Web App Locally (with clean URL routing):
    Terminal window
    php -S localhost:8080 router.php
  • PHP Syntax Lint (all PHP files excluding config.php):
    Terminal window
    find . -name '*.php' -not -name 'config.php' -not -path './docs/*' -exec php -l {} +
  • Run/Build Embedded Astro Starlight Docs (docs/):
    Terminal window
    cd docs
    npm install
    npm run dev # Astro dev server
    npm run build # Static build to docs/dist/
    npm run preview # Preview built docs
  • Sync Brand Kit from planovi-docs:
    Terminal window
    ./scripts/sync-brand.sh assets/brand
  • Automated Test Suite: None exists in this repository (no PHPUnit, Playwright, Vitest, or CI checks).

Environment Variables & Config Keys (KEY NAMES ONLY)

The PHP runtime reads zero OS environment variables (getenv() / $_ENV are not used in active source files outside config.php). All configuration is loaded via config.php merging out-of-webroot <web root>/../config/dev.php or <web root>/../config/prod.php (array_replace_recursive) and read via site_config('<dot.key>', $default) or site_url('<link_key>').

Config Key / Server VarWhere Read (file)Required?Purpose
contact.emailindex.php, components/footer.phpYesPublic contact email displayed in contact section, footer mailto:, and Organization JSON-LD
contact.phoneindex.phpYesPublic phone number displayed in contact section and Organization JSON-LD
contact.addressindex.phpYesPhysical address displayed in contact section
links.panel_logincomponents/navbar.phpYes (default per env)Navbar Login button URL (defaults per config.example.php: prod /login/, dev https://dev-panel.planovi.app)
links.demo_bookingindex.phpYesHero primary CTA button (Book Demo / UmΓ³w Demo) target URL
links.pricing_basicindex.phpConditionalBasic tier subscribe button URL (rendered when features.show_pricing_buttons is truthy)
links.pricing_proindex.phpConditionalPro tier subscribe button URL (rendered when features.show_pricing_buttons is truthy)
links.pricing_entindex.phpConditionalEnterprise tier CTA button URL (rendered when features.show_pricing_buttons is truthy)
links.docscookie-banner.php, components/footer.phpYesLink to legal document viewer / privacy policy
links.privacycomponents/waitlist-form.phpYesPrivacy policy link embedded inside waitlist consent checkbox label
links.statuscomponents/footer.phpYesLink to live system status page
links.linkedin, links.twitter, links.facebook, links.instagramcomponents/footer.phpYesFooter social profile links
links.google_play, links.app_storecomponents/footer.phpYesFooter mobile app store download links
features.show_pricing_buttonsindex.phpOptional (default per env)Feature flag showing/hiding pricing CTA buttons (defaults per config.example.php: prod false, dev true)
supabase.urlcontact-handler.php, includes/blog-repository.php, status.phpRequired for live dataBase Supabase project URL (placeholder containing YOUR_PROJECT_ID disables live queries and triggers fallback in blog/status)
supabase.keycontact-handler.php, includes/blog-repository.php, status.phpRequired for live dataSupabase API key (sent as both apikey and Authorization: Bearer) for contact insert, blog read, and status read
supabase.tablecontact-handler.phpOptional (default website_form_messages)Target table name for contact form inserts
supabase.schemacontact-handler.phpOptional (default website)PostgREST Accept-Profile / Content-Profile schema for contact form inserts
turnstile.site_keyindex.phpRequired for contact formPublic Cloudflare Turnstile site key for #contact-form widget
turnstile.secret_keycontact-handler.phpRequired for contact formSecret Cloudflare Turnstile key for contact form verification (fail-closed)
google_chat.webhook_urlcontact-handler.phpOptionalGoogle Chat incoming webhook URL (skipped if empty or contains YOUR_GOOGLE_CHAT)
waitlist.supabase_urlincludes/waitlist.phpRequired (external config only)Supabase URL for waitlist endpoints; missing triggers HTTP 503
waitlist.supabase_service_keyincludes/waitlist.phpRequired (external config only)Supabase service_role key bypassing RLS on website.waitlist; missing triggers HTTP 503
waitlist.supabase_schemaincludes/waitlist.phpOptional (default website)PostgREST profile header for waitlist requests
waitlist.turnstile_site_keycomponents/waitlist-form.php, includes/waitlist.phpRequired (external config only)Dedicated Turnstile site key for waitlist explicit widget
waitlist.turnstile_secret_keyincludes/waitlist.phpRequired (external config only)Dedicated Turnstile secret key for waitlist verification (fail-closed)
waitlist.turnstile_hostnamesincludes/waitlist.phpOptional (default [HTTP_HOST])Array of allowed Turnstile response hostnames (e.g., ['example.com'] for Cloudflare test keys)
resend.api_keyincludes/waitlist.phpOptionalResend API bearer token; Resend is disabled unless both resend.api_key and resend.from are non-empty
resend.fromincludes/waitlist.phpOptionalVerified sender string (e.g. PLANOVI <hello@planovi.app>)
resend.segment_idincludes/waitlist.phpOptionalResend contact segment ID attached on contact creation
resend.reply_toincludes/waitlist.phpOptionalOptional reply_to address on waitlist welcome email
$_SERVER['HTTP_CF_CONNECTING_IP'], REMOTE_ADDRincludes/waitlist.php, contact-handler.phpServer-providedClient IP forwarded to Turnstile siteverify and logged in website_form_messages.ip_address
$_SERVER['HTTP_CF_IPCOUNTRY']waitlist-handler.php, contact-handler.phpServer-providedCloudflare 2-letter ISO country code stored on waitlist/contact rows
$_SERVER['HTTP_HX_REQUEST']blog.phpClient headerTriggers HTMX HTML partial response instead of full page layout
$_SERVER['HTTPS'], HTTP_HOST, REQUEST_URI, REQUEST_METHOD, HTTP_USER_AGENTi18n.php, index.php, router.php, blog-post.php, includes/waitlist.php, contact-handler.phpServer-providedRouting, protocol-aware cookie Secure flag, Turnstile hostname check, method enforcement, and UA capture
HOST, USER, PASS, TARGET_DIR (shell vars)deploy.shHardcoded in scriptLegacy FTP upload script variables (critical security debt: credentials hardcoded in git)


Complete File Coverage Matrix (Zero-Orphan Inventory)

Every non-.git, non-.DS_Store file in PA-IDEAS/planovi-webpage is assigned to exactly one module below.

ModuleRule PrefixAssigned Files / Endpoints / Assets (100% Coverage)
2.1 Routing, Configuration & Environment BootstrapBR-CFG-*.htaccess, router.php, index.php (lines 1–42 front-controller), config.example.php, config.php (contract only; secrets not read), db.php
2.2 Internationalization (i18n) & Security Hardening LayerBR-SEC-*i18n.php, includes/security.php, lang/pl.json, lang/en.json
2.3 Marketing Landing Page, Shared Layout & UI SystemBR-MKT-*index.php (lines 43–600), components/navbar.php, components/footer.php, components/brand-logo.php, components/head-icons.php, cookie-banner.php, css/style.css, js/script.js (lines 1–230, 315–319), assets/dashboard.jpg, assets/hero-bg.jpg, assets/favicon.svg, assets/favicon-32x32.png, assets/apple-touch-icon.png, assets/logo-black.png, assets/logo-white.png, assets/logo-dark.svg, assets/logo-light.svg, assets/og-image.png, assets/brand/* (18 files), BRANDING_GUIDE.md, scripts/sync-brand.sh
2.4 Two-Step Waitlist & Lead Qualification EngineBR-WLT-*waitlist-handler.php, waitlist-qualify-handler.php, includes/waitlist.php, components/waitlist-form.php, js/waitlist.js, login/index.php, supabase/website_schema.sql (website.waitlist table, triggers, RLS, migration)
2.5 Contact Form & Lead Alerting PipelineBR-CNT-*contact-handler.php, index.php (lines 560–590 contact form), js/script.js (lines 231–314 AJAX handler), supabase/website_schema.sql (website.website_form_messages table, triggers, RLS, migration)
2.6 Native PHP + HTMX Blog, SEO & Media LayerBR-BLG-*blog.php, blog-post.php, components/blog-grid-partial.php, includes/blog-repository.php, sitemap.php, llms.txt, supabase/website_schema.sql (website.blog_posts table, storage.buckets 'blog-media', RLS, seed data), supabase/API_EXAMPLES.md
2.7 Live System Status DashboardBR-STS-*status.php
2.8 Legal Document ViewerBR-DOC-*documentation.php, docs.php, documents/pl/polityka_prywatnosci.pdf, documents/pl/regulamin.pdf, documents/en/privacy_policy.pdf, documents/en/terms_and_conditions.pdf
2.9 Internal Docs-as-Code Portal & Deployment ToolingBR-OPS-*docs/astro.config.mjs, docs/package.json, docs/package-lock.json, docs/tsconfig.json, docs/src/env.d.ts, docs/src/content/config.ts, docs/src/components/SiteTitle.astro, docs/src/styles/brand.css, docs/src/assets/logo-dark.svg, docs/src/assets/logo-light.svg, docs/public/favicon.svg, docs/public/brand/* (18 files), docs/src/content/docs/index.mdx, docs/src/content/docs/architecture/{overview,i18n-and-routing,security-and-compliance}.md, docs/src/content/docs/features/{landing-and-components,contact-and-leads,status-page,document-viewer}.md, docs/src/content/docs/developer-guide/{onboarding,brand-guidelines,styling-and-assets,deployment}.md, docs/src/content/docs/support/troubleshooting.md, deploy.sh, README.md, AGENTS.md, CLAUDE.md, .gitignore, .github/