John Chen

Build Applications from Website to Mobile

Firebase Authentication Illustration

An authentication system with Firebase using a signed and encrypted cookie to store session data

View the Site | GitHub | Expo Publish | GitHub(Mobile)

This example creates an authentication system that uses a signed and encrypted cookie to store session data. It uses current best practices as for authentication in the Next.js ecosystem, we use useUser custom hook together with SWR for data fetching.

  • Firebase Authentication with Email/Password, Google Sign In, Facebook Sign In, GitHub Sign, and Email Sign available to authenticate users.
  • The emails registered in Firebase Authentication are saved in a separate database for future data development of individual users, for this illustration Firestore Database.
  • Session data is signed and encrypted in a cookie.

iOS and Android mobile apps are also delivered for authentication demonstration. The apps are developed with React Native, anyone who is interested can test the apps through the Expo Publish Link as above with Expo Go app.

Docker: docker run -p 3000:3000 jglchen/firebase-auth

Screenshot of the Website AppScreenshot of the Mobile App