from Hacker News

How to Integrate a Next.js 14 App with a React App on the Same Domain?

by bqc on 9/26/24, 1:17 PM with 0 comments

I have two applications: a Next.js 14 app deployed on Vercel, which handles all pre-login pages, and a React app deployed on Firebase that manages all post-login routes. I want to integrate these two apps under the same domain. Specifically, I need guidance on:

1. How to set up routing so that users can seamlessly navigate between the Next.js and React

2. Managing user authentication using Firebase—how can I ensure that when a user logs out, they are redirected to the login page on the Next.js app?

3. Any additional best practices for integrating these two frameworks effectively.