A sample project demonstrating AI applications using Firebase Cloud Run functions (2nd generation) and Genkit.
- Image Analysis (Google AI)
- Web Content Analysis (Google AI)
- Chat Message Generation (Google AI & Firestore)
- Image Generation (Vertex AI)
firebase-genkit-sample/
├── .github/
│ └── workflows/ # CI/CD Pipelines sample
├── prompts/ # AI prompt templates
├── src/
│ ├── genkit-functions/ # AI function implementations
│ ├── genkit.ts # Genkit configuration
│ └── index.ts # Deploy Functions
└── terraform/ # Terraform configuration for infrastructure setup (not directly related to Genkit, but used for setting up the overall Firebase project infrastructure)
- Install Genkit CLI
npm i -g genkit
- Install dependencies
npm install
- Set environment variables
export GCLOUD_PROJECT="your-google-cloud-project-id"
export GOOGLE_GENAI_API_KEY="your-api-key"
export GENKIT_ENV="dev"
- Start Genkit emulator for development
genkit start -- npx tsx --watch src/index.ts
or
genkit start -- firebase emulators:start --inspect-functions
- Deploy to Cloud Run functions (2nd generation)
firebase deploy --only functions