A working chat app built on Google's Gemini models, ready to run in your browser. It's an Express and Socket.IO server that streams replies token by token into a clean chat UI. Add your own Gemini API key, run it and start talking to the model.
A ready chat interface in public/index.html, wired to the server over Socket.IO so responses stream in as the model generates them.
The full cloud editor with an integrated terminal and extensions, so you can edit the server and front end in one place.
A small TypeScript server that talks to Gemini through the Google GenAI SDK and keeps the conversation history for context.
Clone, commit and push from the terminal, or connect a GitHub repo whenever you want.
Gemini is Google's family of AI models for text, code and multimodal tasks. This template is a small, complete chat application built on top of it: a Node.js server using Express and Socket.IO, plus a browser chat interface. When you send a message, the server calls Gemini through the Google GenAI SDK and streams the reply back to the page as it's generated.
It's meant as a starting point rather than a finished product. The code is short enough to read in a sitting, so you can see how streaming, the socket connection and the conversation history fit together, then build your own AI features from there.
The server lives in src/app.ts. It sets up Express, serves the static files in public/, and handles chat over a Socket.IO connection. Each incoming message is appended to an in-memory history and sent to Gemini with streaming on, so chunks arrive at the client one after another.
The front end is a single public/index.html with the chat UI. It also checks whether an API key is configured and shows setup instructions when it isn't, which makes the first run friendlier.
You supply your own Gemini API key. Create one in Google AI Studio, copy env.example to .env, and set GEMINI_API_KEY to your key. The free key from AI Studio is enough to try the template.
Then run npm run dev. The server starts on port 3000 and Studio opens the chat interface in a browser preview. If the tab doesn't open on its own, run the Studio Manager: SimpleBrowser Default URL command from the VS Code command palette.
Use it as the base for a support assistant, a writing or coding helper, a documentation Q&A bot, or any app where you want a streaming chat backed by Gemini. The streaming and history handling are already wired up, so you mostly add your own prompts, UI and data.
Yes. You bring your own Gemini API key. Create one for free in Google AI Studio, then copy env.example to .env and set GEMINI_API_KEY. The template doesn't include a key, so nothing calls the model until you add yours.
On port 3000. After npm run dev, Studio opens the chat interface in a built-in browser preview. If it doesn't open automatically, use the Studio Manager: SimpleBrowser Default URL command from the command palette.
The browser and server talk over Socket.IO. The server calls Gemini with streaming enabled and forwards each chunk to the page as it arrives, so you see the reply build up in real time instead of waiting for the whole response.
It calls one of Google's fast Gemini models through the Google GenAI SDK. You can switch the model in src/app.ts if you want a different one.
Yes. The chat UI is a single HTML file in public/ and the server is a short TypeScript file, so you can edit both directly and rebuild your own app around them.
Yes, this template runs on the free tier, so you can launch it without a paid plan. Keep in mind that your Gemini API usage is billed separately by Google according to their terms.