Skip to main content
Featul is a modern SaaS feedback management platform built with Next.js 16 and deployed as a monorepo. This guide covers self-hosting requirements and deployment options.

Architecture

Featul is built as a Turborepo monorepo with the following structure:
  • apps/app - Main Next.js 16 application (App Router, Turbopack)
  • apps/web - Marketing and documentation site
  • packages/api - Type-safe API layer using jstack over Hono
  • packages/auth - Authentication with better-auth
  • packages/db - PostgreSQL database with Drizzle ORM
  • packages/ui - Shared component library

System Requirements

Ensure your hosting environment meets these minimum requirements before deploying.

Runtime

  • Node.js: >= 20.0.0 (specified in root package.json)
  • Package Manager: Bun 1.2.21+ (recommended) or npm
  • Database: PostgreSQL 14+ (Neon serverless compatible)

Infrastructure

  • PostgreSQL database (recommended: Neon, Supabase, or AWS RDS)
  • Redis instance (Upstash for rate limiting and caching)
  • Object storage (optional, for file uploads)
  • Email service (for authentication and notifications)

Deployment Options

Featul supports multiple deployment platforms:

Vercel

Deploy with zero configuration using Vercel’s platform

Cloudflare

Deploy using Cloudflare Workers with Wrangler

Pre-Deployment Checklist

Before deploying to production:
1

Configure Environment Variables

Set up all required environment variables including database credentials, authentication secrets, and API keys. See Environment Variables.
2

Set Up Database

Provision a PostgreSQL database and run migrations using Drizzle. See Database Setup.
3

Configure Authentication

Set up OAuth providers (Google, GitHub) and configure authentication domains for multi-tenant support.
4

Build and Test

Run bun run build locally to ensure all packages compile successfully without errors.

Multi-Tenancy Considerations

Featul uses subdomain-based multi-tenancy. Ensure your DNS and hosting platform support wildcard subdomains.
Featul implements multi-tenant architecture with subdomain routing:
  • Pattern: {workspace-slug}.featul.com
  • Reserved subdomains: www, app, featul, staging
  • Custom domains supported via DNS verification
  • Cross-subdomain cookie authentication
Your hosting platform must support:
  • Wildcard SSL certificates (*.yourdomain.com)
  • Dynamic subdomain routing
  • Cross-subdomain cookie configuration

Build Process

Featul uses Turborepo for optimized builds:
bun install
The build process:
  1. Turborepo builds packages in dependency order
  2. Shared packages (@featul/db, @featul/auth, @featul/api) build first
  3. Applications (apps/app, apps/web) build last
  4. Next.js optimizes and bundles the application

Production Optimizations

For production deployments:
  • Caching: Configure Redis for session storage and rate limiting
  • CDN: Use Vercel Edge Network or Cloudflare CDN for static assets
  • Database: Enable connection pooling with Neon serverless or PgBouncer
  • Monitoring: Configure Sentry for error tracking (pre-configured)
  • Analytics: Set up analytics and observability tools

Security Considerations

Never commit .env files or expose secrets in your repository.
  • Use environment variables for all secrets
  • Enable HTTPS/TLS for all connections
  • Configure CORS for API endpoints
  • Set secure cookie policies (httpOnly, secure, sameSite)
  • Implement rate limiting with Upstash Redis
  • Use strong random values for BETTER_AUTH_SECRET
  • Configure Content Security Policy (CSP) headers

Next Steps

Environment Variables

Configure required environment variables

Database Setup

Set up PostgreSQL and run migrations

Deploy to Vercel

Deploy your application to Vercel

Deploy to Cloudflare

Deploy using Cloudflare Workers

Build docs developers (and LLMs) love