A Next.js application with Firebase integration and AI capabilities using Google's Genkit framework.
- Node.js (v18 or higher)
- npm or yarn
- Google AI API key
- Firebase project
git clone <your-repo-url>
cd ProgramSudio-Firebase
npm install
Copy the environment template and configure your API keys:
cp .env.example .env
Edit .env
file with your actual API keys:
- Go to Google AI Studio
- Create an API key
- Add it to your
.env
file:
GOOGLE_API_KEY=your_google_ai_api_key_here
- Go to Firebase Console
- Create or select your project
- Go to Project Settings > General > Your apps
- Click Firebase SDK snippet > Config
- Copy the values to your
.env
file:
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key_here
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id_here
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id_here
NEXT_PUBLIC_FIREBASE_APP_ID=your_firebase_app_id_here
npm run dev
The app will be available at http://localhost:9002
npm run genkit:dev
The Genkit Developer UI will be available at http://localhost:4000
npm run genkit:watch
npm run dev
- Start development server with Turbopacknpm run genkit:dev
- Start Genkit AI development servernpm run genkit:watch
- Start Genkit with file watchingnpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLintnpm run typecheck
- Run TypeScript type checking
- Framework: Next.js 15.3.3 with Turbopack
- AI: Google Genkit with Gemini 2.5 Flash
- Backend: Firebase (Auth, Firestore)
- UI: Radix UI components with Tailwind CSS
- Language: TypeScript
- Forms: React Hook Form with Zod validation
src/
├── ai/ # AI flows and Genkit configuration
│ ├── flows/ # AI flow definitions
│ ├── genkit.ts # Genkit setup
│ └── dev.ts # Development entry point
├── app/ # Next.js app directory
├── components/ # React components
└── lib/ # Utility functions and configurations
└── firebase.ts # Firebase configuration
-
Module not found errors after cloning
rm -rf node_modules package-lock.json npm install
-
Genkit API key error
- Ensure
GOOGLE_API_KEY
is set in your.env
file - Verify the API key is valid at Google AI Studio
- Ensure
-
Firebase connection issues
- Check all Firebase environment variables are correctly set
- Verify your Firebase project is active and properly configured
- Check the Next.js documentation
- Review Firebase documentation
- Explore Genkit documentation
- Start with
src/app/page.tsx
for the main application - Explore AI flows in
src/ai/flows/
- Configure Firebase rules and security settings
- Customize UI components in
src/components/
Happy coding! 🎉