1. legacy
Itinera API
  • ✈ Itinera API Documentation
  • Docs
    • legacy
      • Itinera — System Overview
      • Technology Stack & Architecture
      • Getting Started Guide
      • Infrastructure
      • Frontend Application
      • Architecture Overview
      • API Reference
      • Backend Services
      • Development Guidelines
    • phases
      • 01. Architecture Overview & Checkout Idempotency
      • Phase 2: Commerce & Checkout Engine
      • Phase 3: Webhooks & Asynchronous Fulfillment
      • Phase 4: Security Perimeter & Authentication
      • Phase 5: Database Schema & Entity Relationships
      • Phase 6: AI Quota & Telemetry Subsystems
      • Phase 7: API Route Matrix & FormRequests
      • Phase 8: Global Exception & Error Handling
      • Phase 9: Frontend Ecosystem & State Management
      • Phase 10: Design System & Component Library
      • Phase 11: Interactive GSAP Animations
      • Phase 12: Deployment & CI/CD Pipeline
      • Phase 13: Testing Strategies
      • Phase 14: Performance & Optimization
      • Phase 15: Developer Onboarding & Runbooks
      • 15-Phase Comprehensive Wiki & Documentation Plan
  • APIs
    • Auth
      • Register a new user
      • Log in a user
      • Log out user
      • Refresh JWT token
      • Forgot password request
      • Reset password verification
      • Get current user profile
      • Update user profile
      • Redirect to Google OAuth
      • Google OAuth Callback
      • Verify email via signed URL
    • Catalog
      • List all countries
      • Get country details
      • List all cities
      • List all regions
      • List all destinations
      • Get destination details
      • Get hotels by destination
      • List all hotels
      • Get hotel details
      • Get reviews for a hotel
      • List all flights
      • Get flight details
      • List all restaurants
      • Get restaurant details
      • List all attractions
      • Get current weather
      • Submit review for an entity
      • Delete review
      • Toggle favourite status for entity
      • List my submitted reviews
    • Bookings
      • Book a tour destination
    • V1 Aliases
      • V1 List all countries
      • V1 Get country details
      • V1 List all cities
      • V1 List all destinations
      • V1 Get destination details
      • V1 Get hotels by destination
      • V1 List all hotels
      • V1 Get hotel details
      • V1 Get reviews for a hotel
      • V1 List all flights
      • V1 Get flight details
      • V1 List all restaurants
      • V1 Get restaurant details
      • V1 List all attractions
      • V1 Get attraction details
      • V1 List all regions
      • V1 Get weather details
    • Trips
      • List user trips
      • Create a new trip
      • Get trip details
      • Update trip details
      • Delete a trip
      • Get creation metadata
      • Attach items to a trip
      • Update trip item
      • Detach items from a trip
      • Fork a trip
    • Conversations
      • List user conversations
      • Start a new conversation
      • Get conversation details
      • List messages in conversation
      • Send message to conversation
      • Mark conversation as read
    • Commerce Plans
      • List public plans
      • Get public plan details
    • Commerce Subscriptions
      • Subscribe to a plan
      • Upgrade active plan
      • Get active subscription info
      • Cancel active subscription
    • Commerce Checkout
      • Initiate Paymob payment checkout
    • Integrations
      • Paymob status webhook callback
      • Paymob redirect return callback
    • System Settings & Support
      • Submit public contact message
      • Subscribe to system newsletter
      • Get list of my reports
      • List all notifications
      • Mark single notification as read
      • List available surveys
      • Submit answers for survey
      • Get survey details
      • Update survey details
      • Delete survey response
    • AI Tools
      • Enhance itinerary details using AI
      • Request AI review of itinerary
      • Plan route using AI assistance
      • Get AI quota remaining details
      • Chat with AI Concierge assistant
      • Get AI Review progress by ID
    • Agency Integration
      • Request agency assignment
      • List agency active tasks
      • List agency managed trips
      • Get agency total earnings
      • Get agency profile details
      • Update agency profile details
    • Admin User Management
      • List users inside admin dashboard
      • Get user profile
      • Set user active status
      • Block user profile
    • Admin Catalog Moderation
      • Create new catalog category
      • Create new catalog destination
      • Create new hotel catalog record
      • Create new flight catalog record
      • Create new restaurant catalog record
      • Create new attraction catalog record
  • Schemas
    • User
    • ErrorResponse
    • Trip
    • Destination
    • Hotel
    • Flight
    • Restaurant
    • Attraction
    • Booking
    • Review
    • Agency
    • Survey
  1. legacy

