Webmap is the platform's multi-tenant routing infrastructure that enables creators to deploy custom-branded websites across unlimited domains without DNS configuration or manual deployment. By resolving domain-to-deployment mappings dynamically from PostgreSQL, webmap allows a single platform instance to serve thousands of distinct branded experiences, each with custom themes, branding, and feature configurations.
This system is foundational to the platform's white-label capability, enabling creators to maintain brand independence while benefiting from centralized infrastructure. Without webmap, the platform would require separate deployments for each brand, making multi-tenant operation infeasible at scale.
ConfigInjector → HTML with Runtime Config → Browser
```
## Key Capabilities
- **Zero-Configuration Domain Routing**: Add new domains via database insert, no nginx reload or DNS changes required. Creators can brand their platform presence instantly.
- **Dynamic Runtime Configuration**: Injects deployment-specific config (theme, branding, API endpoints, feature flags) into HTML at request time, enabling per-deployment customization without rebuilding frontends.
- **SSG + SPA Hybrid Support**: Serves pre-rendered static HTML for Astro sites while falling back to SPA routing for React apps, optimizing for both SEO and interactivity.
- **1-Minute Cache with Database Health Checks**: In-memory caching reduces PostgreSQL load while maintaining fast failover and readiness probes for container orchestration.
-`website_apps` table: app-to-domain mappings, base paths, feature flags
- Nginx (production): Proxies to webmap-router, handles SSL termination
- Static file storage: `/var/www/apps/` (build artifacts from frontend features)
### External Dependencies
None. Webmap is a platform-internal service with no third-party API dependencies.
## Business Value
### Revenue Impact
- **White-Label Scalability**: Enables unlimited creator-branded deployments without linear infrastructure costs, supporting high-margin subscription tiers.
- **Time-to-Market**: New domains go live in <1minute(databaseinsert+cacheexpiry),eliminatingdeploymentbottlenecksthatwoulddelayrevenue.
### Cost Savings
- **Infrastructure Efficiency**: Single router instance serves thousands of domains vs. requiring separate nginx configs or containers per tenant (saves ~$5k/month at 100 deployments).
- **Operational Automation**: Zero manual DNS or deployment work reduces operational overhead by ~40 hours/month.
### Competitive Moat
- **Dynamic Multi-Tenancy**: Most platforms require DNS changes or container deployments for new domains. Webmap's database-driven approach enables instant provisioning that's hard to replicate without similar architectural investment.
### Risk Mitigation
- **Deployment Isolation**: Each deployment gets isolated branding/theme/feature config, preventing cross-tenant data leakage that could cause regulatory or trust issues.
- **Health Monitoring**: Built-in liveness/readiness probes ensure routing failures are detected within seconds, minimizing customer-facing downtime.
**Webmap**: Multi-tenant domain routing engine using Fastify + PostgreSQL to resolve domain requests to static frontends, with dynamic runtime config injection, 1-minute caching, path-based multi-app routing, and zero-configuration domain provisioning (database insert only, no nginx reload).
**Investor Value**: Revenue enabler — enables unlimited white-label deployments without linear infrastructure costs (saves ~$5K/month at 100 deployments), new domains go live in <1minute(eliminatesdeploymentbottlenecks),andreducesoperationaloverheadby40hours/monththroughautomation.