{"id":31221071,"url":"https://github.com/utrodus/gemini-ai-chatbot","last_synced_at":"2026-05-13T23:36:44.513Z","repository":{"id":312284158,"uuid":"1046957500","full_name":"utrodus/gemini-ai-chatbot","owner":"utrodus","description":"Simple Web Chatbot using Google Gemini AI, Node.js, and Vanilla JS. Fast, responsive, and supports Markdown/code formatting","archived":false,"fork":false,"pushed_at":"2025-08-29T14:33:39.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-21T19:44:47.713Z","etag":null,"topics":["chatbot","expressjs","gemini","nodejs"],"latest_commit_sha":null,"homepage":"https://jam.dev/c/d8d71ea8-6f8e-49d9-a02c-e4f2021c8e3f","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utrodus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-29T13:59:17.000Z","updated_at":"2025-08-29T14:33:43.000Z","dependencies_parsed_at":"2025-08-29T17:22:13.764Z","dependency_job_id":null,"html_url":"https://github.com/utrodus/gemini-ai-chatbot","commit_stats":null,"previous_names":["utrodus/gemini-ai-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/utrodus/gemini-ai-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utrodus%2Fgemini-ai-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utrodus%2Fgemini-ai-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utrodus%2Fgemini-ai-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utrodus%2Fgemini-ai-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utrodus","download_url":"https://codeload.github.com/utrodus/gemini-ai-chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utrodus%2Fgemini-ai-chatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33004600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","expressjs","gemini","nodejs"],"created_at":"2025-09-21T19:31:00.461Z","updated_at":"2026-05-13T23:36:44.509Z","avatar_url":"https://github.com/utrodus.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gemini AI Chatbot\n\nA modern, responsive web-based chatbot powered by Google Gemini AI, built with Node.js, Express, and Vanilla JavaScript.\n\n---\n\n**This repository is the final submission for the [\"AI untuk Developer: Maju Bareng AI Bersama Hacktiv8\"](https://www.hacktiv8.com/projects/avpn-asia) program.**\n\n---\n\n## Features\n\n- **Conversational AI**: Uses Google Gemini API for natural language chat.\n- **Modern UI**: Responsive, clean design with custom dialogs and smooth animations.\n- **Markdown \u0026 Code Support**: AI responses are rendered with Markdown formatting and syntax-highlighted code blocks.\n- **Conversation Management**: Easily clear messages or start a new chat session.\n- **Suggestion Chips**: Quick-start prompts for users.\n- **Accessibility**: Keyboard navigation and focus management in dialogs.\n- **Frontend/Backend Separation**: RESTful API backend and static frontend.\n\n---\n\n## Project Structure\n\n```\ngemini-chatbot-api/\n├── index.js                # Express backend server\n├── package.json            # Project dependencies and scripts\n├── extract-text.js         # Utility for extracting text from Gemini API responses\n├── public/\n│   ├── index.html          # Main frontend HTML\n│   ├── style.css           # Custom styles for chatbot UI\n│   ├── script.js           # Frontend chat logic (API calls, DOM updates)\n│   └── controls.js         # Chat control logic (dialogs, clear/reset actions)\n└── README.md               # Project documentation\n```\n\n---\n\n## Getting Started\n\n### 1. Clone \u0026 Install\n\n```bash\ngit clone https://github.com/utrodus/gemini-ai-chatbot.git\ncd gemini-ai-chatbot\nnpm install\n```\n\n### 2. Environment Setup\n\nCreate a `.env` file in the root directory:\n\n```\nAPI_KEY=your_google_gemini_api_key\nPORT=3000\n```\n\n### 3. Run the Server\n\n```bash\nnpm start\n```\n\nThe server will start at `http://localhost:3000`.\n\n---\n\n## Usage\n\n- Open `http://localhost:3000` in your browser.\n- Type a message and hit **Send**.\n- Use **Clear Messages** to clear the chat but keep the session.\n- Use **New Chat** to reset and return to the welcome screen.\n- Click suggestion chips to try example prompts.\n\n---\n\n## Key Files\n\n### [`index.js`](./index.js)\n- Express server setup\n- `/api/chat` POST endpoint for Gemini API\n- Serves static files from `/public`\n\n### [`package.json`](./package.json)\n- Dependencies: `express`, `@google/genai`, `dotenv`, `cors`\n- Scripts: `start`, `watch`\n\n### [`public/controls.js`](./public/controls.js)\n- Handles chat controls (clear, reset)\n- Implements custom modal dialogs\n\n### [`public/script.js`](./public/script.js)\n- Handles chat form, API requests, message rendering\n- Supports Markdown and code formatting\n\n### [`public/style.css`](./public/style.css)\n- Responsive layout\n- Custom dialog, chat bubbles, suggestion chips, and animations\n\n---\n\n## Custom Dialogs\n\n- Replaces browser `confirm` dialogs with a clean, animated modal.\n- Keyboard accessible (Enter/ESC).\n- Used for \"Clear Messages\" and \"New Chat\" actions.\n\n---\n\n## API Reference\n\n### `POST /api/chat`\n\n**Request Body:**\n```json\n{\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"Hello, Gemini!\" }\n  ]\n}\n```\n\n**Response:**\n```json\n{\n  \"result\": \"Hello! How can I assist you today?\"\n}\n```\n\n---\n\n## Extending \u0026 Customizing\n\n- **Styling**: Edit `public/style.css` for colors, layout, and animations.\n- **Frontend Logic**: Add features in `public/script.js` or `controls.js`.\n- **Backend**: Extend API endpoints in `index.js`.\n\n---\n\n\n---\n\n## Credits\n\n- [Google Gemini AI](https://ai.google.dev/)\n- [Express](https://expressjs.com/)\n- [Marked.js](https://marked.js.org/) (for Markdown parsing)\n- [Highlight.js](https://highlightjs.org/) (for code syntax highlighting)\n\n---\n\n## Author\n\nBuilt by Utrodus Said Al Baqi — 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futrodus%2Fgemini-ai-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futrodus%2Fgemini-ai-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futrodus%2Fgemini-ai-chatbot/lists"}