'use client'; import { useState } from 'react'; import Link from 'next/link'; import Navbar from '@/components/Navbar'; import Footer from '@/components/Footer'; // ─── License server checkout ──────────────────────────────────────── // The marketing site is a Next.js static export (no server runtime), so // checkout is driven client-side by POSTing { planCode, customerEmail } // to the license server at https://licenses.dashcaddy.net. The server // creates a Stripe Checkout session (one-time OR subscription) and // returns { url, sessionId }; we redirect the browser to that URL. // // Plan codes (server-defined in the license service): // premium_30d → $20, 30-day license, one-time or 1-month sub // premium_90d → $50, 90-day license, one-time or 3-month sub // premium_180d → $70, 180-day license, one-time or 6-month sub // premium_365d → $99, 365-day license, one-time or 12-month sub // ───────────────────────────────────────────────────────────────────── const LICENSE_SERVER = 'https://licenses.dashcaddy.net'; type CheckoutMode = 'one-time' | 'subscription'; type CheckoutError = { error: string; detail?: string }; async function startCheckout(mode: CheckoutMode, planCode: string, customerEmail: string): Promise { const endpoint = mode === 'subscription' ? '/api/checkout/subscription' : '/api/checkout/one-time'; const res = await fetch(`${LICENSE_SERVER}${endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ planCode, customerEmail }), }); const data = await res.json().catch(() => ({} as CheckoutError)); if (!res.ok || !data || typeof (data as { url?: string }).url !== 'string') { const message = (data as CheckoutError).error || `Checkout failed (${res.status})`; throw new Error(message); } return (data as { url: string }).url; } function isValidEmail(email: string): boolean { return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.trim()); } export default function PricingPage() { const [selectedPlan, setSelectedPlan] = useState<'30d' | '90d' | '180d' | '365d'>('365d'); const [email, setEmail] = useState(''); const [busy, setBusy] = useState(null); const [error, setError] = useState(null); const planOptions = [ { key: '30d', planCode: 'premium_30d', label: '30 Days', price: 20, perDay: '$0.67/day' }, { key: '90d', planCode: 'premium_90d', label: '90 Days', price: 50, perDay: '$0.56/day' }, { key: '180d', planCode: 'premium_180d', label: '180 Days', price: 70, perDay: '$0.39/day' }, { key: '365d', planCode: 'premium_365d', label: '365 Days', price: 99, perDay: '$0.27/day' }, ] as const; const selected = planOptions.find(p => p.key === selectedPlan)!; const emailOk = isValidEmail(email); async function handleCheckout(mode: CheckoutMode) { setError(null); if (!emailOk) { setError('Please enter a valid email address — that is where your license key will be delivered.'); return; } setBusy(mode); try { const url = await startCheckout(mode, selected.planCode, email.trim()); window.location.href = url; } catch (e) { setError(e instanceof Error ? e.message : 'Checkout failed'); setBusy(null); } } const coreFeatures = [ 'Dashboard & real-time service monitoring', '78 pre-configured app templates', 'Automatic SSL via Caddy internal CA', 'DNS automation via Technitium DNS', 'Reverse proxy management + Caddyfile-as-Code', 'AI Intent Router — natural language commands', 'MCP Server — AI assistant integration', 'Security Center — unified event pipeline', 'Service Discovery — auto-detect containers', 'Smart Defaults Wizard — guided setup', 'WebSocket real-time dashboard updates', 'TOTP 2FA + multi-user admin & invites', 'Audit logging & encrypted credential vault', 'One-click backup & disaster recovery', 'Plugin/extension system', 'REST API & MCP Server for AI assistants', 'Prometheus metrics export', 'i18n — 31 languages (EN/ES/FR/DE/AR + 26 more)', ]; const premiumFeatures = [ 'Everything in Core, plus:', 'Auto-Login SSO for deployed apps', 'Recipes — multi-container stack deployment', 'Swarm — Docker Swarm multi-node orchestration', 'Multi-Host Fleet Management — remote instance control', 'Workflow Automation — scripted multi-step operations', 'Scheduled Backups — automated backup schedules (manual one-click backup stays free)', 'Priority support', 'One active machine per license', '7-day grace period on expiry', 'Fixed-duration license — runs for the duration you buy, then expires', ]; const faqs = [ { question: 'How does the license work?', answer: 'Choose a duration (30, 90, 180, or 365 days) and a payment mode — one-time purchase (license runs for that duration, then expires) or subscription (auto-renews at the chosen interval, time is added to your existing license each renewal, cancel anytime). Enter your email at checkout, pay via Stripe, and your license key is delivered to that email. Paste the key into your DashCaddy dashboard under Admin → License to unlock all premium features for that duration.', }, { question: 'What happens when my license expires?', answer: 'One-time licenses: premium features gracefully deactivate after a 7-day grace period. Your services keep running — only the premium-gated features (SSO, Recipes, Swarm, Fleet Management) become unavailable. Purchase a new license at any time to re-enable them. Subscription licenses: renew automatically at the chosen interval — time is added to your existing license, no re-pasting required. Cancel from your Stripe customer portal at any time; the license stays active until the end of the current billing period.', }, { question: 'One-time or subscription — which should I pick?', answer: 'Pick one-time if you want to pay once and not be billed again. Pick subscription if you want uninterrupted premium access with auto-renewal — at each renewal the next interval of time is added to your existing license, so you paste your key once and never re-paste on renewal. Both modes use the same $20/$50/$70/$99 price points.', }, { question: 'Can I use DashCaddy without Premium?', answer: 'Absolutely. The core platform is fully functional without a license — including AI commands, the Security Center, service discovery, monitoring, manual one-click backup, and all 78 app templates. Premium unlocks SSO, Recipes, Swarm orchestration, Fleet Management, workflow automation, and scheduled backups for advanced multi-node setups.', }, { question: 'How many machines can I activate?', answer: 'One active machine at a time per license. You can deactivate and move to a new machine when needed.', }, { question: 'Is my data safe?', answer: 'DashCaddy runs entirely on your infrastructure. Your data never leaves your server. We have no access to your applications, configurations, or data.', }, { question: 'What payment methods do you accept?', answer: 'We use Stripe for secure payment processing. All major credit cards are accepted. Payments are processed through Stripe\'s encrypted checkout — we never see or store your card details.', }, ]; const [expandedFaq, setExpandedFaq] = useState(0); return (
{/* Hero */}

