Wanderpal is a full-stack AI travel assistant built with a React frontend, FastAPI backend, and a powerful agentic AI powered by Langflow. It allows users to plan trips, get real-time hotel and transport information, and browse trending destinations, all while managing conversations and user profiles. DEMO VIDEO: https://drive.google.com/file/d/1WM5z6g35zxXOR7jnJ4bYDZ05VVETkUee/view?usp=sharing
- Core Features
- Tech Stack
- Project Structure
- Local Setup Guide
- How to Run
- Configuration (.env)
- Deployment Guide
- π Full User Authentication: Secure Sign Up & Sign In with password hashing using JWT.
- π€ Persistent User Profiles: Users can view and update their personal information.
- π¬ Multi-Conversation Chat UI: A complete chat interface (similar to ChatGPT/Gemini) that saves and lists all previous conversations in a sidebar, allowing users to resume chats.
- πΎ Persistent Chat History: All user messages and AI responses are saved to MongoDB, linked to both the user and the specific conversation.
- π€ Agentic AI: A sophisticated agent built in Langflow that uses a high-speed LLM (via Groq) and has access to real-world tools (via SerpApi) to:
- Find hotels in any city.
- Find transport options (flights, trains, etc.).
- Perform general web searches.
- β‘ Asynchronous Backend: Uses a task polling pattern (
/chat/asyncand/chat/result) to handle slow agent responses without client-side or server-side timeouts. - π Trending Destinations: A dedicated page using the browser's geolocation to fetch trending nearby locations from the OpenTripMap API.
- Frontend:
- React (with TypeScript)
- Vite (Build Tool)
- TailwindCSS
- ShadCN/ui (Component Library)
- Backend:
- FastAPI (Python Framework)
- Uvicorn (Web Server)
- Motor (Async MongoDB Driver)
- Passlib & Python-JOSE (for JWT Auth)
- Database:
- MongoDB (e.g., MongoDB Atlas)
- AI Service:
- Langflow (Running locally to host the agent)
- Agent Tools: Groq (LLM Inference), SerpApi (Real-time Search)
- Other APIs:
- OpenTripMap API
- SearchAPI api key
This guide details how to get the entire application running on your local machine.
Before you begin, you must get API keys from the following services. These are all required for the app to function.
- MongoDB (
MONGODB_URL): Go to MongoDB Atlas and create a free (M0) cluster. Get the Connection String. - SerpApi (
SERPAPI_API_KEY): Go to SerpApi. This is required for your Langflow agent's tools (Hotel/Transport) to work. - Groq (
GROQ_API_KEY): Go to Groq. This is required for your Langflow agent's LLM. - OpenTripMap (
OPENTRIPMAP_API_KEY): Go to OpenTripMap. This is required for the "Trending" page. - SECRET_KEY: This isn't from a service. You must create this yourself. It should be a long, random, secret string (you can use a password generator).
- Install Langflow:
pip install langflow
- Run Langflow Server:
langflow run
- Import the Flow:
- Open
http://127.0.0.1:7860in your browser and create your local admin account. - Import the flow file located at
/langflow_flow/wanderpal_agent.json.
- Open
- Configure Agent Keys:
- Open the imported flow in the Langflow UI.
- Inside the agent, find the components for your LLM (Groq) and Tools (SerpApi).
- You must add your
GROQ_API_KEYandSERPAPI_API_KEYinto the appropriate fields inside the Langflow UI (or add them as Global Variables in Langflow's settings).
- Get Local Keys: You now need two pieces of info from this local server for your backend:
- Local Flow ID: Open your flow and copy the ID from the browser's URL bar:
(e.g.,
http://127.0.0.1:7860/flows/COPY-THIS-UUID) - Local API Key: Click Settings (gear icon) -> API Keys -> Add New. Create a key and copy it.
- Local Flow ID: Open your flow and copy the ID from the browser's URL bar:
(e.g.,
- Navigate to the
/backenddirectory. - Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Create
requirements.txt: Create a file namedrequirements.txtin the/backendfolder and paste this in:fastapi uvicorn[standard] motor python-dotenv requests httpx passlib[bcrypt] python-jose[cryptography] - Install Dependencies:
pip install -r requirements.txt
- Create
.envFile: Create a file named.envin the/backendfolder. Copy the template from the Configuration section below and fill it in with all the keys you just gathered.
- Navigate to your frontend project directory (e.g.,
/frontendor/wanderpalcode). - Install Dependencies:
npm install
To run Wanderpal, you must have 3 separate terminals open and running at the same time.
langflow run(Leave this running. Your AI is now live at http://127.0.0.1:7860)
# Navigate to your /backend directory
cd path/to/your/backend
# Activate your Python environment
source venv/bin/activate
# Run the FastAPI server
uvicorn main:app --reload(Leave this running. Your API is now live at http://127.0.0.1:8000)
# Navigate to your /frontend directory
cd path/to/your/frontend
# Run the Vite development server
npm run dev(This will output a URL, usually http://localhost:5173. Open this URL in your browser to use the app.)
Create this file as .env inside your /backend directory and fill in all required values.
# --- Database (Required for Login) ---
MONGODB_URL="YOUR_MONGODB_ATLAS_CONNECTION_STRING"
DB_NAME="wanderpal_db"
# --- Security (Create a long random string) ---
SECRET_KEY="YOUR_OWN_LONG_RANDOM_SECRET_PASSWORD"
# --- Local Langflow Connection (Get these from Step 2) ---
LANGFLOW_BASE_URL=http://127.0.0.1:7860
LANGFLOW_FLOW_ID=YOUR_NEW_LOCAL_FLOW_ID_FROM_BROWSER_URL
LANGFLOW_APPLICATION_TOKEN=YOUR_NEW_LOCAL_API_KEY_FROM_LANGFLOW_SETTINGS
LANGFLOW_TOKEN=YOUR_NEW_LOCAL_API_KEY_FROM_LANGFLOW_SETTINGS
# --- IMPORTANT: Leave this blank to force use of your local server settings or paste the url endpoint from the langflow api access (local)---
LANGFLOW_RUN_URL=
# --- Other Service APIs ---
OPENTRIPMAP_API_KEY="YOUR_OPENTRIPMAP_API_KEY"
# --- App Config ---
ALLOW_ANONYMOUS_CHAT=false
LANGFLOW_TIMEOUT_SECONDS=600
LANGFLOW_MAX_RETRIES=3
LANGFLOW_MAX_TOKENS=16000
LANGFLOW_EXPECTED_OUTPUT_TOKENS=512For production deployment, we recommend the following cloud platforms that offer excellent support for full-stack applications:
Recommended Platform: Render
- β Free Tier Available: Perfect for prototyping and development
- β Zero Configuration: Automatic builds from GitHub repository
- β Environment Variables: Secure handling of API keys and secrets
- β Health Checks: Built-in monitoring and auto-restart
- β Custom Domains: Support for custom domain names
Deployment Steps for Render:
- Connect your GitHub repository to Render
- Create a new Web Service
- Set build command:
pip install -r requirements.txt - Set start command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Add all environment variables from your
.envfile - Deploy automatically on every Git push
Recommended Platform: Vercel
- β Optimized for React: Built specifically for frontend frameworks
- β Free Tier: Generous limits for personal projects
- β Global CDN: Fast loading times worldwide
- β Automatic Builds: Deploy on every Git push
- β Custom Domains: Free SSL certificates
- We can also choose other deployment platforms just because these are freely available we are suggesting.
Deployment Steps for Vercel:
- Connect your GitHub repository to Vercel
- Select the frontend directory (e.g.,
/wanderpalcode) - Set build command:
npm run build - Set output directory:
dist - Add environment variables for API endpoints
- Deploy automatically on every Git push
# Production Backend URL (update after backend deployment)
VITE_API_URL=https://your-backend-app.render.com
# Production Langflow (if using cloud Langflow)
LANGFLOW_RUN_URL=https://your-langflow-cloud-endpoint.com/api/v1/run/your-flow-id
# Security (use strong production secrets)
SECRET_KEY=your-production-secret-key-min-32-charactersThe architecture is designed to be deployment-ready, and the suggested cloud platforms (Render + Vercel) provide a straightforward path to production when ready.
We welcome contributions! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.