Trekzen is a comprehensive travel planning platform focused on solving real-world trip routing as a Traveling Salesman Problem (TSP). After extensive research into TSP heuristics, the project adopts a hybrid strategy: we use the LinβKernighan (LK) heuristic for optimization when the number of destinations is small (design intent: below 10), and switch to the Nearest Neighbor (NN) approximation for larger destination sets (design intent: 10 or more). This balances solution quality and performance for both quick day trips and multi-day vacation planning. Built with modern web technologies and Mapbox-powered distances, Trekzen helps travelers discover, plan, and navigate optimized tours across Kerala.
- Quick Planner: Single-day trip optimization with intelligent route planning
- Vacation Planner: Multi-day itinerary management with day-by-day optimization
- Interactive Maps: Real-time mapping with Leaflet.js integration
- Route Optimization: Advanced algorithms for minimizing travel time and distance
- User Authentication: Secure Firebase-based authentication system
- Business Management: Tools for local businesses to manage their listings
- Place Management: Admin tools for adding and managing tourist destinations
- Node.js - Runtime environment
- Express.js - Web application framework
- Firebase - Authentication and database services
- Mapbox API - Geocoding and routing services
- CSV Parser - Data processing for location information
- HTML5 - Markup structure
- CSS3 - Styling and responsive design
- JavaScript (ES6+) - Client-side functionality
- Bootstrap 5 - UI framework and responsive components
- Leaflet.js - Interactive mapping library
- Leaflet Routing Machine - Route visualization
- PapaParse - CSV data parsing
{
"cors": "^2.8.5",
"csv-parser": "^3.0.0",
"express": "^4.18.3",
"firebase": "^10.11.0",
"http-proxy-middleware": "^2.0.6",
"leaflet-routing-machine": "^3.2.12",
"node-fetch": "^3.3.2"
}Trekzen /
βββ AdminPage/ # Administrative interface
β βββ adminpage.html # Admin dashboard
β βββ adminpage.js # Admin functionality
β βββ adminsignin.html # Admin login page (entry)
β βββ adminsignup.html # Admin registration
β βββ README.md # Admin docs
βββ Homepage/ # Landing page and public interface
β βββ home.html # Main homepage
β βββ css/ # Stylesheets and animations
β βββ js/ # Frontend JavaScript modules
β βββ fonts/ # Custom fonts and icons
βββ Loginpage/ # User authentication
β βββ user_login.html # User login
β βββ user_signup_page.html # User registration
β βββ cascade/ # Auth stylesheets
βββ Mainpage/ # Core application functionality
β βββ components/ # Feature modules
β β βββ user_home.html # User home/dashboard
β β βββ profile/ # Profile pages
β β β βββ profile.html
β β βββ quick_planner/ # Single-day trip planning
β β β βββ quickplan.html
β β β βββ selected_destinations.json
β β β βββ distance.json
β β β βββ matrix.json
β β β βββ ordered_places.json
β β β βββ result.json
β β βββ vacation_planner/ # Multi-day trip planning
β β β βββ vacationplan.html
β β β βββ days.json
β β β βββ distance_days.json
β β β βββ days_matrix.json
β β β βββ ordered.json
β β β βββ vacresult.json
β β βββ add_destination/ # Add Destinations Contribution flows
β β β βββ add_bussiness/
β β β β βββ addbussiness.html
β β β β βββ bussiness.html
β β β βββ add_place/
β β β βββ addplace.html
β β β βββ place.html
β β βββ preset/ # Preset itineraries (e.g., Kodaikanal, Vagamon)
β β β βββ preset1.html # Preset route 1
β β β βββ preset2.html # Preset route 2
β β β βββ preset3.html # Preset route 3
β βββ js/ # App logic (modules)
β β βββ quick_planner/
β β βββ vacation_planner/
β β βββ preset/
β β βββ profile/
β β βββ main.js
β βββ css/ # App styles
β βββ cities.csv # Location database (2k+ entries)
β βββ Kerala.geojson # Geographic boundary data
βββ images/ # Static assets
β βββ avatars/ # User profile images
β βββ icons/ # Application icons
β βββ login_page/ # Authentication UI assets
β βββ main_page/ # Main application images
β βββ map/ # Mapping interface assets
βββ server.js # Main server application - Express server (serves static + APIs)
βββ package.json # Project dependencies
βββ package-lock.json # Lockfile
βββ README.md # Project documentation
Purpose: Optimizes single-day travel routes for maximum efficiency and minimal travel time.
Algorithm Strategy:
- Uses the hybrid TSP approach: LK for <10 destinations, NN for β₯10 (configurable threshold).
- Distance matrix is built from Mapbox Directions API responses.
Key Files:
quickplan.html- User interface for quick trip planningselected_destinations.json- Stores user-selected destinations with coordinatesdistance.json- Calculated distances between destination pairsmatrix.json- Distance matrix for algorithm processingordered_places.json- Optimized route order with total distanceresult.json- Algorithm execution results
Functionality:
- Interactive destination selection with map visualization
- Real-time distance calculation using Mapbox API
- LK/NN-based route optimization with distance matrix input
- Visual route display with markers and path visualization
Purpose: Manages multi-day vacation itineraries with day-by-day optimization.
Algorithm Strategy:
- Applies the same hybrid TSP approach per day: LK for <10 places, NN for β₯10 (configurable).
- Builds a per-day distance matrix; optimizes each day independently and aggregates results.
Key Files:
vacation.html- User interface for vacation planningdays.json- Daily itinerary data with places visited per daydistance_days.json- Distance calculations for each day's routedays_matrix.json- Distance matrices for daily optimizationordered.json- Complete vacation route with day-wise organizationvacresult.json- Vacation planning algorithm results
Functionality:
- Multi-day trip planning with flexible day allocation
- Per-day LK/NN optimization with Mapbox-based distances
- Comprehensive vacation itinerary management
- Total distance and time calculations across all days
Purpose: Enable admins or authorized users to add new tourist places to the platformβs database and manage metadata.
Key Files:
addplace.html- Form interface to create a new place with district, category, name, and coordinates.addplace_main.html- Listing/management view to review and curate newly added places.
Functionality:
- Validated form inputs for district, categories (place/tourist/hotels/facilities), coordinates.
- Adds entries aligned to
cities.csvschema for unified querying and mapping. - Supports future moderation workflows.
Purpose: Allow local businesses (hotels, facilities, tourist services) to submit and manage listings visible within planning flows.
Key Files:
bussiness.html- Primary submission and management interface for business listings.bussiness1.html- Alternative/legacy layout for business onboarding.
Functionality:
- Business details capture (name, type, location, contact).
- Integrates with category filters used across planners.
- Prepares data for map display and discovery.
Purpose: Provide curated, ready-to-use itineraries for common travel themes, enabling one-click planning.
Key Files:
preset1.html,preset2.html,preset3.html- Curated itinerary pages.- Related logic in
Mainpage/js/preset1.js,preset2.js,preset3.jsfor interactions.
Functionality:
- Pre-filled destinations and flows that users can adopt or tweak.
- Works with the same optimization and mapping stack used by planners.
-
Create a new Web Service
- Build Command: (leave empty for Node)
- Start Command:
node server.js - Environment:
NODE_VERSION(optional)
-
Environment variables
PORTis provided by Render automatically.
-
Notes
- The server serves static files and API under the same origin; client scripts call APIs with relative paths.
- For local dev, run
npm startand openhttp://localhost:3000.
- Purpose: moderation and approval of user-contributed content.
- In the main app (
/Mainpage), normal users can propose new Places and Businesses viaMainpage/components/add_destination/(bothadd_placeandadd_bussiness). These submissions enter a pending/approval state. - The Admin app (
/AdminPage) lists all pending submissions so admins can review and approve/reject them. This prevents fake or lowβquality entries while leveraging community contributions for coverage of new places and businesses.
- In the main app (
- Open the admin UI at:
- Local:
http://localhost:3000/AdminPage - Render:
<your-render-url>/AdminPage
- Local:
- For detailed admin docs, see
AdminPage/README.md.
- Node.js (v14 or higher)
- npm or yarn package manager
- Mapbox API key
- Firebase project configuration
-
Clone the repository
git clone https://github.com/Abin-28/Trekzen_Major-Project.git cd Trekzen_Major-Project -
Install dependencies
npm install
-
Configure environment
- Update Mapbox API key in
server.js(line 51) - Configure Firebase credentials in the application
- Ensure
cities.csvcontains your location data
- Update Mapbox API key in
-
Start the server
node server.js
-
Access the application
- Local development:
http://localhost:3000 - Production (Render): Use your Render service URL. All API calls use relative paths, so no code changes are needed when deploying.
- Network access:
http://[YOUR_IP]:3000 - Production:
https://trekzen11.glitch.me
- Local development:
- Run
ipconfig(Windows) orifconfig(Linux/Mac) to get your IPv4 address - Access the application using
http://[YOUR_IP]:3000from any device on the same network
The application dynamically generates several JSON files during operation:
selected_destinations.json- Updated when users select destinationsdistance.json- Regenerated with each new destination selectionmatrix.json- Recalculated for algorithm processingordered_places.json- Generated after route optimizationresult.json- Created after algorithm execution
days.json- Updated for each day's itinerarydistance_days.json- Regenerated for daily distance calculationsdays_matrix.json- Recalculated for each day's optimizationordered.json- Generated for complete vacation routevacresult.json- Created after vacation algorithm execution
- cities.csv: Contains 2133+ locations across Kerala with coordinates
- Kerala.geojson: Geographic boundary data for mapping
- Mapbox API: Real-time distance and routing calculations
POST /saveDestinations- Save selected destinations for quick planningPOST /saveDestinationsByDay- Save destinations for specific vacation daysPOST /executeAlgorithm- Execute quick planner optimizationPOST /executeVacationAlgorithm- Execute vacation planner optimizationPUT /emptySelectedDestinationsFile- Clear quick planner dataPUT /emptydaysFile- Clear vacation planner dataPOST /emptyOrderedJson- Reset vacation route data
- Core problem: model routing as a TSP over selected destinations.
- Research-driven choice:
- LinβKernighan (LK): high-quality solutions via powerful k-opt edge exchanges; excellent for small/medium sets.
- Nearest Neighbor (NN): very fast approximation that scales to larger sets with acceptable quality.
- Switching rule (design intent): use LK when destinations < 20; use NN when destinations β₯ 20.
- Distances: populated from Mapbox Directions API, stored in JSON, then assembled into a symmetric distance matrix.
- The threshold is configurable in code:
- Quick Planner:
Mainpage/js/quickplan_algorithm.js - Vacation Planner:
Mainpage/js/vacationplan_algorithm.js
- Quick Planner:
- Pipeline:
- Compute pairwise distances β build matrix β select algorithm via threshold β write results to
result.json/vacresult.jsonβ generate ordered routes (ordered_places.json/ordered.json).
- Compute pairwise distances β build matrix β select algorithm via threshold β write results to
- Interactive Leaflet.js maps
- Real-time marker placement
- Route visualization with turn-by-turn directions
- Cluster management for multiple destinations
- Firebase Authentication integration
- User session management
- Admin panel access control
- Secure API endpoint protection