Go-Map is a comprehensive geospatial application built with Go and JavaScript that allows users to track, analyze, and visualize location data, trajectories, and explore nearby points of interest.
- Search Locations: Find nearby places based on your current location or any selected point on the map
- Activity-Based Search: Search for locations by activities or categories (restaurants, entertainment, sports, etc.)
- Route Calculation: Visualize routes between your location and points of interest with distance and time information
- Custom Location Markers: Save your own custom locations with categories and descriptions
- Trajectory Recording: Create and save your movement paths using various input methods:
- Manual entry of GPS coordinates
- Upload GPX, KML, or JSON files containing trajectory data
- Draw trajectories directly on the map
- Trajectory Visualization: View your saved trajectories on an interactive map
- Stay Point Detection: Automatically identify locations where users spend significant time
- Collaborative Filtering: Get location recommendations based on similar user trajectories
- Popularity-Based Recommendations: Discover hot spots visited by many users
- Personalized Suggestions: Receive location recommendations based on your movement patterns
- User Authentication: Secure login and registration system with JWT-based authentication
- User Profiles: Update personal information and manage location preferences
- Role-Based Authorization: Different access levels for regular users and administrators
- User Management: Create, view, update, and delete user accounts
- Location Management: Administer all locations in the system with CRUD operations
- Trajectory Administration: Review and manage all user trajectories with visualization capabilities
- Interactive Maps: Powered by Leaflet.js for a smooth mapping experience
- Geocoding: Convert coordinates to address information and vice versa
- Current Location Detection: Easily find and use your current location
- Distance Calculation: Calculate distances between points using both as-the-crow-flies and actual route distances
- Go (Golang): Primary backend language
- Gin: Web framework for handling HTTP requests
- GORM: Object-Relational Mapping for database interactions
- PostGIS/PostgreSQL: Spatial database for storing location data
- Goose: Database migration tool
- JWT: For secure authentication
- HTML/CSS/JavaScript: Core frontend technologies
- Bootstrap: For responsive UI components
- Leaflet.js: Interactive map implementation
- Fetch API: For making HTTP requests to the backend
- Stay Point Detection: Identifies locations where users spend significant time
- Hierarchical Clustering: Groups similar locations together
- Collaborative Filtering: For recommendation systems based on user similarities
- Docker and Docker Compose
Create a .env
file in the root directory with the following variables:
SERVER_PORT=8080
DB_HOST=localhost
DB_PORT=5432
DB_NAME=go_map
DB_USER=user
DB_PASSWORD=password
JWT_SECRET=your_secret_key_here
- Start the PostgreSQL database using Docker:
docker-compose up
- Load the database schema and initial data:
make load
make run
Access the application at http://localhost:8080
- Home Page: Main landing page with links to search and recommendation features
- Search Page: Find locations near a specified point or your current location
- Recommend Page: Get personalized location recommendations
- Settings Page: Manage your profile and your saved locations/trajectories
- Admin Page: Access administrative features (admin users only)
- Register an account or log in
- Use the search functionality to find locations near you
- Save trajectories using various input methods
- Explore recommended locations based on your movements
- Use the admin panel to manage users and data (admin only)
The application exposes the following main API endpoints:
POST /api/auth/login
: User loginPOST /api/auth/register
: User registrationPOST /api/auth/logout
: User logoutGET /api/auth/status
: Check authentication status
GET /api/location/search/place
: Search for places by activityGET /api/location/search/activity
: Search for activities by locationGET /api/location/rcm/hot
: Get popular locations (hot spots)GET /api/location/rcm/same/:id
: Get recommendations based on similar trajectories
GET /api/users/profile
: Get user profile informationPUT /api/users/profile
: Update user profilePUT /api/users/password
: Change user password
GET /api/locations
: Get user's saved locationsPOST /api/locations
: Create a new location
GET /api/trajectories
: Get user's trajectoriesPOST /api/trajectories
: Create a new trajectory
GET /api/admin/users
: Get all usersGET /api/admin/locations
: Get all locationsGET /api/admin/trajectories
: Get all trajectories- Plus full CRUD operations for each resource type
cmd/
: Application entry pointsconfig/
: Configuration managementdataset/
: Sample dataset filesinternal/
: Application core componentsalgorithms/
: Trajectory and location analysis algorithmsapi/
: Router setupdb/
: Database connection managementhandlers/
: Request handlersmiddleware/
: Authentication and authorization middlewaremodels/
: Data modelsservices/
: Business logic services
migrations/
: Database migration filesstatic/
: Static assets (CSS, JavaScript, images)templates/
: HTML templates
This project is licensed under the MIT License - see the LICENSE file for details.
- The GeoLife dataset provided by Microsoft Research for trajectory data
- OpenStreetMap for map data
- OSRM for route calculation services
- Nominatim for geocoding services