An interactive real-time nightlife map of Pattaya, Thailand, combining the best features from multiple projects.
- πΊοΈ Interactive Leaflet Map: Emoji-based venue markers with color intensity
- πΆ Corridor Visualization: Real-time traffic flows from Lantana Plaza to nightlife zones
- βοΈ Early Hotspot Detection: Identifies venues with high 12:00-17:00 activity
- π§οΈ Weather Integration: Multiple providers (demo, OpenWeather, Open-Meteo)
- π Night Lights Layer: Toggle dark-themed map tiles
- π After-Shift Analysis: Top 3 venues by social mentions (22:00-06:00)
- π Multi-language Segments: Separate rankings for Expat vs. Asian audiences
- π Dynamic Scoring: Weather-adjusted venue scores
- π₯ Now/Tonight Strip: Real-time corridor traffic and venue activity
- π² Mokata/BBQ Filter
- π€ Karaoke Filter
- π© Gentlemen's Clubs Filter
- π Open Late Filter
- π Open Early Filter
- π± Mobile-First Design
- Python 3.8+
- Node.js 18+ (for Playwright tests)
- SQLite3 (usually pre-installed)
cd ~/Projects/pattaya_map_wip
# Run setup script
chmod +x install.sh run.sh
./install.sh./run.shOpen: http://localhost:8000
# Install test dependencies
cd tests
npm install
npx playwright install
# Run all tests
npm test
# Run with browser visible
npm run test:headed
# Run with Playwright UI
npm run test:ui| Endpoint | Description |
|---|---|
GET /api/pattaya/all_nightlife_venues |
All venues with coordinates, scores, tags |
GET /api/pattaya/corridor_flows |
Traffic data from Lantana (last 90 min) |
GET /api/pattaya/xzyte_summary |
Xzyte area venue counts |
GET /api/pattaya/aftershift_top3 |
Top venues tonight (All/Expat/Asian) |
GET /api/pattaya/weather_context |
Current weather + rain status |
GET /api/venues |
All venues (extended) |
GET /api/venues/{slug} |
Single venue by slug |
GET /health |
Health check |
Edit config/secrets.txt to configure API keys:
# Weather Provider (demo, openweather, open-meteo)
WEATHER_PROVIDER=openweather
OPENWEATHER_API_KEY=your_key_here
# Map Tiles (optional)
MAPTILER_API_KEY=your_key_here
# WiFi Density Data (optional)
WIGLE_API_NAME=your_name
WIGLE_API_TOKEN=your_tokenpattaya_map_wip/
βββ backend/
β βββ app/
β β βββ main.py # FastAPI application
β β βββ __init__.py
β βββ requirements.txt
βββ frontend/
β βββ index.html # Main HTML page
β βββ map.js # Leaflet map + UI logic
β βββ style.css # Mobile-first styling
βββ database/
β βββ schema.sql # Database schema
β βββ seed_data.sql # Demo venues
β βββ nightlife.db # SQLite database (created on install)
βββ tests/
β βββ playwright/
β β βββ map.spec.ts # Map E2E tests
β β βββ api.spec.ts # API integration tests
β βββ playwright.config.ts
β βββ package.json
βββ config/
β βββ secrets.txt # API keys (gitignored)
βββ install.sh # Setup script
βββ run.sh # Run script
βββ README.md
βββ AGENTS.md
The map is fully responsive and optimized for mobile devices:
- Touch-friendly controls
- Swipe to pan, pinch to zoom
- Collapsible panels to maximize map space
- Dark theme for nighttime use
- API keys stored in
config/secrets.txt(gitignored) - Optional encryption via
tools/encrypt_secrets.py - CORS enabled for development
- SQLite with foreign key enforcement
cd backend
source ../.venv/bin/activate
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000INSERT INTO venues (city_id, zone_id, slug, name, lat, lng)
VALUES (
(SELECT id FROM cities WHERE name='pattaya'),
(SELECT id FROM zones WHERE name='walking_street'),
'venue_slug',
'Venue Name',
12.9271,
100.8785
);
INSERT INTO venue_tags (venue_id, tag)
VALUES (
(SELECT id FROM venues WHERE slug='venue_slug'),
'mokata' -- or karaoke, gclub, open_late, open_early
);This project consolidates features from:
- Master-pattaya-map: Corridors, weather integration
- pattaya-nightlife-map: Early/after-shift analysis, secrets encryption
- pattaya-hotspots-complete: Extended venue categories
Built with β€οΈ for Pattaya nightlife exploration.