Frontend Application

Table of Contents#

1.
Application Shape
2.
Page Inventory
3.
Shared Core (common.js)
4.
Module Map
5.
Styling System
6.
Admin Suite
7.
Conventions For New Pages

Application Shape#

The frontend is a multi-page vanilla JS application: one HTML file per screen, no SPA router, no bundler for the public pages. Each page pulls shared CSS/JS plus its own module. This keeps deployment to any static host trivial (nginx container in this repo).
Diagram sources: page tree, js tree

Page Inventory#

GroupPages
Public marketingindex.html, about.html, contact.html, help.html, explore.html, weather.html
Authauth/ (login/register/forgot/social completion)
Catalog browsedestinations.html, hotels.html, flights.html, restaurants.html, attractions.html, countries.html + -details counterparts, search.html
Trip planneroverview.html, create-trip.html, itinerary.html, availability.html, trip-map.html, trip.html, copy-wizard.html
Commerceplans.html, plan-compare.html, checkout/receipt flows
Communityentity.html, agency portal under agency/
Errors403.html, 404.html, 500.html, errors/
Section sources: Frontend root listing

Shared Core (common.js)#

Key exports from the IIFE (common.js):
API_BASE resolution — TP_CONFIG.apiBase override, else http://127.0.0.1:8000/api.
apiFetch(path, options) — single fetch wrapper adding JWT header, JSON handling, unified error toasts.
Session guard — delegates to canonical Itinera stack (window.Itinera, token key itinera_token); unauthenticated users bounced to login.
Sidebar nav definition (Overview, Create Trip, Itinerary, Availability, Trip Map, Copy Wizard).
Toast system, currency/date formatters.

Module Map#

ModuleOwns
index.js, overview.jslanding hero, KPI counters, GSAP timelines
catalog-*.js (+ catalog-common.js)list/detail/browse patterns per entity
create-trip.js, itinerary.js, trip-map.js, copy-wizard.jsplanner screens incl. map view
availability.jscalendar/flight availability
plans-core.js, plans.js, plan-compare.jssubscription plans UX
checkout.js, receipt.jsPayMob hosted-checkout handoff + post-payment receipt
chat.jsconversation UI
surveys-core.js, survey-*.jssurvey create/answer/show
app.js, help.jsmisc app chrome
Section sources: js tree

Styling System#

Global sheets: common.css (tokens, layout, sidebar/topbar, glassmorphism navbar), page sheets per feature (index.css, catalog.css, itinerary.css, …), components under css/components/.
Design language: onyx glassmorphism boarding-pass aesthetic, gold/emerald accents on dark, GSAP entrance choreography, 4K photography assets under assets/.

Admin Suite#

admin/index.html shells 10+ dashboards (Users, Trips, Reviews, Analytics, CRUD catalogs, Settings, Reports, Contacts, Flags, Agency requests). All consume the same /api endpoints with role-gated responses (permission:*, role:*).

Conventions For New Pages#

1.
Copy an existing sibling page as skeleton; keep <head> asset order identical.
2.
Add one js/<feature>.js module; register nav entry in common.js NAV if it belongs in the app shell.
3.
Use apiFetch — never raw fetch — so auth/error/toast handling stays uniform.
4.
Style via existing tokens/classes first; add page CSS only for layout unique to the screen.
Modified at 2026-08-25 22:41:45
Previous
Infrastructure
Next
Architecture Overview
Built with