help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
travel-assistant-bot
RSK World
travel-assistant-bot
Travel Assistant Bot - Python + Flask + OpenAI API + Travel Bot + Flight Search + Hotel Booking + Weather
travel-assistant-bot
  • .venv
  • __pycache__
  • services
  • static
  • templates
  • .gitignore515 B
  • LICENSE.md1.2 KB
  • README.md730 B
  • RELEASE_NOTES.md7.1 KB
  • analytics.py1.4 KB
  • app.log0 B
  • app.py8.2 KB
  • auth.py4.9 KB
  • db.py3.3 KB
  • requirements.txt214 B
  • run.ps1529 B
  • travel.db24 KB
admin.htmlRELEASE_NOTES.md
templates/admin.html
Raw Download
Find: Go to:
<!-- RSK World - Free Programming Resources & Source Code -->
<!-- Founder: Molla Samser | Designer & Tester: Rima Khatun -->
<!-- Website: https://rskworld.in/contact.php | Year: 2026 -->
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin - Travel Assistant Bot</title>
    <link rel="stylesheet" href="/static/css/style.css">
  </head>
  <body>
    <header>
      <h1>Admin Dashboard</h1>
      <p>Manage itineraries and monitor status.</p>
    </header>
    <main>
      <section class="tools">
        <div class="tool">
          <h3>Itineraries</h3>
          <div class="auth">
            <input id="admin-token" type="text" placeholder="Bearer token">
            <button id="admin-load">Load</button>
          </div>
          <ul id="admin-itineraries"></ul>
        </div>
      </section>
    </main>
    <script>
      async function loadItineraries() {
        const token = document.getElementById("admin-token").value.trim();
        const r = await fetch("/api/itineraries", {
          headers: token ? { Authorization: `Bearer ${token}` } : {},
        });
        const res = await r.json();
        const ul = document.getElementById("admin-itineraries");
        ul.innerHTML = "";
        (res.itineraries || []).forEach((i) => {
          const li = document.createElement("li");
          li.textContent = `#${i.id} ${i.user} ${i.created_at}`;
          const btn = document.createElement("button");
          btn.textContent = "Delete";
          btn.onclick = async () => {
            const r2 = await fetch(`/api/itineraries/${i.id}`, {
              method: "DELETE",
              headers: { Authorization: `Bearer ${token}` },
            });
            const j2 = await r2.json();
            if (j2.deleted) loadItineraries();
          };
          li.appendChild(btn);
          ul.appendChild(li);
        });
      }
      document.getElementById("admin-load").addEventListener("click", loadItineraries);
    </script>
  </body>
  </html>

60 linesâ€Ē2 KB
markup
RELEASE_NOTES.md
Raw Download

RELEASE_NOTES.md

# Release Notes - Travel Assistant Bot v1.0.0

## 🎉 Initial Release - Version 1.0.0

**Release Date:** 2026-01-XX
**Tag:** v1.0.0

---

## 📋 Overview

Travel Assistant Bot is a comprehensive web application built with Flask that helps users plan their travel itineraries, search for flights and hotels, get weather information, and receive AI-powered travel recommendations.

---

## âœĻ Features

### Core Functionality
- **AI-Powered Chat Assistant** - Interactive chatbot using OpenAI API for travel assistance
- **Flight Search** - Search and compare flights between destinations
- **Hotel Search** - Find hotels in your destination city
- **Weather Information** - Get real-time weather data for any location (requires OpenWeather API key)
- **Travel Recommendations** - Get personalized recommendations based on preferences
- **Itinerary Management** - Create, save, and manage travel itineraries
- **Budget Calculator** - Calculate total trip costs
- **Share Itineraries** - Share travel plans via secure links

### User Features
- **User Authentication** - Register and login with JWT-based authentication
- **Multi-language Support** - English and Bengali (āĶŽāĶūāĶ‚āĶēāĶū) language support
- **Dark Mode** - Toggle between light and dark themes
- **Responsive Design** - Works on desktop and mobile devices

### Admin Features
- **Admin Dashboard** - Monitor and manage itineraries
- **Analytics** - Track usage metrics and events

---

## 🔧 Technical Details

### Technology Stack
- **Backend:** Python 3.x, Flask 3.0.0
- **Database:** SQLite3
- **AI Integration:** OpenAI API (optional)
- **Weather API:** OpenWeatherMap (optional)
- **Frontend:** HTML5, CSS3, JavaScript (ES6+)
- **Authentication:** JWT (JSON Web Tokens)

