A visual geopolitical tension monitoring system for European travel planning Empowering travelers with AI-assisted safety insights through interactive map visualization
EuropeSafe is an innovative hobby project that transforms complex geopolitical data into intuitive, color-coded visual intelligence for travelers. Whether you're planning a European adventure or monitoring regional stability, this interactive platform provides instant clarity on safety conditions across the continent.
- πΊοΈ Interactive Map Visualization - Explore Europe with dynamic, color-coded country overlays
- π€ AI Travel Assistant - Chat with an intelligent advisor for personalized travel recommendations
- π Real-time Safety Scores - Instantly view tension levels from 0-100 for every European nation
- π¨ Beautiful UI/UX - Modern glassmorphism design with smooth animations
- π± Responsive Design - Seamless experience across desktop, tablet, and mobile devices
- π Privacy-First - No tracking, no cookies, no data collection
Experience EuropeSafe in action: Launch Application
Navigate through an elegant interface where complex geopolitical situations become instantly comprehensible:
- Color-Coded Safety Levels: From serene greens (peaceful) to critical reds (high risk)
- Interactive Tooltips: Hover over any country for instant safety scores
- Detailed Popups: Click for comprehensive risk assessments and travel advisories
- AI Chat Integration: Ask questions like "Where's the safest place to visit this summer?"
Whether you're a:
- π§³ Traveler planning your next European adventure
- π° Journalist monitoring regional developments
- π Student researching geopolitical patterns
- πΌ Professional assessing business travel safety
EuropeSafe provides the visual intelligence you need.
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Vanilla JavaScript | Lightweight, fast performance |
| Mapping | Leaflet.js | Interactive map rendering |
| Data | GeoJSON + Synthetic JSON | Country boundaries & safety scores |
| Styling | Pure CSS3 | Glassmorphism, gradients, animations |
| AI Chat | Modular Architecture | Ready for API integration |
EUROPESAFE/
β
βββ index.html # Main application (single-page app)
βββ data/
β βββ europe-tension.json # Synthetic safety scores & metadata
β
βββ README.md # This file
βββ DEPLOYMENT.md # Hosting & deployment guide
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Local web server (Python, Node.js, or similar)
1οΈβ£ Clone the Repository
git clone https://github.com/yourusername/europesafe.git
cd europesafe2οΈβ£ Start Local Server
Choose your preferred method:
Option A: Python
python -m http.server 8000
# or
python3 -m http.server 8000Option B: Node.js
npx http-server -p 8000 --corsOption C: PHP
php -S localhost:80003οΈβ£ Open Browser
Navigate to: http://localhost:8000
| Score Range | Risk Level | Color | Description |
|---|---|---|---|
| 0-15 | Very Low | π’ Dark Green | Exceptionally safe, minimal concerns |
| 16-30 | Low | π’ Green | Very safe, typical travel precautions |
| 31-40 | Low-Moderate | π‘ Light Green | Generally safe, stay aware |
| 41-50 | Moderate | π‘ Yellow | Some concerns, monitor situation |
| 51-60 | Elevated | π Orange | Heightened risks, extra caution |
| 61-70 | High | π Dark Orange | Significant concerns, avoid unnecessary travel |
| 71-80 | Severe | π΄ Red | Major security issues, high risk |
| 81-90 | Critical | π΄ Dark Red | Dangerous conditions, travel not advised |
| 91-100 | Extreme | β« Black-Red | Active conflict zones, do not travel |
Important: This project uses synthetic data for demonstration purposes. The safety scores are generated to illustrate:
- Realistic geopolitical scenarios as of October 2025
- Regional tension patterns (war zones, border disputes, political stability)
- Visual representation capabilities
- Official government travel advisories
- Embassy safety notices
- Professional risk assessment services
The chat interface is fully built and waiting for intelligence! The beautiful purple gradient widget in the bottom-right corner is ready to become your personal travel advisor.
The integrated AI chatbot will:
- π¬ Answer safety questions - "Is it safe to visit Poland right now?"
- π Recommend destinations - "Where's the safest beach vacation in Europe?"
- π Explain risk factors - "Why does Ukraine have a score of 98?"
- π§³ Provide travel advice - "What precautions should I take in the Balkans?"
- π Analyze trends - "Which regions are becoming safer?"
Connect directly to any LLM provider:
Supported Providers:
- π¦ OpenAI GPT-4 - Best general knowledge
- πͺ Anthropic Claude - Excellent reasoning
- π΅ Google Gemini - Fast responses
- π¨ Custom LLM - Your own model
Implementation:
// Add to index.html
const AI_CONFIG = {
provider: 'openai',
apiKey: 'your-api-key-here',
model: 'gpt-4-turbo'
};Model Context Protocol (MCP) enables the AI to access live data sources, making recommendations based on real-time information instead of synthetic data.
Why MCP?
Traditional API calls give you a chatbot. MCP gives you an intelligent travel advisor with:
β Live Data Access - Real-time geopolitical events from GDELT β Multi-Source Intelligence - Aggregate government travel advisories β Tool Integration - Weather, flight prices, accommodation safety β Dynamic Scoring - Update risk scores based on breaking news β Contextual Awareness - AI knows what's on the map you're viewing
MCP Architecture Diagram:
βββββββββββββββββββ
β Frontend Chat β
β (Browser) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β MCP Client β
β (JavaScript) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β MCP Server (Node.js) β
β ββββββββββββββββββββββββββββββββββ β
β β Tool Registry β β
β ββββββββββββββββββββββββββββββββββ€ β
β β β’ get_tension_data() β β
β β β’ fetch_gdelt_events() β β
β β β’ get_travel_advisories() β β
β β β’ analyze_geopolitical_risk() β β
β β β’ recommend_destinations() β β
β β β’ get_weather_safety() β β
β ββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββ¬ββββββββββββββββββββββββ
β
ββββββββββ΄βββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β GDELT API β β Travel.State β
β (Events) β β .Gov API β
ββββββββββββββββ ββββββββββββββββ
β β
ββββββββββ¬βββββββββ
βΌ
ββββββββββββββββ
β Claude API β
β (Reasoning) β
ββββββββββββββββ
MCP Implementation Example:
1. MCP Server (Backend) - mcp-server/index.js
import { MCPServer } from '@modelcontextprotocol/server';
const server = new MCPServer({
name: 'europesafe-backend',
version: '1.0.0',
tools: [
{
name: 'get_current_tension_data',
description: 'Fetch real-time geopolitical tension scores',
parameters: {
country_iso3: { type: 'string', required: false }
},
handler: async ({ country_iso3 }) => {
// Aggregate from multiple sources
const gdeltScore = await fetchGDELTEvents(country_iso3);
const advisories = await fetchTravelAdvisories(country_iso3);
const newsAnalysis = await analyzeRecentNews(country_iso3);
return calculateRiskScore({
gdeltScore,
advisories,
newsAnalysis,
historicalTrends: getHistoricalData(country_iso3)
});
}
},
{
name: 'recommend_safe_destinations',
description: 'AI-powered destination recommendations',
parameters: {
preferences: { type: 'object' },
max_risk_score: { type: 'number', default: 50 }
},
handler: async ({ preferences, max_risk_score }) => {
const safeCountries = await querySafeCountries(max_risk_score);
const matched = matchUserPreferences(safeCountries, preferences);
return rankByScore(matched);
}
},
{
name: 'explain_risk_factors',
description: 'Detailed breakdown of why a country has its risk score',
parameters: {
country_iso3: { type: 'string', required: true }
},
handler: async ({ country_iso3 }) => {
const factors = await analyzeRiskFactors(country_iso3);
return {
primary_risks: factors.primary,
recent_events: factors.events,
trend_analysis: factors.trends,
travel_tips: generateTravelTips(factors)
};
}
}
]
});
server.listen(3000);2. MCP Client (Frontend) - Update index.html
import { MCPClient } from '@modelcontextprotocol/client';
const mcpClient = new MCPClient({
serverUrl: 'http://localhost:3000',
llmProvider: {
name: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-3-5-sonnet-20241022'
}
});
async function sendMessage() {
const userMessage = chatInput.value.trim();
addMessage(userMessage, 'user');
// AI can now use MCP tools automatically
const response = await mcpClient.chat({
messages: [
{ role: 'system', content: 'You are a travel safety advisor with access to real-time geopolitical data.' },
{ role: 'user', content: userMessage }
],
tools: mcpClient.getAvailableTools() // AI chooses which tools to use
});
addMessage(response.content, 'bot');
}3. Example Conversation with MCP:
User: "Is it safe to visit Poland right now?"
AI: *calls get_current_tension_data({ country_iso3: 'POL' })*
*calls fetch_gdelt_events({ country_iso3: 'POL' })*
*calls get_travel_advisories({ country_iso3: 'POL' })*
AI Response: "Poland currently has a tension score of 65 (Elevated).
While major cities like Warsaw and Krakow remain safe for tourists,
the elevated score reflects:
1. **Border Tensions** - Proximity to Ukraine conflict (150km from eastern border)
2. **Infrastructure Risks** - Rail/energy facilities considered strategic targets
3. **Recent Events** - 3 security incidents in past 30 days (GDELT data)
**Travel Advice:**
β
Western/Southern Poland: Generally safe
β οΈ Eastern border regions: Avoid within 100km of Ukraine
β
Major cities: Normal precautions apply
Would you like recommendations for safer alternatives nearby?"
Prerequisites:
- Node.js 18+ or Python 3.10+
- API keys for data sources (GDELT, travel advisories)
- LLM API key (OpenAI, Anthropic, etc.)
Quick Start:
# 1. Clone MCP server template
git clone https://github.com/yourusername/europesafe-mcp-server
cd europesafe-mcp-server
# 2. Install dependencies
npm install
# 3. Configure environment
cp .env.example .env
# Add your API keys to .env
# 4. Start MCP server
npm run dev
# 5. Update frontend to use MCP client
# (See implementation example above)Environment Variables:
ANTHROPIC_API_KEY=your-key-here
GDELT_API_KEY=your-key-here
TRAVEL_GOV_API_KEY=your-key-here
MCP_SERVER_PORT=3000| Scenario | Direct API | MCP Server |
|---|---|---|
| Quick demo | β Perfect | β Overkill |
| Synthetic data only | β Simple | β Unnecessary |
| Live data sources | β Ideal | |
| Multi-tool AI | β Difficult | β Built for this |
| Production app | β Recommended | |
| Offline capability | β Yes | β Needs backend |
Phase 1: Simple API (Current)
- Basic chat UI β
- Placeholder responses β
Phase 2: Direct LLM Integration
- OpenAI/Claude API connection
- Context from
europe-tension.json - Basic Q&A capability
Phase 3: MCP Architecture π― Recommended
- Real-time GDELT data integration
- Government travel advisory aggregation
- Multi-source intelligence fusion
- Tool-enabled AI reasoning
- Dynamic risk score updates
Phase 4: Advanced Features
- Weather safety integration
- Flight price correlation
- Accommodation risk assessment
- Historical trend analysis
- Predictive modeling
Edit data/europe-tension.json:
{
"version": "3.0",
"source": "Synthetic Data - Travel Safety Index",
"scores": [
{
"iso3": "AUT",
"country": "Austria",
"score": 20,
"level": "low",
"risk": "Low",
"notes": "Generally safe; tourist areas can be crowded."
}
]
}Modify the getTensionColor() function in index.html:
const colorStops = [
{ value: 0, color: [26, 152, 80] }, // Your custom RGB
{ value: 100, color: [165, 0, 38] } // Your custom RGB
];Advantages:
- β Free hosting forever
- β Global CDN (fast worldwide)
- β HTTPS by default
- β Easy updates via Git push
Setup:
- Push code to GitHub repository
- Go to Settings β Pages
- Select
mainbranch β Save - Access at
https://yourusername.github.io/europesafe
Advantages:
- β Blazing fast CDN
- β Custom domain support
- β Analytics included
Advantages:
- β One-click deployment
- β Automatic HTTPS
- β Preview deployments
See DEPLOYMENT.md for detailed instructions.
β
XSS Protection - Input sanitization on all user inputs
β
No Inline Event Handlers - Modern event listener architecture
β
CORS-Ready - Secure cross-origin resource sharing
β
Content Security - textContent usage prevents injection
β
Input Validation - 500-character limit on chat messages
β
No External Dependencies - Minimal attack surface
π Zero Tracking - No analytics, no cookies, no fingerprinting π No User Data - All processing happens client-side π No Backend - Static site with no server logs π Open Source - Code is transparent and auditable
"Should I book flights to Eastern Europe this summer?"
- Visualize regional safety at a glance
- Compare destination risks side-by-side
- Get AI recommendations based on your risk tolerance
"Teaching international relations or geography?"
- Interactive visual aid for geopolitical concepts
- Real-time discussion tool for current events
- Customizable data for classroom scenarios
"Learning web mapping and data visualization?"
- Clean, well-documented codebase
- Modern vanilla JavaScript patterns
- Leaflet.js integration examples
- API integration scaffolding
"Analyzing regional stability patterns?"
- Visual correlation analysis tool
- Customizable data input format
- Export-ready map visualizations
- Initial Load: < 2 seconds on 3G
- Bundle Size: ~60KB (HTML + CSS + JS)
- Data Transfer: ~15KB JSON per refresh
- Lighthouse Score: 95+ (Performance, Accessibility, Best Practices)
We welcome contributions! Here's how you can help:
Open an issue with detailed description and reproduction steps.
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
- π Additional country data coverage
- π€ AI model integrations
- π± Mobile UX improvements
- π Internationalization (i18n)
- π Additional data visualization layers
This project is licensed under the MIT License - see LICENSE file.
MIT License - You are free to:
β
Use commercially
β
Modify
β
Distribute
β
Private use
- Leaflet.js - Incredible open-source mapping library
- Natural Earth Data - Public domain map data
- Community Contributors - Thank you for your support!
- Issues: GitHub Issues
- Email: [email protected]
- Discussions: GitHub Discussions
If you find EuropeSafe useful, please consider giving it a β on GitHub!
Built with β€οΈ for travelers, by travelers
Synthetic data β’ Open source β’ Privacy-first β’ Always free