
In this article, we’ll walk through the complete process of building an AI chatbot web app powered by Google Gemini and deploying it to the web using Vercel. We’ll use AssistantUI, a modern framework to create conversational experiences using powerful LLMs.
Step 1: Install the Prerequisites
Before we begin, make sure the following tools are installed on your machine:
Step 2: Set Up the Project Directory
Create a folder named chatbot:
| |
Open the folder in VS
| |
Step 3: Scaffold the Assistant UI App
| |
This command will prompt you to select a template. Choose the chat template. This will create a new folder named assistant-ui with the necessary files and dependencies.
Step 4: Set Up Dependencies
Move into the generated project folder (likely chatbot):
| |
Install the required SDKs:
| |
Step 5: Integrate Google Gemini API
Open the file:
| |
Clear all content in the file and paste the following code:
| |
Get your Google Gemini API Key from the Google AI Studio .
Step 6: Store Your API Key
Create a new environment file in the root directory:
| |
Add the following line:
| |
Make sure to replace Your_API_KEY with your actual API key.
Step 7: Run the Development Server
Start your app locally:
| |
Your application will be live at:
| |
Step 8: Build for Production
Build your app for production:
| |
This command will create a .vercel folder in your project directory.
Clean up: Delete the node_modules folder and .env.local file before uploading to GitHub for security reasons.
Step 9: Upload your code to GitHub
- Create a new repository on GitHub.
- Initialize a new Git repository in your project folder:
| |
- Add your files to the repository:
| |
- Commit your changes:
| |
- Add the remote repository:
| |
- Push your changes:
| |
Step 10: Deploy to vercel
- Go to Vercel and sign in with your GitHub account.
- Click on the “New Project” button.
- Select your GitHub repository.
- Vercel will automatically detect the framework and set up the build settings.
When prompted, add your API key as an environment variable:
| |
Step 11: Your AI Chatbot is Live!
Once the deployment is complete, you will receive a live URL for your chatbot. You can share this URL with anyone to access your AI chatbot.
Final Notes
- Make sure to keep your API key secure and do not expose it in your public repositories.
- This setup gives you a solid starting point to create intelligent AI interfaces.
- You can now customize the UI, add more features, or even connect this to a backend for storing user interactions.