# Gò Công Map List - LLM Context ## Giới thiệu Website danh bạ và bản đồ địa điểm tại Gò Công, Đồng Tháp (trước đây thuộc Tiền Giang). URL: https://data.gocong.org ## Công nghệ sử dụng - Backend: PHP 8+ - Database: SQLite - Frontend: Tailwind CSS, Vanilla JavaScript - Icons: Font Awesome - Maps: Leaflet.js, OpenStreetMap ## Cấu trúc thư mục ### Root Files - `index.php` - Trang chủ hiển thị danh sách địa điểm - `place.php` - Trang chi tiết địa điểm - `map.php` - Trang bản đồ tương tác - `submit.php` - Form đóng góp địa điểm mới - `bootstrap.php` - Khởi tạo hệ thống - `router.php` - URL routing - `sitemap.php` - Sitemap động - `robots.txt` - SEO robots ### Thư mục chính - `/admin/` - Quản trị hệ thống - `/assets/` - CSS, JS, fonts - `/config/` - File cấu hình - `/db/` - Database SQLite - `/helpers/` - Helper classes - `/includes/` - Components (header, footer) - `/lib/` - Core classes ## Core Classes ### DatabaseHelper (`helpers/DatabaseHelper.php`) - Quản lý kết nối SQLite database - Methods: `getMainDb()`, `getDatabasePath()` ### DataManager (`lib/DataManager.php`) - Singleton pattern - Quản lý dữ liệu địa điểm - Methods: - `getData($page, $limit, $search, $category, $region, $random)` - Lấy danh sách địa điểm - `getPlaceById($id)` - Lấy chi tiết địa điểm - `getCategories()` - Lấy danh sách phân loại - `getRegions()` - Lấy danh sách khu vực - `getStats()` - Thống kê tổng quan ### SecurityManager (`lib/SecurityManager.php`) - Bảo mật cơ bản - Rate limiting - IP blocking - XSS prevention ## Database Schema ### Table: places - `id` - Primary key - `name` - Tên địa điểm - `address` - Địa chỉ - `address_full` - Địa chỉ đầy đủ - `latitude` - Vĩ độ - `longitude` - Kinh độ - `place_category` - Phân loại - `region_final` - Khu vực ### Table: pending_places - Địa điểm chờ duyệt từ người dùng ### Table: edit_requests - Yêu cầu chỉnh sửa địa điểm ## Tính năng chính ### 1. Trang chủ (index.php) - Hiển thị danh sách địa điểm dạng grid - Phân trang - Tìm kiếm theo tên/địa chỉ - Lọc theo danh mục và khu vực - Random mode khi không có filter - Region badges với màu sắc: - GC (Gò Công) - Xanh dương (#3B82F6) - GCĐ (Gò Công Đông) - Cam (#F59E0B) - GCT (Gò Công Tây) - Xanh lá (#10B981) - TPĐ (Tân Phú Đông) - Tím (#8B5CF6) ### 2. Chi tiết địa điểm (place.php) - Thông tin đầy đủ - Bản đồ Leaflet - Link Google Maps - Comments (Disqus) - Nút edit request ### 3. Bản đồ (map.php) - Interactive map với Leaflet - Markers với popup - Clustering (MarkerCluster) - Filter sidebar ### 4. Submit form (submit.php) - Form đóng góp địa điểm mới - Validation - Lưu vào pending_places ### 5. Admin (/admin/) - Xác thực đơn giản - Quản lý địa điểm - Duyệt pending places - Xử lý edit requests ## Header Component (includes/header.php) ### Desktop - Logo + Title - Search toggle button (luôn hiển thị) - Map view button - Add location button (green) ### Mobile - Hamburger menu - Mobile menu với: - Map view button - Add location button - Stats - Filter toggle ### Filter Section - Mặc định ẩn trên tất cả trang - Toggle bằng search button - Responsive: lg breakpoint (1024px) - Form fields: - Search input (tên/địa chỉ) - Category select - Region select - Limit select (12/24/48) - Submit + Reset buttons ## Footer Component (includes/footer.php) - Logo và mô tả - Quick links - Community & Resources - Stats: hiển thị tổng số địa điểm (query từ DB) - Mobile CTA button ## JavaScript Files ### header.js - Mobile menu toggle - Search toggle (desktop & mobile) - Filter section toggle - Click outside to close - Window resize handler ### index.js - Smooth scroll on URL params - (Auto-collapse đã bị xóa) ### place.js - Leaflet map initialization - Marker placement - Copy coordinates ### submit.js - Form validation - Address suggestions - Coordinate picker ## CSS (assets/css/main.css) ### Key Classes - `.header-sticky` - Sticky header - `.place-card` - Item card với hover effect - `.place-region-badge` - Badge màu theo vùng - `.category-badge` - Badge theo danh mục - `.filter-section-animation` - Smooth animation - `.search-button-active` - Active state của search button ### Badge Colors - Worship: Yellow (#FEF3C7) - School: Blue (#DBEAFE) - Tourist: Green (#D1FAE5) - Park: Green (#D1FAE5) - Cemetery: Purple (#F3E8FF) - Stadium: Orange (#FED7AA) - Natural: Green (#D1FAE5) - Library: Indigo (#E0E7FF) - Museum: Pink (#FCE7F3) - Transit: Gray (#E5E7EB) ## SEO & Performance ### Meta Tags - Comprehensive SEO meta tags - Open Graph (Facebook) - Twitter Cards - Structured Data (JSON-LD): - Organization - WebSite - BreadcrumbList - FAQPage ### Performance - Output buffering + gzip compression - Cache headers (5 minutes) - HTML minification - Preconnect to CDNs - Lazy loading considerations ### Sitemap - Dynamic sitemap.php - sitemap-index.php - Auto-generated từ database ## Constants (config/config.php) - `RECORDS_PER_PAGE` - 24 - Database paths - Security settings ## API Endpoints ### /map-api.php - Returns places as GeoJSON - Supports filters - Used by map.php ### /admin/api.php - CRUD operations - Authentication required ## Responsive Breakpoints - Mobile: < 768px - Tablet: 768px - 1023px - Desktop: ≥ 1024px (lg) - Large Desktop: ≥ 1280px (xl) ## Vùng địa lý ### Sau sáp nhập 2025 Gò Công (Tiền Giang cũ) → Đồng Tháp: - Gò Công Đông + Gò Công Tây (1 phần) → Châu Thành - Tân Phú Đông + Gò Công Tây (còn lại) → Lai Vung - TP Gò Công + TX Gò Công → Phường Gò Công (Cao Lãnh) ## Analytics - Google Analytics: G-TM8TLBQRJW - Disqus Comments: gocong.disqus.com ## Related Sites - Main: https://gocong.org - Wiki: https://wiki.gocong.org - Data: https://data.gocong.org ## Contact - Email: admin@gocong.org ## Development Notes - PHP version: 8.0+ - Database: SQLite (portable) - No external dependencies for backend - CDN: Tailwind CSS, Font Awesome - Comments: Disqus embed ## Common Tasks ### Add new place 1. User submits via submit.php 2. Saved to pending_places table 3. Admin reviews in /admin/ 4. Approved → moved to places table ### Edit existing place 1. User clicks "Yêu cầu chỉnh sửa" on place.php 2. Saved to edit_requests table 3. Admin reviews and applies changes ### Search flow 1. User enters search on index.php 2. DataManager filters results 3. Returns paginated data 4. Displayed in grid layout ## Browser Support - Modern browsers (ES6+) - Mobile responsive - Touch-friendly UI ## License © 2025 Địa Điểm Gò Công - Community-driven project