Your Intelligent Tourism Companion for Dubai - Full-Stack Application with AI-Powered Features
Live Demo: https://dubify-five.vercel.app
A comprehensive full-stack AI tourism application featuring Google Gemini 2.5 Flash AI, Qdrant vector search, intelligent rate limiting, and modern authentication.
- Overview
- Features
- Architecture
- Tech Stack
- Getting Started
- Docker Setup
- Project Structure
- API Documentation
- Deployment
- Contributing
- License
Dubai Navigator AI is a full-stack web application that helps tourists explore Dubai safely and intelligently using AI-powered features:
- π€ AI Tourism Chatbot - Natural conversations about Dubai powered by Gemini 2.5 Flash
- π Semantic Search - Find places by "vibes" using vector embeddings and Qdrant
- π‘οΈ AI Safety Assessment - Real-time location safety analysis with risk scoring
- π Secure Authentication - Clerk-powered auth with Google OAuth
- Polyglot Development: TypeScript frontend + Python backend showcasing versatility
- Modern AI Integration: Google's latest Gemini 2.5 Flash model
- Production Architecture: Separated frontend/backend with proper API design
- Vector Search: Semantic understanding using Qdrant vector database
- Clean Code: Extensive documentation, type safety, and error handling
- Powered by Google Gemini 2.5 Flash
- Context-aware conversations about Dubai attractions, culture, and customs
- Markdown-formatted responses with rich information
- Message history and conversation context
- Cultural awareness and safety-first approach
- Rate Limited: 20 messages per user per hour
- Search by feelings/vibes (e.g., "romantic sunset spots", "family-friendly activities")
- Vector embeddings for semantic understanding
- Qdrant Vector Database with in-memory fallback
- Smart filtering (category, price range, halal, family-friendly)
- 500+ pre-loaded Dubai locations
- Rate Limited: 30 searches per user per hour
- 5-stage automated safety assessment
- Real-time location risk scoring (0-100)
- AI-generated contextual recommendations
- Time-of-day aware analysis
- Complete audit trail with workflow stages
- Emergency contact information
- Rate Limited: 10 safety checks per user per hour
- Clerk authentication with Google OAuth
- Email/password authentication
- Protected dashboard routes
- User profile management
- Session management and security
- Responsive Design: Beautiful UI that works on all devices
- Dark Mode Ready: Tailwind CSS with customizable themes
- Type Safety: Full TypeScript implementation
- Error Handling: Comprehensive error messages and fallbacks
- Auto Documentation: Interactive API docs at
/docs
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β (Next.js + TypeScript) β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Chat β β Search β β Safety β β Auth β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
βββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββ
β β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Backend API β
β (FastAPI + Python) β
β β
β βββββββββββββββββββββββ β
β β API Endpoints β β
β βββββββββββββββββββββββ€ β
β β /api/chat β β
β β /api/search β β
β β /api/safety β β
β βββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββ β
β β Business Logic β β
β β (Services) β β
β βββββββββββββββββββββββ β
ββββββββββββ¬ββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββββββ
β Gemini AI β β Qdrant Vector β
β 2.5 Flash β β Database β
ββββββββββββββββ ββββββββββββββββββββ
- User Request β Frontend (Next.js)
- API Call β Backend (FastAPI) at
http://localhost:8000 - Business Logic β Service Layer (Gemini/Qdrant)
- External APIs β Google Gemini AI / Qdrant Cloud
- Response β Backend β Frontend β User
- Framework: Next.js 16 (App Router)
- Language: TypeScript 5.x
- Styling: Tailwind CSS 3.4
- Authentication: Clerk
- UI Components: shadcn/ui
- Icons: Lucide React
- Deployment: Vercel
- Framework: FastAPI 0.115
- Language: Python 3.11+
- AI: Google Gemini 2.5 Flash (google-generativeai)
- Vector DB: Qdrant Cloud
- Authentication: Clerk (verification)
- Validation: Pydantic
- Rate Limiting: SlowAPI
- Server: Uvicorn (ASGI)
- Deployment: Railway / Render / Fly.io
- AI Model: Google Gemini 2.5 Flash
- Vector Search: Qdrant Cloud
- Authentication: Clerk
- Hosting: Vercel (Frontend) + Railway (Backend)
- Node.js 18+ (for frontend)
- Python 3.11+ (for backend)
- npm or yarn (package manager)
- Git (version control)
-
Google Gemini API Key
- Get from: https://aistudio.google.com/app/apikey
- Used for: AI chatbot and safety analysis
-
Qdrant Cloud (Optional - has fallback)
- Get from: https://cloud.qdrant.io
- Used for: Vector search
-
Clerk Authentication
- Get from: https://dashboard.clerk.com
- Used for: User authentication
git clone https://github.com/yourusername/dubai-navigator.git
cd dubai-navigatorcd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
copy .env.example .env
# Edit .env and add your API keys
# Run the server
python -m app.mainBackend will run on: http://localhost:8000 API Documentation: http://localhost:8000/docs
cd frontend
# Install dependencies
npm install
# Create .env.local file
copy .env.example .env.local
# Edit .env.local and add your Clerk keys
# Run development server
npm run devFrontend will run on: http://localhost:3000
Terminal 1 - Backend:
cd backend
venv\Scripts\activate # Windows
python -m app.mainTerminal 2 - Frontend:
cd frontend
npm run devNow visit: http://localhost:3000
The easiest way to run both frontend and backend together is using Docker Compose:
- Docker Desktop (includes Docker and Docker Compose)
- Download from: https://www.docker.com/products/docker-desktop
-
Make sure you have environment files ready:
backend/.envwith your API keysfrontend/.env.localwith Clerk keys
-
Build and start all services:
# Build and start in detached mode
docker-compose up -d --build
# Or run in foreground (see logs)
docker-compose up --build-
Access the application:
- Frontend: http://localhost:3000
- Backend: http://localhost:8000
- API Docs: http://localhost:8000/docs
-
View logs:
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f frontend
docker-compose logs -f backend- Stop services:
# Stop containers
docker-compose down
# Stop and remove volumes
docker-compose down -vBackend only:
cd backend
docker build -t dubai-navigator-backend .
docker run -p 8000:8000 --env-file .env dubai-navigator-backendFrontend only:
cd frontend
docker build -t dubai-navigator-frontend .
docker run -p 3000:3000 --env-file .env.local dubai-navigator-frontend- β No need to install Python or Node.js
- β Consistent environment across all machines
- β Easy deployment to cloud platforms
- β Isolated dependencies
Dubai-Navigator/
βββ frontend/ # Next.js Frontend
β βββ app/ # Next.js App Router
β β βββ (auth)/ # Authentication pages
β β βββ (dashboard)/ # Protected dashboard routes
β β βββ api/ # API route handlers (deprecated - use backend)
β β βββ layout.tsx # Root layout
β βββ components/ # React components
β β βββ chat/ # Chat interface
β β βββ search/ # Search components
β β βββ safety/ # Safety check UI
β β βββ ui/ # shadcn/ui components
β βββ lib/ # Utilities and helpers
β βββ .env.local # Frontend environment variables
β βββ .env.example # Environment template
β βββ package.json # Node dependencies
β βββ README.md # Frontend documentation
β
βββ backend/ # FastAPI Backend
β βββ app/
β β βββ main.py # FastAPI entry point
β β βββ config.py # Configuration
β β βββ api/ # API endpoints
β β β βββ chat.py # POST /api/chat
β β β βββ search.py # POST /api/search
β β β βββ safety.py # POST /api/safety
β β βββ services/ # Business logic
β β β βββ gemini_service.py
β β β βββ qdrant_service.py
β β βββ models/ # Data models
β β βββ schemas.py # Pydantic schemas
β βββ .env # Backend environment variables (gitignored)
β βββ .env.example # Environment template
β βββ requirements.txt # Python dependencies
β βββ test_api.py # API testing script
β βββ README.md # Backend documentation
β βββ QUICKSTART.md # Beginner setup guide
β βββ LEARNING_GUIDE.md # Code explanations
β
βββ .gitignore # Git ignore rules
βββ README.md # This file (Main documentation)
Visit http://localhost:8000/docs when the backend is running for interactive API documentation powered by Swagger UI.
POST /api/chat
Content-Type: application/json
{
"message": "What are the best places to visit in Dubai?",
"user_id": "user_123",
"history": [] // Optional conversation history
}Response:
{
"success": true,
"response": "Dubai has many amazing attractions...",
"error": null
}POST /api/search
Content-Type: application/json
{
"query": "romantic sunset spots",
"limit": 10,
"user_id": "user_123",
"filters": {
"category": "dining",
"price_range": "medium"
}
}Response:
{
"success": true,
"results": [...],
"count": 10,
"error": null
}POST /api/safety
Content-Type: application/json
{
"location_name": "Dubai Marina",
"coordinates": {"lat": 25.08, "lng": 55.14},
"time_of_day": "evening",
"user_id": "user_123"
}Response:
{
"success": true,
"risk_level": "low",
"risk_score": 15,
"analysis": "Dubai Marina is very safe...",
"recommendations": [...]
}Choose one of these platforms for the FastAPI backend:
# Install Railway CLI
npm i -g @railway/cli
# Navigate to backend
cd backend
# Login and deploy
railway login
railway init
railway up- Connect GitHub repository
- Select
backendfolder as root directory - Build command:
pip install -r requirements.txt - Start command:
python -m app.main - Add environment variables
# Install Fly CLI
cd backend
fly launch
fly deployRequired Backend Environment Variables:
GEMINI_API_KEY- Your Google Gemini API keyCLERK_SECRET_KEY- Your Clerk secret keyQDRANT_URL(optional) - Qdrant cluster URLQDRANT_API_KEY(optional) - Qdrant API keyCORS_ORIGINS- Update with your frontend URL
- Push to GitHub
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main-
Deploy on Vercel
- Visit Vercel
- Click "Import Project"
- Select your GitHub repository
- Set Root Directory to
frontend - Add environment variables:
NEXT_PUBLIC_API_URL- Your deployed backend URL (e.g.,https://your-backend.railway.app)NEXT_PUBLIC_APP_URL- Your Vercel URLNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Clerk publishable keyCLERK_SECRET_KEY- Clerk secret keyNEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-inNEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-upNEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboardNEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
- Click "Deploy"
-
Update Backend CORS
After deploying frontend, update your backend's CORS_ORIGINS environment variable to include your Vercel domain:
CORS_ORIGINS=http://localhost:3000,https://your-app.vercel.app
- Update Clerk Settings
In your Clerk dashboard, add both URLs to:
- Allowed Origins
- Redirect URLs
Done! Your full-stack app is now live!
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini Team - For the powerful Gemini 2.5 Flash AI model
- Qdrant - For the excellent vector database
- Clerk - For seamless authentication
- Vercel - For the amazing Next.js hosting
Built by: Aritra Hackathon: LabLab.ai Technologies: Google Gemini 2.5 Flash, Qdrant, Clerk, Next.js 16, FastAPI, Vercel
Project Link: https://github.com/Rain-09x16/Dubify
New to the technologies used in this project?
- Frontend Documentation: frontend/README.md
- Backend Documentation: backend/README.md
Built with β€οΈ
β Star this repo if you find it helpful!