### Project Structure
```
travel-assistant-bot/
├── app.py # Main Flask application
├── auth.py # Authentication and authorization
├── db.py # Database operations
├── analytics.py # Analytics and event tracking
├── requirements.txt # Python dependencies
├── run.ps1 # PowerShell startup script
├── services/ # Service modules
│ ├── openai_service.py # OpenAI integration
│ ├── flight_service.py # Flight search service
│ ├── hotel_service.py # Hotel search service
│ ├── weather_service.py # Weather service
│ ├── recommendation_service.py # Recommendations
│ └── cache.py # Caching service
├── static/ # Static assets
│ ├── css/
│ │ └── style.css # Stylesheets
│ └── js/
│ └── app.js # JavaScript application
└── templates/ # HTML templates
├── index.html # Main page
├── admin.html # Admin dashboard
├── share.html # Shared itinerary view
├── readme.html # README page
└── license.html # License page
```

---

## 🐛 Fixes in This Release

### Critical Fixes
- ✅ **Flask 3.0 Compatibility** - Fixed deprecated `@app.before_first_request` decorator
- Replaced with module-level initialization for Flask 3.0.0 compatibility
- Ensures proper database and logging setup

### Code Improvements
- ✅ **Performance Optimization** - Optimized itinerary listing to avoid redundant database calls
- ✅ **Code Quality** - All files pass syntax checks and imports successfully
- ✅ **Error Handling** - Improved error handling throughout the application

---

## ðŸ“Ķ Installation

### Prerequisites
- Python 3.8 or higher
- pip (Python package manager)

### Setup Steps

1. **Clone the repository:**
```bash
git clone https://github.com/rskworld/travel-assistant-bot.git
cd travel-assistant-bot
```

2. **Install dependencies:**
```bash
pip install -r requirements.txt
```

3. **Set environment variables (optional):**
```bash
# Windows PowerShell
$env:OPENAI_API_KEY="your-openai-api-key"
$env:OPENWEATHER_API_KEY="your-openweather-api-key"
$env:JWT_SECRET="your-secret-key"
$env:PORT="5000"
```

4. **Run the application:**
```bash
# Windows PowerShell
.\run.ps1

# Or directly with Python
python app.py
```

5. **Access the application:**
- Open your browser and navigate to `http://localhost:5000`

---

## 🔑 Configuration

### Required Environment Variables
None (application works with default values)

### Optional Environment Variables
- `OPENAI_API_KEY` - OpenAI API key for AI chat functionality
- `OPENWEATHER_API_KEY` - OpenWeatherMap API key for weather data
- `JWT_SECRET` - Secret key for JWT token generation (default: "dev-secret-change")
- `PORT` - Port number for the Flask app (default: 5000)
- `RATE_LIMIT_PER_MIN` - API rate limit per minute (default: 120)

---

## 📝 API Endpoints

### Public Endpoints
- `GET /` - Main application page
- `GET /admin` - Admin dashboard
- `GET /readme` - README page
- `GET /license` - License page
- `GET /share/<token>` - View shared itinerary

### API Endpoints
- `POST /api/chat` - Chat with AI assistant
- `POST /api/flights` - Search flights
- `POST /api/hotels` - Search hotels
- `POST /api/weather` - Get weather information
- `POST /api/recommendations` - Get travel recommendations
- `POST /api/budget` - Calculate trip budget

### Authenticated Endpoints
- `POST /api/auth/register` - Register new user
- `POST /api/auth/login` - Login user
- `GET /api/itineraries` - List itineraries
- `POST /api/itineraries` - Create itinerary
- `DELETE /api/itineraries/<id>` - Delete itinerary
- `POST /api/itineraries/<id>/share` - Generate share link

### Admin Endpoints
- `GET /api/metrics` - Get analytics metrics (requires admin role)

---

## 🔒 Security Features

- JWT-based authentication
- Password hashing with SHA-256 and salt
- SQL injection prevention with parameterized queries
- Rate limiting protection
- CORS headers configuration
- Admin role-based access control

---

## 🌐 Browser Support

- Chrome (latest)
- Firefox (latest)
- Edge (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)

---

## 📄 License

See [LICENSE.md](LICENSE.md) for license information.

---

## ðŸ‘Ĩ Credits

**Founder:** Molla Samser
**Designer & Tester:** Rima Khatun
**Website:** https://rskworld.in/contact.php
**Year:** 2026

---

## ðŸĪ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---

## 📞 Support

For issues, questions, or support, please visit: https://rskworld.in/contact.php

---

## 🚀 Future Roadmap

- [ ] Integration with real flight booking APIs
- [ ] Integration with real hotel booking APIs
- [ ] Payment gateway integration
- [ ] Email notifications
- [ ] Mobile app version
- [ ] Additional language support
- [ ] Advanced analytics dashboard

---

**Thank you for using Travel Assistant Bot! 🎉**
🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work âĪïļ

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer