WallpaperMachine
The wallpapers you love. A new home on your Mac.
Thai Travel AI ผู้ช่วยวางแผน Road Trip ทั่วไทย คุยกับ AI ภาษาไทย รับแผนรายวัน พร้อมเส้นทางถนนจริง ปั๊มน้ำมัน ร้านอาหาร และที่พักใน 77 จังหวัด
Translation pending
LifestyleJavaScript · CSSGitHub @tanyimcoffee-hubOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗AI Travel Planner สำหรับวางแผนท่องเที่ยวในประเทศไทย โดยเน้น Road Trip
สร้าง AI ที่เข้าใจภาษาไทย ช่วยวางแผนการเดินทาง และทำงานร่วมกับข้อมูลสถานที่จริงได้
The AI can accept a travel request in Thai and return a structured sample itinerary.
GROQ_API_KEY=... in ai-engine/.env (never commit it), then install both packages:cd ai-engine && npm install
cd ../services/api && npm install
cd services/api
npm start
python -m http.server 8080
The page calls http://localhost:3000. Override it with window.TRAVEL_API_BASE_URL before script.js loads, or add ?api=http://host:port to the page URL.
When the page is opened from localhost, 127.0.0.1 or a file, it calls the API at http://localhost:3000. On any other host (for example a Vercel URL) it calls /api on the same domain.
Groq's free tier allows about 8,000 tokens per minute, which is roughly one plan per minute. When the quota is full the API answers 503 and the page asks the user to wait.
The repo deploys as one Vercel project: the root HTML/CSS/JS are served as static files, and every /api/* request goes to one serverless function (api/index.js) that runs the same Express app as services/api (services/api/app.js).
Files involved:
package.json (repo root): dependencies the function needs (express, cors, dotenv, groq-sdk).api/index.js: exports the Express app as the function.vercel.json: sends /api/* to the function, bundles data/places/**, places_bkk_cnx.json and ai-engine/system-prompt.md with it, and allows up to 60 s per request.Steps:
tanyimcoffee-hub/AFO_team_fatzone.GROQ_API_KEY with your Groq key. Optional: OSRM_URL to use your own routing server.main, either set it as the Production Branch in Settings → Git, or open the branch's Preview deployment.https://<your-project>.vercel.app/api/health, then open the site and create a plan.Notes:
GROQ_API_KEY in the code. If it is missing, /api/plan answers 503 with a clear message.OSRM_URL.To test the same setup locally, install the Vercel CLI and run vercel dev from the repo root (it needs GROQ_API_KEY in a root .env, which is git-ignored).
Repo root, sharing styles.css and script.js (the browser script; not to be confused with services/api/app.js):
index.html (landing): quick-start box (origin, destination, days) that opens the chat page, ready-made trip templates, auto-scrolling feature cards, a region picker for all 77 provinces and a per-province place explorer.plan.html (chat page): a large chat window (trip form, AI replies, reply box for follow-up questions) next to a large map. Links can prefill it, e.g. plan.html?origin=กรุงเทพมหานคร&destination=จันทบุรี&days=2&go=1 (go=1 sends to the AI right away; other params: budget, travelers, tripType, interest)./api/route, with total distance and driving time. If routing fails, it falls back to a dashed straight line and says so. If Leaflet cannot load, an illustrative SVG diagram is shown instead.services/api)| Method | Path | Notes |
|---|---|---|
| GET | /api/health | Status check |
| POST | /api/plan | Body: origin, destination (required), days, budgetTHB, interests[], tripType (one_way/round_trip), travelers (1–50), message (follow-up text, ≤1000 chars), history (≤20 × {role: user|assistant, content}). Returns data = AI response (reply, status, trip, itinerary; stops get lat/lon when known) and meta (places sent, provinces, approximate origin/destination points, attribution). |
| GET | /api/places | Query: province (Thai or English name), type, q, limit (1–200, default 50), offset. |
| GET | /api/places/provinces | All 77 provinces with counts per type. |
| POST | /api/route | Body: points (2–25 × {lat, lon} in driving order). Returns distanceKm, durationMin, legs, geometry ([lat, lon] list) and attribution. Uses the public OSRM demo server by default (free, no key, best effort); set OSRM_URL to use another OSRM server. 400 bad input, 422 no road route, 502 routing service unavailable. |
Errors are { success: false, error } with 400 (bad input), 404 (unknown province), 502/503 (AI quota or bad AI output) or 500.
Tests: npm test in services/api (store) and in ai-engine (validators).
See data/places/README.md. Starter data comes from OpenStreetMap (© OpenStreetMap contributors, ODbL) and is marked unverified. Travel Data team files in data/places/team/ (and the original places_bkk_cnx.json) override OSM rows.