{"id":30621921,"url":"https://github.com/rahulsamant37/ai_planner","last_synced_at":"2026-04-08T16:02:24.261Z","repository":{"id":305413921,"uuid":"1022812692","full_name":"rahulsamant37/AI_Planner","owner":"rahulsamant37","description":"A production-ready, cloud-native AI Travel Planner built with modern microservices architecture, featuring comprehensive observability, security, and scalability.","archived":false,"fork":false,"pushed_at":"2025-07-19T22:57:50.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T15:04:28.087Z","etag":null,"topics":["docker","elasticsearch","fastapi","groq","kubernetes","langchain-python","prometheus","redis-cache","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahulsamant37.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-19T22:12:55.000Z","updated_at":"2025-07-19T22:59:58.000Z","dependencies_parsed_at":"2025-07-20T01:10:02.761Z","dependency_job_id":null,"html_url":"https://github.com/rahulsamant37/AI_Planner","commit_stats":null,"previous_names":["rahulsamant37/ai_planner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahulsamant37/AI_Planner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FAI_Planner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FAI_Planner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FAI_Planner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FAI_Planner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahulsamant37","download_url":"https://codeload.github.com/rahulsamant37/AI_Planner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulsamant37%2FAI_Planner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","elasticsearch","fastapi","groq","kubernetes","langchain-python","prometheus","redis-cache","streamlit"],"created_at":"2025-08-30T15:01:58.978Z","updated_at":"2026-04-08T16:02:24.243Z","avatar_url":"https://github.com/rahulsamant37.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 AI Travel Planner - Modern Microservices Architecture\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/release/python-312/)\n[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat\u0026logo=fastapi)](https://fastapi.tiangolo.com/)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![Kubernetes](https://img.shields.io/badge/Kubernetes-326ce5.svg?style=flat\u0026logo=kubernetes\u0026logoColor=white)](https://kubernetes.io/)\n[![Redis](https://img.shields.io/badge/Redis-DC382D?style=flat\u0026logo=redis\u0026logoColor=white)](https://redis.io/)\n\n\u003e A production-ready, cloud-native AI Travel Planner built with modern microservices architecture, featuring comprehensive observability, security, and scalability.\n\n## 📋 Table of Contents\n\n- [Overview](#-overview)\n- [Architecture](#-architecture)\n- [Features](#-features)\n- [Quick Start](#-quick-start)\n- [Services](#-services)\n- [Development](#-development)\n- [Deployment](#-deployment)\n- [Testing](#-testing)\n- [Monitoring](#-monitoring)\n- [API Documentation](#-api-documentation)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n## 🌟 Overview\n\nThe AI Travel Planner is a sophisticated microservices-based application that leverages artificial intelligence to create personalized travel itineraries. Built with modern cloud-native technologies, it provides a scalable, reliable, and secure platform for travel planning.\n\n### Key Highlights\n\n- **🤖 AI-Powered**: Uses LangChain and Groq for intelligent itinerary generation\n- **🏗️ Microservices**: 7 specialized services for maximum scalability\n- **☁️ Cloud-Native**: Kubernetes-ready with comprehensive deployment manifests\n- **📊 Observable**: Full monitoring stack with ELK, Prometheus, and Grafana\n- **🔒 Secure**: JWT authentication, rate limiting, and security best practices\n- **⚡ High-Performance**: Redis caching and optimized async processing\n\n## 🏗️ Architecture\n\n```mermaid\ngraph TB\n    Client[Client] --\u003e Gateway[API Gateway\u003cbr/\u003enginx:80]\n    \n    Gateway --\u003e Frontend[Frontend Service\u003cbr/\u003estreamlit:8501]\n    Gateway --\u003e Planner[Planner Service\u003cbr/\u003efastapi:8000]\n    Gateway --\u003e Auth[Auth Service\u003cbr/\u003efastapi:8003]\n    Gateway --\u003e Monitor[Monitoring\u003cbr/\u003efastapi:8002]\n    \n    Planner --\u003e Redis[(Redis\u003cbr/\u003eCache)]\n    Planner --\u003e Config[Config Service\u003cbr/\u003efastapi:8004]\n    \n    Auth --\u003e Redis\n    Monitor --\u003e Redis\n    Monitor --\u003e Elastic[(Elasticsearch\u003cbr/\u003eLogs)]\n    \n    Notification[Notification Service\u003cbr/\u003efastapi:8005] --\u003e Redis\n    \n    Elastic --\u003e Kibana[Kibana\u003cbr/\u003eDashboard:5601]\n    Monitor --\u003e Prometheus[(Prometheus\u003cbr/\u003eMetrics:9090)]\n    Prometheus --\u003e Grafana[Grafana\u003cbr/\u003eDashboard:3000]\n    \n    subgraph \"Infrastructure\"\n        Redis\n        Elastic\n        Prometheus\n    end\n    \n    subgraph \"Core Services\"\n        Planner\n        Frontend\n        Auth\n    end\n    \n    subgraph \"Supporting Services\"\n        Config\n        Monitor\n        Notification\n    end\n```\n\n### Service Architecture\n\n| Service | Technology | Port | Purpose |\n|---------|-----------|------|---------|\n| **API Gateway** | Nginx | 80 | Load balancing, rate limiting, SSL termination |\n| **Planner Service** | FastAPI | 8000 | Core travel itinerary generation |\n| **Frontend Service** | Streamlit | 8501 | User interface and interaction |\n| **Auth Service** | FastAPI | 8003 | JWT authentication and authorization |\n| **Config Service** | FastAPI | 8004 | Centralized configuration management |\n| **Monitoring Service** | FastAPI | 8002 | Health checks and system metrics |\n| **Notification Service** | FastAPI | 8005 | Multi-channel notifications |\n\n## ✨ Features\n\n### 🔐 Security \u0026 Authentication\n- **JWT-based authentication** with session management\n- **Rate limiting** and DDoS protection\n- **CORS policies** and security headers\n- **Network policies** in Kubernetes\n- **Secrets management** with encrypted storage\n\n### 📊 Observability \u0026 Monitoring\n- **Structured JSON logging** with ELK stack\n- **Metrics collection** with Prometheus\n- **Real-time dashboards** with Grafana\n- **Distributed tracing** capabilities\n- **Health checks** and service monitoring\n\n### ⚡ Performance \u0026 Reliability\n- **Redis caching** with configurable TTL\n- **Circuit breaker** pattern implementation\n- **Horizontal pod autoscaling** (HPA)\n- **Load balancing** with automatic failover\n- **Graceful degradation** and error handling\n\n### 🔧 DevOps \u0026 Deployment\n- **Docker containerization** with multi-stage builds\n- **Kubernetes-native** deployment\n- **CI/CD pipeline** with GitHub Actions\n- **Infrastructure as Code** (IaC)\n- **Multi-environment** support\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **Docker** and Docker Compose\n- **Python 3.12+** (for local development)\n- **Kubernetes cluster** (optional, for production)\n- **GROQ API Key** (for AI functionality)\n\n### 1. Clone and Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/rahulsamant37/ai_planner.git\ncd ai_planner\n\n# Create environment configuration\ncp .env.example .env\n# Edit .env with your API keys\n```\n\n### 2. Start with Docker Compose (Recommended)\n\n```bash\n# Start all services\nmake dev\n# OR\ndocker-compose up -d\n\n# View logs\nmake dev-logs\n# OR\ndocker-compose logs -f\n```\n\n### 3. Access Services\n\n| Service | URL | Description |\n|---------|-----|-------------|\n| **Frontend** | http://localhost:8501 | Main user interface |\n| **API Gateway** | http://localhost:80 | API endpoints |\n| **Grafana** | http://localhost:3000 | Metrics dashboard (admin/admin123) |\n| **Kibana** | http://localhost:5601 | Log analysis |\n| **Prometheus** | http://localhost:9090 | Metrics collection |\n\n### 4. Environment Variables\n\n```bash\n# Core Configuration\nGROQ_API_KEY=your_groq_api_key_here\nJWT_SECRET_KEY=your_jwt_secret_key\nENVIRONMENT=development\n\n# Optional Email Configuration\nSMTP_HOST=smtp.gmail.com\nSMTP_PORT=587\nSMTP_USERNAME=your_email@gmail.com\nSMTP_PASSWORD=your_app_password\n```\n\n## 🛠️ Services\n\n### Core Services\n\n#### 🧠 Planner Service (`localhost:8000`)\nThe heart of the application, responsible for AI-powered travel itinerary generation.\n\n**Key Features:**\n- LangChain integration for AI processing\n- Redis caching for performance optimization\n- RESTful API with comprehensive error handling\n- Support for multiple destinations and preferences\n\n**API Endpoints:**\n```bash\nGET  /health                 # Health check\nPOST /generate-itinerary     # Generate travel plan\nGET  /cache/stats           # Cache statistics\nDELETE /cache/clear         # Clear cache\n```\n\n#### 🖥️ Frontend Service (`localhost:8501`)\nInteractive Streamlit web application for user interaction.\n\n**Key Features:**\n- Intuitive travel planning interface\n- Real-time service health monitoring\n- Cache management capabilities\n- Responsive design\n\n#### 🔐 Authentication Service (`localhost:8003`)\nJWT-based authentication and user management.\n\n**Key Features:**\n- User registration and login\n- JWT token management\n- Session handling\n- Role-based access control\n\n**API Endpoints:**\n```bash\nPOST /auth/login           # User authentication\nPOST /auth/logout          # User logout\nGET  /auth/me             # Current user info\nPOST /auth/verify         # Token verification\n```\n\n### Supporting Services\n\n#### ⚙️ Configuration Service (`localhost:8004`)\nCentralized configuration management with feature flags.\n\n#### 📊 Monitoring Service (`localhost:8002`)\nSystem health monitoring and metrics collection.\n\n#### 📧 Notification Service (`localhost:8005`)\nMulti-channel notification delivery (email, SMS, webhooks).\n\n## 💻 Development\n\n### Local Development Setup\n\n```bash\n# Install development dependencies\nmake install\n\n# Install all service dependencies\nmake install-services\n\n# Start development environment\nmake dev\n\n# Run tests\nmake test\n\n# Code formatting\nmake format\n\n# Linting\nmake lint\n```\n\n### Development Commands\n\n```bash\n# Quick start for new developers\nmake quick-start\n\n# Run comprehensive test pipeline\nmake quick-test\n\n# View service logs\nmake logs\nmake logs-planner      # Specific service logs\n\n# Debug services\nmake debug-planner     # Debug planner service\nmake redis-cli         # Connect to Redis\n\n# Monitor services\nmake monitor-health    # Check all service health\nmake monitor-metrics   # View system metrics\n```\n\n### Project Structure\n\n```\nai_planner/\n├── src/                          # Core business logic\n│   ├── core/                     # Travel planning algorithms\n│   ├── config/                   # Configuration management\n│   ├── chains/                   # LangChain integrations\n│   └── utils/                    # Utility functions\n├── services/                     # Microservices\n│   ├── api-gateway/              # Nginx gateway\n│   ├── planner-service/          # Core planning service\n│   ├── frontend-service/         # Streamlit UI\n│   ├── auth-service/             # Authentication\n│   ├── config-service/           # Configuration\n│   ├── monitoring-service/       # Health monitoring\n│   ├── notification-service/     # Notifications\n│   └── shared/                   # Shared utilities\n├── k8s/                          # Kubernetes manifests\n├── monitoring/                   # Monitoring configs\n├── tests/                        # Test suite\n├── docker-compose.yml            # Local development\n├── Makefile                      # Development automation\n└── requirements.txt              # Dependencies\n```\n\n## 🚢 Deployment\n\n### Docker Compose (Development/Testing)\n\n```bash\n# Start all services\nmake dev\n\n# Stop services\nmake dev-stop\n\n# Rebuild services\nmake dev-rebuild\n\n# Production build\nmake build-prod\n```\n\n### Kubernetes (Production)\n\n```bash\n# Create namespace\nmake k8s-create-namespace\n\n# Deploy to Kubernetes\nmake k8s-deploy\n\n# Check deployment status\nmake k8s-status\n\n# View service logs\nmake k8s-logs SERVICE=planner-service\n\n# Port forward to access services\nmake k8s-port-forward\n```\n\n### Production Deployment\n\n```bash\n# Complete production deployment\nmake prod-deploy\n\n# Rollback if needed\nmake prod-rollback\n```\n\n### Scaling\n\n```bash\n# Scale specific service\nkubectl scale deployment planner-service --replicas=3 -n ai-planner\n\n# Auto-scaling is configured via HPA\nkubectl get hpa -n ai-planner\n```\n\n## 🧪 Testing\n\n### Running Tests\n\n```bash\n# All tests with coverage\nmake test\n\n# Unit tests only\nmake test-unit\n\n# Integration tests\nmake test-integration\n\n# Watch mode (auto-rerun on changes)\nmake test-watch\n```\n\n### Test Structure\n\n```\ntests/\n├── conftest.py              # Test configuration\n├── test_core.py             # Core business logic tests\n└── test_planner_service.py  # API integration tests\n```\n\n### Coverage Report\n\n```bash\n# Generate HTML coverage report\npytest --cov=src --cov-report=html\n# View at: htmlcov/index.html\n```\n\n## 📊 Monitoring\n\n### Health Checks\n\nAll services provide comprehensive health endpoints:\n\n```bash\n# Check all service health\nmake monitor-health\n\n# Individual service health\ncurl http://localhost:8000/health  # Planner\ncurl http://localhost:8002/system/health  # System overview\n```\n\n### Metrics and Dashboards\n\n- **Grafana**: http://localhost:3000 (admin/admin123)\n  - System Overview Dashboard\n  - Service Metrics Dashboard\n  - Custom Business Metrics\n\n- **Prometheus**: http://localhost:9090\n  - Raw metrics collection\n  - Query interface\n  - Alert configuration\n\n- **Kibana**: http://localhost:5601\n  - Log analysis and visualization\n  - Custom dashboards\n  - Error tracking\n\n### Key Metrics\n\n- Request/response times\n- Cache hit/miss ratios\n- Service availability\n- Resource utilization\n- Custom business metrics\n\n## 📖 API Documentation\n\n### Interactive API Docs\n\n- **Planner Service**: http://localhost:8000/docs\n- **Auth Service**: http://localhost:8003/docs\n- **Monitoring Service**: http://localhost:8002/docs\n\n### Sample API Calls\n\n#### Generate Travel Itinerary\n\n```bash\ncurl -X POST \"http://localhost:8000/generate-itinerary\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"city\": \"Paris\",\n    \"interests\": \"museums, cafes, architecture\"\n  }'\n```\n\n#### User Authentication\n\n```bash\ncurl -X POST \"http://localhost:8003/auth/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"username\": \"user@example.com\",\n    \"password\": \"password123\"\n  }'\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Workflow\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Make** your changes\n4. **Run** tests (`make test`)\n5. **Format** code (`make format`)\n6. **Commit** your changes (`git commit -m 'Add amazing feature'`)\n7. **Push** to the branch (`git push origin feature/amazing-feature`)\n8. **Open** a Pull Request\n\n### Code Standards\n\n- Follow **PEP 8** for Python code\n- Use **type hints** where applicable\n- Write **comprehensive tests**\n- Update **documentation**\n- Follow **semantic versioning**\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n**Services not starting:**\n```bash\n# Check Docker daemon\ndocker info\n\n# Rebuild services\nmake dev-rebuild\n```\n\n**Redis connection issues:**\n```bash\n# Check Redis status\nmake redis-cli\n\u003e ping\n```\n\n**Port conflicts:**\n```bash\n# Check what's using ports\nnetstat -tulpn | grep :8000\n```\n\n### Support\n\n- 📚 [Full Documentation](FULL%20DOCUMENTATION.md)\n- 🏗️ [Architecture Guide](ARCHITECTURE.md)\n- 🐛 [Issue Tracker](https://github.com/rahulsamant37/ai_planner/issues)\n- 💬 [Discussions](https://github.com/rahulsamant37/ai_planner/discussions)\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **LangChain** for AI orchestration framework\n- **FastAPI** for high-performance API development\n- **Streamlit** for rapid UI development\n- **Groq** for fast language model inference\n- **Redis** for caching and session management\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\u003cstrong\u003eBuilt with ❤️ by the Rahul Samant\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003e⭐ Star this repo if you find it helpful!\u003c/p\u003e\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulsamant37%2Fai_planner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulsamant37%2Fai_planner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulsamant37%2Fai_planner/lists"}