Simple, Transparent Pricing

The core platform is completely free — including AI commands, Security Center, and all 78 app templates. Premium unlocks SSO, Recipes, Swarm, and Fleet Management. Buy once for a fixed term, or subscribe and never worry about renewal — your license is extended automatically.

{/* Two-column: Core vs Premium */}
{/* Core Plan */}

Core

Everything you need to deploy, manage, and secure self-hosted services — with AI built in.

Free

No license required, no credit card

Read Install Guide

Everything included — no limits

    {coreFeatures.map((feature, i) => (
  • {feature}
  • ))}
{/* Premium Plan */}
Premium

Premium

Advanced orchestration, SSO, and fleet management. Fixed-duration license — runs for the term you choose, then expires.

{/* Plan selector */}
{planOptions.map((opt) => ( ))}
${selected.price} {selected.label.toLowerCase()} license

{selected.perDay}

{/* Email capture — license key is emailed here */}
{ setEmail(e.target.value); if (error) setError(null); }} disabled={busy !== null} className="w-full rounded-lg border border-surface-700 bg-surface-900/60 px-4 py-3 text-sm text-surface-50 placeholder:text-surface-500 focus:border-brand-400 focus:outline-none focus:ring-2 focus:ring-brand-500/30 disabled:opacity-60" />
{/* Two-button checkout: one-time OR subscription */}
{error && (

{error}

)}

🔒 Secure checkout via Stripe · Cancel subscription anytime

Everything in Core, plus

    {premiumFeatures.map((feature, i) => (
  • {feature.startsWith('Everything') ? ( {feature} ) : ( <> {feature} )}
  • ))}
{/* FAQ */}

Frequently Asked Questions

{faqs.map((faq, idx) => (
{expandedFaq === idx && (

{faq.answer}

)}
))}
{/* CTA */}

Ready to Get Started?

Install DashCaddy and start deploying services in minutes. The core platform is free forever.

Installation Guide Back to Home
); }