https://github.com/eziodevio/gemini-app
This project demonstrates how to build and deploy a Node.js application that interfaces with the Google Gemini API to generate text based on user input
https://github.com/eziodevio/gemini-app
api gemini-api google gpt nodejs
Last synced: about 1 month ago
JSON representation
This project demonstrates how to build and deploy a Node.js application that interfaces with the Google Gemini API to generate text based on user input
- Host: GitHub
- URL: https://github.com/eziodevio/gemini-app
- Owner: EzioDEVio
- Created: 2024-05-05T01:57:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T12:03:57.000Z (over 1 year ago)
- Last Synced: 2025-12-27T15:59:10.959Z (6 months ago)
- Topics: api, gemini-api, google, gpt, nodejs
- Language: HTML
- Homepage:
- Size: 199 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### README.md for the Gemini App
# Gemini Text Generator App
Welcome to the Gemini Text Generator App! This project demonstrates how to build and deploy a Node.js application that interfaces with the Google Gemini API to generate text based on user input. Follow the steps below to set up and run your own instance of this application.
## see the testing images
gemini-image2.png
gemini-image1.png
## Prerequisites
Before you begin, make sure you have the following installed:
- Node.js (LTS version)
- npm (usually comes with Node.js)
- A Google Cloud account to access Gemini API
## Getting Started
### Step 1: Obtain Your API Key
1. Visit [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project or select an existing one.
3. Navigate to "APIs & Services > Credentials".
4. Click on "Create Credentials" and select "API key". Follow the instructions to create your API key.
5. Once you have your API key, restrict it to the Gemini API to enhance security.
### Step 2: Clone the Repository
Clone this repository to your local machine:
```bash
git clone https://yourrepositoryurl.com/path/to/gemini-app.git
cd gemini-app
```
### Step 3: Install Dependencies
Install the required npm packages by running the following command in the root directory of your project:
```bash
npm install express dotenv node-fetch
```
This will install:
- `express`: A web application framework for Node.js.
- `dotenv`: A module to load environment variables from a `.env` file.
- `node-fetch`: A module to allow using `fetch` in Node.js for making API calls.
### Step 4: Set Up Environment Variables
Create a `.env` file in the root directory and add your API key:
```plaintext
API_KEY=your_api_key_here
```
### Step 5: Start the Server
To run the server, execute:
```bash
node server.mjs
```
The server will start, and you can access the app at `http://localhost:3001`.
## Using the App
After launching the app, navigate to `http://localhost:3001` in your web browser. You will see an interface where you can enter a text prompt. Upon submitting the prompt, the Gemini API generates and displays text based on your input.
## Deployment
For deployment, consider platforms like Heroku, DigitalOcean, or any other cloud service that supports Node.js.
1. Set up an account on the chosen platform.
2. Follow the platform's documentation to deploy your Node.js app.
3. Ensure that your environment variables (like `API_KEY`) are correctly set up in your deployment environment.
## Contributing
Contributions to this project are welcome! Please fork the repository and submit a pull request with your enhancements.
## License
This project is open-sourced under the MIT License. See the LICENSE file for more details.
Thank you for trying out the Gemini Text Generator App!
### Additional Notes
This README provides a detailed guide on setting up and running the application, ensuring users understand how to get everything running and where to place and update necessary configurations.