{"id":31696692,"url":"https://github.com/poojan38380/trekmate","last_synced_at":"2026-05-06T06:33:32.087Z","repository":{"id":318167551,"uuid":"1070125068","full_name":"Poojan38380/TrekMate","owner":"Poojan38380","description":"Your AI-powered outdoor companion. Plan treks, check live weather, and chat for trail-ready tips—all in a sleek, lightning-fast UI.","archived":false,"fork":false,"pushed_at":"2025-10-05T14:28:32.000Z","size":6403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T16:12:27.668Z","etag":null,"topics":["ai","chatbot","groq","groq-api","groq-llm","hiking","llm","nextjs","openmeteo","openmeteo-api","outdoors","react","tailwindcss","travel-planner","typescript","weather","weather-api"],"latest_commit_sha":null,"homepage":"https://trekmate-ten.vercel.app","language":"TypeScript","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/Poojan38380.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-10-05T10:17:36.000Z","updated_at":"2025-10-05T14:28:36.000Z","dependencies_parsed_at":"2025-10-05T16:22:39.871Z","dependency_job_id":null,"html_url":"https://github.com/Poojan38380/TrekMate","commit_stats":null,"previous_names":["poojan38380/trekmate"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Poojan38380/TrekMate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poojan38380%2FTrekMate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poojan38380%2FTrekMate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poojan38380%2FTrekMate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poojan38380%2FTrekMate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Poojan38380","download_url":"https://codeload.github.com/Poojan38380/TrekMate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poojan38380%2FTrekMate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278981518,"owners_count":26079640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","chatbot","groq","groq-api","groq-llm","hiking","llm","nextjs","openmeteo","openmeteo-api","outdoors","react","tailwindcss","travel-planner","typescript","weather","weather-api"],"created_at":"2025-10-08T17:13:51.102Z","updated_at":"2025-10-08T17:13:55.721Z","avatar_url":"https://github.com/Poojan38380.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"public/TrekMate.png\" alt=\"TrekMate\" width=\"140\" /\u003e\n  \n  \u003ch2\u003eTrekMate AI — Weather‑aware Trek \u0026 Travel Copilot (日本語音声入力対応)\u003c/h2\u003e\n  \u003cp\u003e\u003cstrong\u003eJapanese voice input\u003c/strong\u003e · \u003cstrong\u003eReal‑time weather\u003c/strong\u003e · \u003cstrong\u003eGenerative AI trek plans\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\nTrekMate is a modern, AI-assisted trip planner for hikers and campers. Chat for trail advice, get real-time weather insights, and plan confidently with a fast, responsive interface.\n\n### What it does (at a glance)\n- Fetches weather from a free public API (Open‑Meteo) with no API key required\n- Generates concise trek plans and suggestions using a Groq‑hosted LLM\n- Supports Japanese voice input (and English) using the Web Speech API\n- Detects Japanese text automatically and replies in natural Japanese\n- Provides safety cues and time windows based on forecast analysis\n\n---\n\n## Demo\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"public/demo-1.png\" alt=\"TrekMate landing page\" width=\"48%\" /\u003e\n  \u003cimg src=\"public/demo-2.png\" alt=\"TrekMate AI chat interface\" width=\"48%\" /\u003e\n  \u003cp\u003e\u003cem\u003eLeft: Landing page • Right: AI chat interface\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n- Ask: 「明日、富士山で登山できる？」 or “Weather for Kyoto and a 2‑day plan?”\n- Speak in Japanese by tapping the mic, then switch EN/JA as needed.\n\nNote: Web Speech API support varies by browser. Chrome works best on desktop.\n\n---\n\n## Features\n\n- Japanese voice input (ja‑JP) and English (en‑US) toggle\n- Location geocoding with language awareness (Japanese or English search)\n- 7‑day forecast + 72‑hour hourly analysis\n- Weather summary with warnings, risk level, and best time windows\n- Groq LLM prompt adapts to Japanese/English automatically\n- Clean UI with chat history and follow‑up suggestions\n\n---\n\n## Tech Stack\n\n- Next.js 14 (App Router) + React 18 + TypeScript\n- Tailwind CSS for styling\n- Open‑Meteo for geocoding and forecast (free, no key)\n- Groq API for chat completions (I default to `llama-3.1-8b-instant`)\n- Web Speech API for voice input (client‑side)\n\n---\n\n## Architecture overview\n\n```text\napp/\n  actions/\n    weather.ts       # Server action: geocode + forecast + summary\n    ai.ts            # Server action: Groq chat completion with compact prompt\ncomponents/\n  chat/              # Chat UI, voice controls, and client logic\nlib/\n  weather.ts         # Open‑Meteo integration and forecast analysis\n  types/             # TS types for weather and chat\n```\n\nKey flows I implemented:\n- `getWeatherForLocation(name)` → geocodes (ja/en aware), fetches 7‑day forecast, builds hourly/daily arrays, then `generateWeatherSummary` returns warnings, risk, and best time window.\n- `generateTrekPlan({ destination, weather, summary, userQuestion? })` → builds a compact prompt (to keep tokens low and speed high) and calls Groq.\n- Client hook `useChat()` orchestrates phases, voice input via Web Speech API, and adaptive suggestions.\n\n---\n\n## Getting started\n\n### 1) Install dependencies\n\n```bash\nnpm install\n```\n\n### 2) Environment variables\n\nCopy `.env` from `example.env` and set your Groq key.\n\n```bash\ncp example.env .env\n```\n\nRequired:\n- `GROQ_API_KEY`: your Groq API key\n\nOptional:\n- `GROQ_MODEL`: override model (default: `llama-3.1-8b-instant`)\n\n### 3) Run locally\n\n```bash\nnpm run dev\n```\n\nOpen `http://localhost:3000`.\n\n### 4) Voice input support\n\n- Works in browsers that support the Web Speech API. Desktop Chrome recommended.\n- Use the EN/JA toggle in the input bar to switch recognition language.\n\n---\n\n## How I solved the core requirements\n\n- Japanese voice input: I wired the Web Speech API inside `components/chat/useChat.ts`, created a `recognition` instance lazily, and bound it to a toggle button with an EN/JA language switch in `ChatInput.tsx`.\n- Weather retrieval: I used Open‑Meteo’s free endpoints (`lib/weather.ts`) for both geocoding and forecast. It’s fast and reliable, and it keeps the project free to run.\n- Proposal generation by generative AI: I call Groq’s Chat Completions in a server action (`app/actions/ai.ts`). I send a compacted weather payload to keep latency low and responses focused.\n\n---\n\n## Performance choices I made\n\n- Compact prompt: I slice hourly to 12 and daily to 3 days in the AI prompt to minimize tokens.\n- Server actions with `next: { revalidate }`: I cache weather where safe and disable caching for AI for snappy, fresh responses.\n- Early returns and clear control flow: Less nesting in `useChat()` for readability and speed.\n\n---\n\n## Configuration and customization\n\n- To default to Japanese replies for Japanese input, I detect Japanese characters and set the system prompt accordingly.\n- You can change the model via `GROQ_MODEL` without code changes.\n- The features UI comes from `components` and can be adapted to other themes (fashion, sports, etc.).\n\n---\n\n## Contributing\n\nI’m actively improving this project. Check out CONTRIBUTING.md for setup, branch naming, and commit conventions. PRs that improve voice reliability, UX, or add safety heuristics are very welcome.\n\n---\n\n## Security\n\nPlease read SECURITY.md to report vulnerabilities. Do not open public issues for sensitive reports.\n\n---\n\n## License\n\nMIT — see LICENSE for details.\n\n---\n\n## Acknowledgements\n\n- Open‑Meteo for free weather data\n- Groq for blazing‑fast LLM inference\n- The hiking community in Japan for trail inspiration\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoojan38380%2Ftrekmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoojan38380%2Ftrekmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoojan38380%2Ftrekmate/lists"}