Skip to content

Activities ​

The Activity is the core product entity in MyEasyGuide. Each activity represents a trek, tour, or experience that travelers can browse and book.

Activity Model ​

An activity contains extensive metadata:

title, shortDescription, fullDescription     — Content
highlights[], inclusions[], exclusions[]      — Feature lists
price, duration, guestCapacity               — Pricing & logistics
images[], itinerary (JSON), meetingPoint      — Media & logistics
difficultyLevel, tripCategory, tripType       — Classification
cityId, regionId                              — Location
published, status, isFeatured                 — Moderation
popularityScore, views, averageRating, bookingsCount — Analytics
canonicalPath, urlHistory[]                   — SEO

Endpoints ​

MethodEndpointAuthDescription
GET/activityPublicList/search activities
GET/activity/popularPublicGet popular activities
GET/activity/featuredPublicGet featured activities
GET/activity/supplier/:idPublicActivities by supplier
GET/activity/:idPublicSingle activity detail
POST/activityAdminCreate activity
PATCH/activity/:idAdminUpdate activity
DELETE/activity/:idAdminDelete activity

Activity List ​

GET /api/v1/activity?search=trek&page=1&limit=20&city=pokhara&difficulty=MODERATE&sort=popularity

Query parameters:

ParamTypeDescription
searchstringFull-text search on title/description
pagenumberPage number (default 1)
limitnumberItems per page (default 20)
citystringFilter by city handle
cityIdstringFilter by city ID
regionIdstringFilter by region ID
tripCategoryIdstringFilter by trip category
tripTypeIdstringFilter by trip type
difficultystringFilter by difficulty level
minPricenumberMinimum price
maxPricenumberMaximum price
durationstringFilter by duration
sortstringpopularity, price_asc, price_desc, newest, rating
featuredbooleanOnly featured activities

Activity Detail ​

GET /api/v1/activity/42
Response: {
  data: { ...activity, supplier, city, region, tripCategory, tripType },
  recommendations: [ { id, title, images, price, duration } ]
}

The activity detail endpoint returns the full activity with all relations and Recombee-based recommendations ("You may also like").

Activity Status Lifecycle ​

     ┌──────────┐
     │  DRAFT   │  (published = false)
     └────┬─────┘
          │
          ▼
┌──────────────────┐
│ PENDING_APPROVAL │  Supplier submits → Admin reviews
└──────┬───────────┘
       │
       ├────────────────────┐
       ▼                    ▼
┌──────────┐        ┌──────────┐
│ APPROVED │        │ REJECTED │
│ (active) │        └──────────┘
└──────────┘

Supplier Activity Management ​

Suppliers can manage their own activities through the supplier dashboard:

MethodEndpointAuthDescription
GET/activity/supplier/:idPublicList supplier's activities
POST/activityAdminCreate (admin creates on supplier's behalf)

Activities can be promoted via the FeaturedTag system:

  • POST /featured/activity — Assign featured tag to activity
  • DELETE /featured/activity/:id — Remove featured tag
  • Listed on homepage and special sections

Route Format ​

The frontend generates URLs in this pattern:

/{country}/{city}/{category-handle}/{activity-slug}-{activity-id}
Example: /nepal/pokhara/trekking/everest-base-camp-trek-42

The catch-all route parses the last segment for -{id} to extract the activity ID for API calls.

Built with VitePress