Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 TravelMate - Travel Booking Platform

A full-stack travel booking platform featuring flights, hotels, treks, and international trips with an AI-powered chatbot and interactive 3D globe visualization.

✨ Features

  • 🎫 Multi-Service Booking: Flights, hotels, buses, trains, treks, and international packages
  • πŸ€– AI Chatbot: Gemini AI-powered support assistant
  • 🌐 Interactive Globe: 3D visualization of destinations using Globe.gl
  • πŸ” User Authentication: JWT-based login/signup with MongoDB
  • πŸ“± PWA Support: Install as a mobile app
  • 🎨 Modern UI: Dark theme with smooth animations
  • πŸ’³ Booking Management: Track and manage bookings
  • ⭐ Reviews & Ratings: Customer feedback system

πŸ› οΈ Tech Stack

Frontend

  • HTML5, CSS3, JavaScript (ES6+)
  • Globe.gl (3D visualization)
  • PWA (Progressive Web App)
  • Responsive design

Backend

  • Python 3.x
  • Flask (Web framework)
  • MongoDB (Database)
  • MongoEngine (ODM)
  • Google Gemini AI (Chatbot)
  • JWT (Authentication)

πŸ“‹ Prerequisites

  • Python 3.8+
  • MongoDB 4.4+
  • Google Gemini API Key
  • Modern web browser

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/arkham-knight07/tour-travel.git
cd tour-travel

2. Backend Setup

cd backend

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create .env file
cat > .env << EOF
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/travelmate

# JWT Configuration
JWT_SECRET=your-secret-key-change-this-in-production

# Google Gemini API
GEMINI_API_KEY=your-gemini-api-key-here

# Flask Configuration
FLASK_ENV=development
DEBUG=True
EOF

# Start MongoDB (macOS)
brew services start mongodb-community

# Run the backend server
python app.py

The backend will start at http://127.0.0.1:5002

3. Frontend Setup

# Open a new terminal
cd frontend

# Serve the frontend (using Python's HTTP server)
python3 -m http.server 8000

The frontend will be available at http://localhost:8000

πŸ“ Project Structure

tour-travel/
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html              # Homepage
β”‚   β”œβ”€β”€ manifest.json            # PWA manifest
β”‚   β”œβ”€β”€ service-worker.js        # Service worker for PWA
β”‚   β”œβ”€β”€ pages/                   # HTML pages
β”‚   β”‚   β”œβ”€β”€ booking.html
β”‚   β”‚   β”œβ”€β”€ login.html
β”‚   β”‚   β”œβ”€β”€ globe.html
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ scripts/                 # JavaScript modules
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”œβ”€β”€ chatbot.js
β”‚   β”‚   β”œβ”€β”€ globe.js
β”‚   β”‚   └── main.js
β”‚   β”œβ”€β”€ styles/                  # CSS files
β”‚   β”œβ”€β”€ assets/                  # Images, videos, icons
β”‚   └── data/                    # Static JSON data
β”‚
└── backend/
    β”œβ”€β”€ app.py                   # Flask application entry point
    β”œβ”€β”€ requirements.txt         # Python dependencies
    β”œβ”€β”€ api/                     # API route blueprints
    β”‚   β”œβ”€β”€ auth_routes.py       # Authentication endpoints
    β”‚   β”œβ”€β”€ places_routes.py     # Places/destinations CRUD
    β”‚   β”œβ”€β”€ booking_routes.py    # Booking management
    β”‚   β”œβ”€β”€ chatbot_routes.py    # AI chatbot
    β”‚   └── tours_routes.py      # Tour packages
    β”œβ”€β”€ models/                  # MongoDB models
    β”‚   β”œβ”€β”€ user.py
    β”‚   β”œβ”€β”€ place.py
    β”‚   └── booking.py
    β”œβ”€β”€ services/                # Business logic
    β”‚   β”œβ”€β”€ chatbot_service.py
    β”‚   β”œβ”€β”€ booking_service.py
    β”‚   └── tour_service.py
    β”œβ”€β”€ config/                  # Configuration
    β”‚   └── database.py
    └── utils/                   # Helper functions

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user profile
  • POST /api/auth/logout - Logout user
  • PUT /api/auth/update - Update user profile

Places

  • GET /api/places - Get all places (with filters)
  • GET /api/places/<id> - Get specific place
  • GET /api/places/search?q=<query> - Search places
  • POST /api/places - Create new place
  • PUT /api/places/<id> - Update place
  • DELETE /api/places/<id> - Delete place

Bookings

  • GET /api/bookings - Get all bookings
  • POST /api/bookings - Create new booking

Chatbot

  • POST /chat - Send message to AI chatbot
  • GET /chat/faq - Get FAQ data

Tours

  • GET /api/tours - Get tour packages

πŸ”‘ Environment Variables

Create a .env file in the backend/ directory:

# Database
MONGODB_URI=mongodb://localhost:27017/travelmate

# JWT Authentication
JWT_SECRET=your-super-secret-jwt-key-change-this

# Google Gemini AI
GEMINI_API_KEY=your-gemini-api-key

# Flask
FLASK_ENV=development
DEBUG=True

🌐 Deployment

Deploy to Vercel (Frontend)

  1. Install Vercel CLI:
npm i -g vercel
  1. Deploy frontend:
cd frontend
vercel

Deploy Backend (Options)

Option 1: Railway/Render

  • Push code to GitHub
  • Connect repository to Railway/Render
  • Add environment variables
  • Deploy

Option 2: Heroku

cd backend
heroku create your-app-name
git push heroku main

Important: Update API URLs in frontend after deploying backend!

πŸ“ Configuration for Production

  1. Update API URLs in frontend/scripts/api.js:

    const API_BASE = "https://your-backend-url.com";
  2. Set MongoDB Atlas URL in backend .env:

    MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/travelmate
  3. Enable HTTPS cookies in backend/api/auth_routes.py:

    secure=True  # Change from False
  4. Update CORS in backend/app.py for your domain

πŸ§ͺ Testing

Run Backend Tests

cd backend
pytest

Test API Endpoints

# Health check
curl http://127.0.0.1:5002/health

# Get places
curl http://127.0.0.1:5002/api/places

πŸ› Troubleshooting

MongoDB Connection Error

# Start MongoDB
brew services start mongodb-community  # macOS
sudo systemctl start mongod            # Linux

Port Already in Use

# Kill process on port 5002
lsof -ti:5002 | xargs kill -9

# Or use a different port in app.py

Screenshots

  1. Main Page Screenshot 2025-10-29 at 12 30 37β€―PM

2.Destination Page Screenshot 2025-09-08 at 11 14 44β€―AM

3.Deal Page Screenshot 2025-10-29 at 12 30 50β€―PM

4.Globe Page Screenshot 2025-11-09 at 10 24 00β€―AM

CORS Issues

  • Check backend CORS configuration
  • Ensure frontend is making requests to correct backend URL

πŸ“„ License

MIT License - feel free to use this project for learning or commercial purposes.

πŸ‘¨β€πŸ’» Author

Created with ❀️ by arkham-knight07 ,rayak25 ,Nav2428

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first.

πŸ“ž Support

For support, email verdhanchiku@gmail.com or open an issue.


Happy Traveling! ✈️🌍

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages