Frequently Asked Questions
Find answers to the most common questions about OpenForum setup, configuration, and usage.
🚀 Getting Started
Q: What are the system requirements for OpenForum?
A: OpenForum requires:
- Node.js: Version 18 or higher
- Database: PostgreSQL (local or cloud)
- Package Manager: pnpm (recommended) or npm
- Operating System: Windows, macOS, or Linux
For production deployment, you'll also need:
- Cloud hosting platform (Vercel, Railway, etc.)
- Email service (Resend recommended)
- Domain name (optional but recommended)
Q: How long does it take to set up OpenForum?
A: Setup time depends on your approach:
- Quick local setup: 10-15 minutes
- Full development setup: 30-45 minutes
- Production deployment: 1-2 hours (including domain configuration)
The process is straightforward with our step-by-step guides.
Q: Can I try OpenForum without setting up a database?
A: For quick testing, you can:
- Use the provided demo or sandbox environment
- Deploy to a platform that provides a database (like Railway)
- Use a cloud database service like Neon's free tier
However, for development or production, you'll need a proper PostgreSQL database.
💾 Database Questions
Q: Which database providers are recommended?
A: For cloud databases, we recommend:
- Neon (PostgreSQL, generous free tier, serverless)
- Supabase (PostgreSQL with additional features)
- Railway (PostgreSQL, simple setup)
- PlanetScale (MySQL, requires schema modifications)
For local development:
- Local PostgreSQL installation
- Docker PostgreSQL container
Q: How do I migrate from another forum platform?
A: Migration depends on your current platform:
From Discourse:
- Export data using Discourse API
- Transform data to OpenForum schema
- Use custom migration scripts
- Import user accounts and content
From phpBB/vBulletin:
- Export database dumps
- Map schema differences
- Convert user authentication
- Import content with proper relationships
We're working on migration tools for common platforms. Contact the community for assistance with specific migrations.
Q: What happens if I run out of database storage?
A: Most cloud providers offer automatic scaling:
- Neon: Automatically scales within plan limits
- Supabase: Upgrade plan for more storage
- Railway: Volume expansion available
For self-hosted databases:
- Monitor storage usage regularly
- Archive old content if needed
- Optimize database with cleanup scripts
- Upgrade server storage capacity
🔐 Authentication & Security
Q: How do I reset my admin password?
A: If you're locked out of your admin account:
Option 1: Database Reset
-- Connect to your database
psql "your-database-url"
-- Reset password (requires hashing)
UPDATE "user" SET password = 'new-hashed-password' WHERE email = 'admin@example.com';
Option 2: Create New Admin
-- Create new admin user
INSERT INTO "user" (id, email, name, role) VALUES
('admin-id', 'newadmin@example.com', 'New Admin', 'admin');
Option 3: Use Recovery Method
- Use the "Forgot Password" feature
- Access the recovery email
- Reset through the provided link
Q: How do I set up two-factor authentication?
A: OpenForum supports 2FA through Better Auth:
-
Enable in Configuration:
// lib/auth.ts
plugins: [
twoFactor({
issuer: "OpenForum",
totpWindow: 1,
}),
// ... other plugins
] -
User Setup:
- Go to Profile Settings
- Enable Two-Factor Authentication
- Scan QR code with authenticator app
- Enter verification code to confirm
-
Backup Codes:
- Generate backup codes during setup
- Store securely for account recovery
Q: Can I disable user registration?
A: Yes, you can control registration in several ways:
Environment Variable:
ALLOW_REGISTRATION=false
Code Configuration:
// lib/auth.ts
emailAndPassword: {
enabled: true,
requireEmailVerification: true,
autoSignIn: false,
}
Admin Panel:
- Go to Admin → Settings
- Toggle "Allow New Registrations"
- Set registration approval requirements
📧 Email Configuration
Q: Email verification isn't working. What should I check?
A: Common email issues and solutions:
Check API Key:
# Verify Resend API key format
echo $AUTH_RESEND_KEY # Should start with "re_"
Verify Domain:
- Check domain verification in Resend dashboard
- Confirm DNS records are properly set
- Wait for DNS propagation (up to 24 hours)
Test Email Sending:
// Test email function
import { sendVerificationEmail } from '@/actions/email';
await sendVerificationEmail({
email: 'test@yourdomain.com',
otp: '123456',
type: 'email-verification'
});
Check Spam Folders:
- Verification emails might be filtered
- Whitelist your domain with users
- Configure SPF/DKIM records for better deliverability
Q: Can I use a different email provider?
A: Yes, you can integrate other email services:
SendGrid Integration:
// actions/email.ts
import sgMail from '@sendgrid/mail';
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
export async function sendEmail({ to, subject, html }) {
await sgMail.send({
to,
from: 'noreply@yourdomain.com',
subject,
html,
});
}
Nodemailer (SMTP):
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransporter({
host: process.env.SMTP_HOST,
port: 587,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
});
🎨 Customization
Q: How do I change the forum theme/colors?
A: OpenForum uses Tailwind CSS for styling:
CSS Variables (recommended):
/* app/globals.css */
:root {
--primary: 210 40% 98%;
--primary-foreground: 222.2 84% 4.9%;
/* ... other color variables */
}
.dark {
--primary: 222.2 84% 4.9%;
--primary-foreground: 210 40% 98%;
/* ... dark mode colors */
}
Tailwind Config:
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
500: '#3b82f6',
900: '#1e3a8a',
}
}
}
}
}
Component Customization:
- Modify components in
components/ui/ - Update theme in
components.json - Use CSS modules for component-specific styles
Q: How do I add custom pages?
A: Add new pages using Next.js App Router:
Create Page File:
// app/custom-page/page.tsx
export default function CustomPage() {
return (
<div>
<h1>Custom Page</h1>
<p>Your custom content here</p>
</div>
);
}
Add Navigation Link:
// components/Navigation.tsx
<Link href="/custom-page">
Custom Page
</Link>
Add to Admin Menu (if needed):
// app/forum/admin/layout.tsx
const navItems = [
// ... existing items
{ href: "/forum/admin/custom", label: "Custom Feature" },
];
Q: Can I modify the database schema?
A: Yes, but follow these steps carefully:
Create Migration:
# Modify db/schema.ts with your changes
# Generate migration
pnpm drizzle-kit generate
# Review the generated SQL
# Apply migration
pnpm drizzle-kit migrate
Example Schema Addition:
// db/schema.ts
export const customTable = pgTable("custom_table", {
id: text('id').primaryKey(),
name: text('name').notNull(),
createdAt: timestamp('created_at').defaultNow(),
});
Update TypeScript Types:
// types/index.ts
export type CustomType = InferSelectModel<typeof customTable>;
🚀 Deployment
Q: My deployment fails on Vercel. What should I check?
A: Common Vercel deployment issues:
Build Errors:
# Check build locally first
pnpm build
# Common issues:
# - Missing environment variables
# - TypeScript errors
# - Import path issues
Environment Variables:
- Ensure all required variables are set in Vercel dashboard
- Check variable names for typos
- Verify secret lengths and formats
Database Connection:
# Ensure SSL mode for cloud databases
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
Memory Limits:
- Upgrade Vercel plan if hitting memory limits
- Optimize bundle size
- Use dynamic imports for large components
Q: How do I set up a custom domain?
A: Domain setup varies by platform:
Vercel:
- Go to Project Settings → Domains
- Add your domain
- Configure DNS with CNAME record:
cname.vercel-dns.com - Update environment variables with new domain
Railway:
- Go to Project Settings → Domains
- Add custom domain
- Configure DNS with provided values
- Enable HTTPS
Cloudflare (for additional security):
- Add domain to Cloudflare
- Configure DNS records
- Enable security features
- Use flexible SSL mode
Q: How do I enable HTTPS?
A: HTTPS setup depends on your hosting:
Vercel/Railway/Netlify:
- HTTPS is automatic with custom domains
- Certificates are provisioned automatically
- No additional configuration needed
Self-hosted:
# nginx configuration
server {
listen 443 ssl;
ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/private.key;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Let's Encrypt (free certificates):
# Install certbot
sudo apt install certbot python3-certbot-nginx
# Get certificate
sudo certbot --nginx -d yourdomain.com
⚙️ Administration
Q: How do I backup my forum data?
A: Backup strategies by component:
Database Backup:
# PostgreSQL dump
pg_dump "your-database-url" > forum_backup_$(date +%Y%m%d).sql
# Compressed backup
pg_dump "your-database-url" | gzip > forum_backup_$(date +%Y%m%d).sql.gz
File Backup:
# Application files
tar -czf forum_files_$(date +%Y%m%d).tar.gz /path/to/forum
# Environment variables (excluding secrets)
cp .env.local .env.backup
Automated Backup:
#!/bin/bash
# backup.sh
DATE=$(date +%Y%m%d_%H%M%S)
pg_dump "$DATABASE_URL" | gzip > "backups/forum_${DATE}.sql.gz"
# Upload to cloud storage
aws s3 cp "backups/forum_${DATE}.sql.gz" s3://your-backup-bucket/
Q: How do I moderate content effectively?
A: Content moderation best practices:
Set Clear Guidelines:
- Create comprehensive community guidelines
- Pin guidelines in prominent categories
- Reference guidelines in registration process
Use Admin Tools:
- Review reported content promptly
- Use bulk moderation for spam
- Pin important announcements
- Lock threads when necessary
Build Moderation Team:
-- Promote trusted users to moderators
UPDATE "user" SET role = 'moderator' WHERE id = 'user-id';
Automate When Possible:
- Set up keyword filters
- Use reputation-based permissions
- Implement rate limiting
- Monitor for spam patterns
Q: How do I handle spam attacks?
A: Anti-spam strategies:
Immediate Response:
- Ban offending accounts immediately
- Delete spam content in bulk
- Implement IP-based blocking
- Enable CAPTCHA for registration
Preventive Measures:
// Rate limiting example
export async function createPost(data: PostData) {
const rateLimitKey = `post:${userId}`;
const attempts = await redis.incr(rateLimitKey);
if (attempts > 5) {
throw new Error("Rate limit exceeded");
}
await redis.expire(rateLimitKey, 300); // 5 minutes
// ... create post
}
Long-term Solutions:
- Require email verification
- Implement reputation requirements
- Use content filters
- Monitor registration patterns
🔧 Technical Issues
Q: The forum is running slowly. How can I optimize performance?
A: Performance optimization checklist:
Database Optimization:
-- Add missing indexes
CREATE INDEX CONCURRENTLY idx_thread_category_lastpost
ON thread(category_id, last_post_at DESC);
-- Analyze query performance
EXPLAIN ANALYZE SELECT * FROM thread WHERE category_id = 'cat-id';
Application Optimization:
- Enable Next.js caching
- Optimize image loading
- Use React Server Components
- Implement proper pagination
Infrastructure Optimization:
- Use CDN for static assets
- Enable database connection pooling
- Monitor server resources
- Upgrade hosting plan if needed
Q: I'm getting database connection errors. What should I check?
A: Database connection troubleshooting:
Connection String:
# Test connection manually
psql "your-database-url" -c "SELECT 1;"
Common Issues:
- SSL Requirements: Add
?sslmode=require - Connection Limits: Check database plan limits
- Network Issues: Verify firewall settings
- Credentials: Confirm username/password
Connection Pooling:
// db/drizzle.ts
import { Pool } from 'pg';
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
max: 20, // Maximum connections
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000,
});
Q: How do I troubleshoot OAuth login issues?
A: OAuth troubleshooting steps:
Verify Configuration:
# Check environment variables
GOOGLE_CLIENT_ID=correct-client-id
GOOGLE_CLIENT_SECRET=correct-secret
BETTER_AUTH_URL=https://yourdomain.com # Must match OAuth config
Check Redirect URLs:
- Google Console:
https://yourdomain.com/api/auth/callback/google - GitHub Settings:
https://yourdomain.com/api/auth/callback/github - Must match exactly (HTTP vs HTTPS, www vs non-www)
Debug OAuth Flow:
- Check browser network tab for errors
- Verify OAuth app is active
- Test with different browsers/incognito
- Check OAuth provider status pages
Common Solutions:
- Clear browser cache and cookies
- Verify OAuth app permissions
- Check domain verification
- Update redirect URLs for new domains
🆘 Getting More Help
Q: Where can I get additional support?
A: Support resources:
Documentation:
- Complete documentation with detailed guides
- API reference for developers
- Troubleshooting guide for common issues
Community Support:
- GitHub Discussions for questions
- GitHub Issues for bug reports
- Discord Community for real-time chat
Professional Support:
- Custom development services
- Migration assistance
- Performance optimization
- Enterprise support packages
Q: How do I report a bug or request a feature?
A: Contributing to OpenForum:
Bug Reports:
- Check existing issues first
- Use the bug report template
- Include reproduction steps
- Provide error messages and logs
- Specify environment details
Feature Requests:
- Search existing feature requests
- Use the feature request template
- Describe the use case clearly
- Explain expected behavior
- Consider implementation complexity
Contributing Code:
- Fork the repository
- Create a feature branch
- Follow coding standards
- Add tests for new features
- Submit a pull request
Still have questions? Check our community discussions or open a new issue on GitHub!