Skip to content

Learn how to implement Google Firebase Authentication in your React, Next.js, TypeScript projects.

License

Notifications You must be signed in to change notification settings

realstoman/nextjs-firebase-auth

Repository files navigation

Firebase Authentication With Next.js

Learn how to implement Google Firebase Authentication in your React, Next.js, TypeScript projects.

NextJS-Firebase-Auth

Demo URL

https://firebase-auth-with-nextjs.netlify.app/

Features

  • Authentication with Google Firebase v9
  • Form validation with Tailwind CSS
  • React context API
  • Custom Hooks
  • Clean UI
  • Protected routes
  • Next.js v13
  • TypeScript v4.9
  • Tailwind CSS v3
  • Forms designed for both light and dark modes
  • Framer motion transitions

To Contribute to this project, please read the Contribution Guidlines

Database Setup

  1. Create a Firebase project here

  2. Make sure the .env file is added to the .gitignore file

  3. Rename the .env.example to .env or .env.local

  4. Add your Firebase project configurations to the .env file. I have already prepared the the environment variables for you.

  5. If you're not familiar with setting up a Firebase project, read this article I wrote for this project available on my website where I have explained every step with screenshots.

Project Setup

  1. Make sure you have Node JS installed. If you don't have it:
brew install node
  1. Clone the repo:
git clone https://github.com/realstoman/nextjs-firebase-auth.git
  1. Open the project folder:
cd nextjs-firebase-auth
  1. Install packages and dependencies:
npm install
  1. Start a local dev server at http://localhost:3000:
npm run dev

Notes

  • Always run npm install after pulling new changes.
  • Feel free to use the code in your projects.
  • I'll be constantly updating this repo as I'll be adding more sections to it, so please always check the projects section of this repo to see what tasks are under todo or in progress.
  • Coming Soon I'll be doing a screencast. Soon I'll be uploading a video to my YouTube channel where I'll be going through the process of creating this project.
  • Contributions are welcome.

License

MIT