This is a Next.js project bootstrapped with create-next-app.
Before you begin, ensure you have met the following requirements:
- Node.js: Make sure you have Node.js installed on your machine. You can download it from nodejs.org.
To run this project, you need to set up environment variables for Firebase. These variables contain sensitive information and should not be hard-coded in your codebase. Follow these steps to set up the required environment variables:
-
Create a Firebase Project:
- If you haven't already, create a Firebase project on the Firebase Console.
-
Obtain Firebase Configuration:
-
In the Firebase Console, select your project.
-
Go to Project settings (gear icon) > General.
-
Under the "Your apps" section, select the web app you are using for this project.
-
You will find the Firebase configuration object, which includes the following properties:
apiKeyauthDomainprojectIdstorageBucketmessagingSenderIdappId
-
-
Set Up Environment Variables:
-
In your project directory, create a
.env.localfile (if it doesn't already exist). -
Add the following lines to the
.env.localfile:NEXT_PUBLIC_API_KEY=<Your-API-Key> NEXT_PUBLIC_AUTH_DOMAIN=<Your-Auth-Domain> NEXT_PUBLIC_PROJECT_ID=<Your-Project-ID> NEXT_PUBLIC_STORAGE_BUCKET=<Your-Storage-Bucket> NEXT_PUBLIC_MESSAGING_SENDER_ID=<Your-Messaging-Sender-ID> NEXT_PUBLIC_APP_ID=<Your-App-ID> NEXT_PUBLIC_GEMINI_API_KEY=<your-gemini-api>
Replace
<Your-API-Key>,<Your-Auth-Domain>, etc., with the respective values you obtained from Firebase.- Save the
.env.localfile.
-
-
Load Environment Variables:
- Ensure that you have a method to load environment variables in your Next.js application. You can use packages like
dotenvor Vercel's built-in support for environment variables.
- Ensure that you have a method to load environment variables in your Next.js application. You can use packages like
-
Enabling Authentication:
Google Authentication:
- Go to the Firebase Console and select your project.
- Navigate to the "Authentication" section and click on the "Sign-in method" tab.
- Click on "Add new provider", then find "Google" and enable it. Configure OAuth consent screen details if required.
- Google Authentication is now enabled in your project.
For detailed instructions, refer to the Firebase's Google Authentication documentation.
Github Authentication:
- Go to the GitHub Developer Settings and create a new GitHub OAuth application.
- Set the "Application Name", "Homepage URL" and ensure the "Authorization callback URL" matches your Firebase project's settings. Register the application.
- Note the "Client ID" and "Client Secret."
- In the Firebase Console, on your project, navigate to the "Authentication" section.
- Enable GitHub Authentication in the "Sign-in method" tab by providing the "Client ID" and "Client Secret" obtained from GitHub. Configure OAuth consent screen details if required.
- Github Authentication is now enabled in your project.
For detailed instructions, refer to the Firebase's GitHub Authentication documentation.
-
Start Your Application:
- You can now start your Next.js application. The Firebase configuration will be loaded from the environment variables you set up.
Provide information on how to use your project once the environment variables are set up correctly.
We welcome contributions from the community! If you're interested in contributing to this project, please read our contribution guidelines.
This project is licensed under the [License Name] - see the LICENSE.md file for details. and contributions are welcome!