This application provides a WebSocket server for interacting with the Gemini API and a Next.js frontend application for the client-side interface.
Before running the application, ensure the following are installed on your system:
- Python 3.8 or higher
- pip (Python package installer)
- Node.js (LTS version recommended)
- npm or yarn (for managing frontend dependencies)
-
Navigate to the Backend Directory:
cd backend -
Install Dependencies: Install the required Python packages by running:
pip3 install -r requirements.txt
-
Run the Backend Server: Start the WebSocket server by executing:
python3 main.py
The server will start running on
localhost:9080.
-
Open a New Terminal: Open another terminal window or tab.
-
Navigate to the Frontend Directory:
cd frontend -
Start the Next.js Application: Run the following commands to start the Next.js development server:
npm install npm run dev
The frontend will be available at
http://localhost:3000.
The application uses environment variables to securely manage sensitive information such as API keys.
- Create a
.envfile in thebackenddirectory. - Add the following content:
GOOGLE_API_KEY=your-google-api-key-here - Replace
your-google-api-key-herewith your actual Google API key.
- Open your browser and navigate to
http://localhost:3000to access the frontend. - Ensure the backend server is running on
localhost:9080. - Interact with the application to verify functionality.
-
Backend Errors:
- Ensure all Python dependencies are installed using
pip3 install -r requirements.txt. - Verify that the
.envfile is correctly set up with the Google API key.
- Ensure all Python dependencies are installed using
-
Frontend Errors:
- Ensure Node.js and npm/yarn are installed.
- Run
npm installin thefrontenddirectory if dependencies are missing.