Skip to content

feat: LynxPrompt v2.0 — Self-Hostable Platform Transformation#25

Merged
GeiserX merged 10 commits intomainfrom
feat/v2.0-self-hosting
Feb 25, 2026
Merged

feat: LynxPrompt v2.0 — Self-Hostable Platform Transformation#25
GeiserX merged 10 commits intomainfrom
feat/v2.0-self-hosting

Conversation

@GeiserX
Copy link
Owner

@GeiserX GeiserX commented Feb 25, 2026

Summary

Transform LynxPrompt from a SaaS product into a self-hostable platform for companies to deploy on their own infrastructure.

111 files changed, 2411 insertions, 4288 deletions — net reduction of ~1900 lines (removal of billing/analytics complexity).

What changed

  • Pricing page and subscription tiers removed: No more Free/Pro/Max/Teams. All features available to everyone.
  • Feature flags system: Everything configurable via environment variables — auth methods (GitHub/Google/Email/Passkeys/SSO), AI, Blog, Support Forum, Stripe marketplace.
  • GlitchTip removed: Code (optional Sentry via SENTRY_DSN) + infrastructure (Portainer stack, Caddy, Cloudflare DNS).
  • ClickHouse removed: Analytics engine fully removed (was done in prior commits on main).
  • Database consolidation: Single PostgreSQL by default via docker-compose.selfhost.yml. Multi-DB still supported.
  • Custom branding: APP_NAME, APP_URL, APP_LOGO_URL replace 35+ hardcoded lynxprompt.com references.
  • Dynamic CSP headers: Built from enabled services at startup (no more hardcoded Umami/Turnstile/GlitchTip URLs).
  • Auto-migration: entrypoint.sh runs Prisma migrations on container start.
  • Health check: /api/health now checks database connectivity.
  • Stripe as optional marketplace: Platform commission model — LynxPrompt's Stripe account is default.
  • CLI cleaned up: Removed plan display, subscription prompts.
  • Documentation rewrite: Self-hosting guide, env var reference, pricing/billing docs rewritten.
  • README rewrite: Positioned as self-hostable platform with Docker quick start.

Infrastructure changes (already applied)

  • GlitchTip stack deleted from watchtower (Portainer API)
  • glitchtip.lynxprompt.com removed from Caddy + Cloudflare DNS
  • Gitea prod/dev docker-compose updated with feature flag env vars

Test plan

  • npm run build succeeds without TypeScript errors
  • docker compose -f docker-compose.selfhost.yml up starts with single Postgres
  • Feature flags toggle UI elements correctly (Blog hidden when ENABLE_BLOG=false)
  • Auth sign-in page only shows enabled providers
  • AI routes return 404 when ENABLE_AI=false
  • Billing routes return 404 when ENABLE_STRIPE=false
  • Blog/Support routes return 404 when disabled
  • CSP headers only include enabled services
  • Health check returns 503 when DB is down
  • Prisma migration applies cleanly on fresh and existing databases
  • CLI whoami no longer shows plan badge
  • Self-hosting docs page renders correctly

Document the complete vision for LynxPrompt v2.0: pivot from SaaS to
self-hostable platform with feature toggles, database consolidation,
Stripe platform commission model, and federated interconnect plan.
- Sentry only initializes when SENTRY_DSN / NEXT_PUBLIC_SENTRY_DSN is set
- Remove hardcoded GlitchTip fallback DSN from client provider
- Remove glitchtip.lynxprompt.com from CSP connect-src
- Keep @sentry/nextjs as optional dependency for self-hosted Sentry
- Delete /pricing page and remove from navigation
- Remove TeamBillingRecord model and Stripe subscription fields from schema
- Simplify subscription.ts: all features available to everyone
- Strip Stripe subscription code, keep marketplace blueprint purchases
- Remove paid blueprint creation restriction (was Teams-only)
- Remove AI access subscription check (will be env-var gated)
- Remove Teams billing API (keep team org management)
- Remove pricing/upgrade CTAs from blog, support, blueprints pages
- Remove JSON-LD offers and Team references from homepage
- Create src/lib/feature-flags.ts with all ENABLE_* env vars
- Create FeatureFlagsProvider for client-side flag access
- Expose flags via /api/config/public endpoint
- Dynamic navigation: Blog hidden when ENABLE_BLOG=false
- Gate AI routes behind ENABLE_AI flag
- Gate Stripe/billing routes behind ENABLE_STRIPE flag
- Guard blog routes via layout (ENABLE_BLOG)
- Guard support forum routes via layout (ENABLE_SUPPORT_FORUM)
- Fix all TypeScript errors from schema billing field removal
- Remove billing section from settings, simplify team management
- Update CLI whoami/wizard to remove plan display
- Clean up auth session types (remove subscription fields)
Auth configurability:
- Make OAuth providers conditional on ENABLE_* flags in NextAuth config
- Make Turnstile pass-through when disabled
- Conditionally render login buttons based on enabled providers
- Gate passkey and SSO routes behind feature flags
- Block new user registration when ENABLE_USER_REGISTRATION=false

AI configurability:
- Use AI_MODEL env var instead of hardcoded model name
- Hide AI edit panels when ENABLE_AI=false

Database consolidation:
- Rewrite env.example for v2.0 (single DB defaults, feature flags)
- Create docker-compose.selfhost.yml (minimal 1-Postgres deployment)
- Replace Percona pg_tde with postgres:18-alpine in dev compose
- Add auto-migration to entrypoint.sh (prisma migrate deploy)
- Add UMAMI_SCRIPT_URL build arg to Dockerfile
Branding:
- Replace 35+ hardcoded lynxprompt.com references with APP_URL/APP_NAME
- Make email templates, SEO metadata, API docs use configurable branding
- Make Umami script URL configurable via UMAMI_SCRIPT_URL env var
- Add STATUS_PAGE_URL, CONTACT_EMAIL, PLATFORM_OWNER_EMAIL env vars
- Dynamic next.config.ts remotePatterns based on APP_URL

CSP:
- Build Content-Security-Policy dynamically from enabled services
- Only include Umami/Turnstile/Sentry/CF Insights when configured
- Cache CSP string at startup for performance

Health check:
- /api/health now checks database connectivity (returns 503 on failure)
Migration:
- Create migration to drop billing columns from User/Team models
- Drop TeamBillingRecord table
- All IF EXISTS for safety

Documentation:
- Rewrite pricing docs (remove tiers, explain marketplace commission)
- Rewrite billing FAQ (marketplace payments only)
- Rewrite AI features docs (remove Teams-only language, explain env config)
- Rewrite selling docs (remove subscription requirements)
- Add comprehensive self-hosting guide with env var reference
- Update docs-config.ts with Self-Hosting section
- Position as self-hostable platform, not SaaS
- Add Docker quick start with docker-compose.selfhost.yml
- Full environment variable configuration reference table
- Architecture overview (Next.js 16 + PostgreSQL + Prisma)
- Development setup instructions
- CLI section with self-hosted instance configuration
- Remove all pricing/tier marketing language
Version bump across package.json, cli/package.json, and package-lock.json.
CHANGELOG documents all v2.0 breaking changes, additions, and removals.
- Add `lynxp config` to show current settings
- Add `lynxp config set-url <url>` to point CLI at self-hosted instance
- Add `lynxp config reset-url` to revert to default
- Add `lynxp config path` to show config file location
- Update README to clarify self-hosting, remove "our" language
- Document CLI URL configuration with both env var and config command
@GeiserX GeiserX merged commit 72d0a68 into main Feb 25, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant