Welcome to the Gemini AI Chatbot! This application allows users to interact with an AI-powered chatbot using natural language. Built with React, Node, Express, and Gemini (Google's Generative AI), it offers a seamless experience for engaging in conversations with an intelligent virtual assistant.
- π User Authentication: Users can create an account or log in securely using a Google account. Please note that only Google login works currently.
- π¬ Real-time Messaging: Users can engage in real-time conversations with the AI chatbot, receiving instant responses to their queries.
- π€ AI-powered Responses: The chatbot utilizes Google's Generative AI technology to generate intelligent responses based on user input.
- π Secure Communication: All user interactions are encrypted to ensure privacy and security.
- π Multi-platform Compatibility: The application is compatible across various platforms, including web browsers and mobile devices.
- βοΈ Customizable Settings: Users can personalize their chat experience by adjusting settings such as language preferences and conversation themes.
- Clone the repository:
git clone https://github.com/xsarahyu/gemini-AI-chatbot.git
- Navigate to the backend directory:
cd backend
- Create an .env file with your Gemini API information:
clientID={your clientID} clientSecret={your clientSecret} secret={your secret} PORT=8420 geminiKey={your geminiKey}
- Install backend dependencies:
npm install
- Run the backend:
node server
- Navigate to the frontend directory (in a new terminal):
cd app
- Install frontend dependencies:
npm install
- Run the frontend:
npm run dev
- The app is now live at http://localhost:5173!
app/src
βββ components
β βββ Footer.jsx
β βββ LandingPage.jsx
β βββ LoginPage.jsx
β βββ MessagesComponent.jsx
β βββ NavBar.jsx
βββ App.css
βββ App.jsx
βββ index.css
βββ main.jsx
backend
βββ server.js
To run Jest tests locally:
- Navigate to the frotnend directory:
cd app
- Install frontend dependencies:
npm install
- Run the tests:
npm test
- You should now see test coverage in your terminal.
Test #1: Simulates entering text into the message input field, clicking the send button, and then verifies that the entered message renders.
- Make sure that the frontend and backend are running, with all dependencies installed.
- Open the Cypress test runner (in a new terminal):
cd app
β‘οΈnpx cypress open
The following steps occur in the Cypress test runner:
- In the test runner, select "E2E Testing."
- You'll be prompted to choose a browser to run the tests in; any is fine.
- Cypress will open a new window containing a list of all the end-to-end tests.
- Click on a test file to run it.
- The selected test will begin execution. You'll see each step being performed in real-time within the Cypress GUI.
- If the test passes, the screen will turn green. If it fails, the screen will turn red, indicating which step failed.
- To run other test files, navigate back to the main page by selecting the "Specs" label in the sidebar.
- From the main page, you can select and run other test files one by one.