A simple Express.js application that uses Genkit AI to interact with Google AI's Gemini models through a RESTful API.
- REST API to generate AI responses using Google's Gemini 2.0 Flash model
- Express.js backend with organized MVC architecture
- Environment-based configuration
- Node.js (v14 or higher)
- npm or yarn
- Google AI API key
-
Clone this repository
git clone https://github.com/manthanank/genkit-ai-app.git
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your Google AI API key:PORT=5000 GOOGLE_GENAI_API_KEY=your_api_key_here -
Start the server:
npm start # or development mode: npm run dev -
The server will run on
http://localhost:5000by default.
Generate a response using the Gemini model.
{
"prompt": "Your prompt here"
}{
"response": "Generated response here"
}genkit-ai-api
├── .env # Environment variables
├── .example.env # Example environment file
├── .gitignore # Git ignore file
├── index.js # Entry point
├── package.json # Dependencies and scripts
├── README.md # Project documentation
├── controllers/ # Request handlers
│ └── aiController.js
├── routes/ # API routes
│ └── aiRoutes.js
└── services/ # Business logic
└── aiService.js
This project is licensed under the MIT License. See the LICENSE file for details.