YatraFind is a database-grounded travel-planning application. Its Vite frontend sends conversations to a FastAPI backend, which retrieves verified travel records from PostgreSQL and asks OpenRouter for the final answer.
frontend/ Browser client (Vite, static single-page app)
backend/
ai/ OpenRouter client and grounded chat orchestration
routers/ FastAPI HTTP routes
database.py PostgreSQL connection setup
models.py ORM models matching db/YatraFindd.sql
main.py FastAPI application entry point
db/YatraFindd.sql Verified travel-data database dump
YatraFind Main Backend/ Legacy prototype; not part of the runnable app
- Create and import a PostgreSQL database named
yatrafindusingdb/YatraFindd.sql. - Copy
backend/.env.exampletobackend/.env. - Set
DATABASE_URLandOPENROUTER_API_KEYinbackend/.env. Keep this file private; it is ignored by Git.
All model-generated replies use GPT-4o mini (openai/gpt-4o-mini) through OpenRouter. The model is intentionally pinned in the backend and cannot be changed by browser input or an environment variable.
In one terminal:
cd backend
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn main:app --host 127.0.0.1 --port 8000In another terminal:
cd frontend
npm install
npm run devOpen http://localhost:5173.
GET /— health checkGET /api/chat/cities— verified city catalogGET /api/chat/cities/{city_name}— city guide from PostgreSQLGET /api/chat/recommendations?interests=culture,food— deterministic recommendationsPOST /api/chat/— database-grounded OpenRouter chat