This project is a hands-on demo showing how to build a simple AI chatbot using Firebase and the Gemini API through Firebase Extensions. It focuses on creating a context-aware assistant that responds to user questions using information stored in your Firebase project.
You’ll learn how to set up the Firebase services you need, attach the Gemini extension, and connect everything to a lightweight JavaScript frontend.
- Context-aware chatbot powered by the Gemini API
- Firebase Extensions for quick setup and minimal backend code
- Cloud Functions for composing structured prompts
- Firebase Authentication for login
- Firestore for storing context and messages
- Cloud Storage for additional data
- Simple web interface built with JavaScript
- Firebase (Authentication, Firestore, Storage, Cloud Functions)
- Firebase Extensions (Gemini API)
- Node.js 20+
- JavaScript
- Gemini API
Follow the guided codelab used for this project: https://tinyurl.com/intergrate-gemini-api
Slides used during the session: https://tinyurl.com/slides
Make sure you have:
- Node.js 20+
- Firebase CLI 13.6+
- A Google account
- A Firebase project created in the Firebase Console
- A code editor and terminal
- Chrome browser
Check your versions:
node -v
firebase --versiongit clone <your-repo-url>
cd <repo-folder>npm installfirebase loginRun:
firebase initEnable:
- Functions
- Firestore
- Hosting
- Storage (if needed)
Follow prompts and link to your Firebase project.
In your Firebase Console:
- Go to Extensions
- Search for Gemini API Extension
- Install it and configure the required settings
- Deploy your changes:
firebase deployFirst, replace src/lib/firebase.config.js with your own Firebase web app configuration.
Then, run the development server:
npm install
npm run devOpen http://localhost:3000 with your browser to see the result.
You can start editing the app by modifying src/app/page.tsx, src/app/gallery/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
Once the app loads:
- Log in using Firebase Authentication
- Type a question into the chatbot
- The system retrieves context
- Gemini generates a response
- The UI displays the answer
You can evolve this project into:
- An event assistant
- A customer support bot
- A knowledge-base assistant
- A personalized content generator
- A tutoring or learning assistant
Just add more context and adjust the prompt structure.
Feel free to send pull requests, suggest improvements, or open issues. This repo is beginner-friendly.