• DevIntegrations
  • Integrating Flarum with Next.js – Best Approach for My Use Case?

Hello Flarum Community,

I'm planning to integrate a discussion-style forum into my website as a tab (page) within the user dashboard. I want the UI to be similar to FreeFlarum.com, but fully integrated into my Next.js application.

My Setup & Plan

  • My website is built with Next.js (frontend) and a Node.js backend (for authentication and other services).

  • I plan to use Flarum as the forum backend and build the UI in Next.js by making API calls to the Flarum backend.

  • Two options I'm considering:
    Self-hosting Flarum (requires managing PHP, which I have no experience with).
    Using a managed Flarum hosting service (easier, no need for server setup or maintenance).

I’m leaning towards managed hosting because I want a quick and hassle-free setup.

My Questions & Concerns

1️⃣ Is Flarum the right choice for my use case?

I need a forum that allows structured discussions, similar to FreeFlarum integrated into exisitng website and consumed through REST API.
Users should be able to post messages and comments, but not create or edit channels.
The admin panel should allow moderation, approvals, and user management.

2️⃣ Will I need any specific Flarum extensions to achieve this?

My feature requirements are similar to FreeFlarum.com, so I assume the default Flarum setup might work.
Later, I plan to integrate forum moderation features into my own admin panel.

3️⃣ How do I handle authentication for Flarum?

Users on my website should be automatically authenticated to Flarum when they are logged in.
What’s the best approach for this? Should I use SSO, JWT authentication, or another method?
If I use managed Flarum hosting, will I still be able to set up authentication in this way?

Would love to hear suggestions from the community on the best way to integrate Flarum with Next.js, especially regarding authentication and API integration.

Thanks in advance for your insights! 😊

    kyotokamura Is Flarum the right choice for my use case?

    That's very difficult to answer from an outsider perspective. Your use case seems very specific. It would be best for you to try different products and see what suits your needs.

    kyotokamura Will I need any specific Flarum extensions to achieve this?

    There are existing flarum extensions that work on the backend for moderation purposes, these could be helpful to reduce the amount of work on your custom implementation.

    kyotokamura How do I handle authentication for Flarum?

    This depends highly on your own front end implementation. Any solution would probably work as long as the backend is configured for it.

    You mention using managed Flarum hosting. I think it's wise to understand that it does not allow direct database access and any customizations for your managed Flarum installation will need to be part of an extension that we will periodically review for integrity and scalability purposes.

    If you want to go this path, with managed hosting, it would be best to reach out to me personally. Just to provide the level of guidance needed to make your implementation a success.