# Build a Community Forum in Lovable

- Tool: Lovable Prompts
- Last updated: June 2026

## TL;DR

Paste the starter prompt into Lovable Agent Mode and get a working community forum: categories, threaded posts and comments, upvote and downvote with score triggers, anti-spam rate-limiting, OpenAI Moderation, Supabase Realtime feed, and a moderator dashboard. Full build takes roughly one day. Expected credit burn: 100-180 on a Pro $25/mo plan.

## Frequently asked questions

### How do I stop spam without manual moderation around the clock?

Three layers working together: (1) Email confirmation on signup (Cloud tab → Users & Auth → Confirm email ON) — prevents disposable-email bot signups. (2) The posts_rate_limit() trigger rejects more than 5 posts per user per 10 minutes at the database level, before any client code runs. (3) The moderate-post Edge Function routes flagged content to the moderation queue automatically. With all three active, most spam waves burn out before causing visible damage. The new-account gating follow-up adds a fourth layer: posts from accounts younger than 7 days are auto-queued regardless of moderation result.

### Does the OpenAI Moderation API cost money?

In practice, no. The Moderation endpoint (api.openai.com/v1/moderations) was originally free and is now bundled with any OpenAI API account. At forum scale (hundreds or thousands of posts per month), you will not see it on your OpenAI bill. It's a different endpoint from chat completions — it's specifically designed as a safety check and is priced near zero. Just add your OPENAI_API_KEY to Cloud tab → Secrets and it will work.

### Can I handle 1,000 concurrent users on the Free tier?

Not comfortably, if they all have the Realtime feed open. Supabase Free caps at 200 concurrent Realtime connections. With 1,000 concurrent users and each browser tab holding one Realtime channel subscription, you'll see 403 errors and dropped connections starting around 200 users. The fix is Supabase Pro ($25/mo, 500 concurrent connections) or replacing the per-client Realtime subscription with a polling approach for the feed (fetch every 30 seconds with stale-while-revalidate). The 500MB DB cap itself handles 5M+ posts, so posts volume is not the constraint.

### How do I prevent users from creating throwaway accounts to spam?

Enable email confirmation (Cloud tab → Users & Auth → Confirm email ON). This forces every new account to click a link in a real email before they can post — creating hundreds of throwaway accounts becomes time-consuming. For additional protection, add the new-account gating follow-up that auto-queues first posts from accounts younger than 7 days. If you're seeing bot waves even with email confirmation, add Cloudflare Turnstile to the signup form (free tier, ~1M solves per month) — the follow-up for spam wave handling includes this.

### Should I use threaded comments or flat comments?

Threaded works best for Q&A and technical discussion categories where replies are directed at specific comments. Flat works better for casual conversation and shorter threads. This kit scaffolds threaded comments via parent_comment_id, rendered recursively up to 3 levels deep. Beyond 3 levels, show a 'continue this thread' link that opens the sub-thread in its own view. If you decide flat is better for your community, update CommentThread to ignore parent_comment_id and sort all comments by created_at instead.

### How do I migrate an existing Discord community to this forum?

There is no automated migration path from Discord to a Lovable forum. What you can do: export Discord message history via the Data Export tab in Discord Server Settings, which gives you a ZIP of JSON files per channel. Write a one-time import script (a Supabase Edge Function is easiest) that reads the JSON, creates profiles for each Discord user, maps Discord channels to forum categories, and inserts posts and comments with created_at set to the original Discord timestamp. Votes cannot be migrated — start fresh. Plan for a transition period where you point people to the new forum while keeping Discord read-only for a month.

### When does Discourse make more sense than building in Lovable?

If your build outgrows this prompt kit and you need custom architecture, RapidDev builds production-grade Lovable apps at $13K-$25K — book a free 30-minute consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-community-forum
© RapidDev — https://www.rapidevelopers.com/lovable-prompts/lovable-prompts-for-building-community-forum
