Skip to main content

Content Pages

Overview

This domain is a lightweight CMS for building content web pages — articles and landing pages — scoped to each LINE OA. It supports multiple languages, SEO and Open Graph metadata, access control (public token, password, or audience), and visitor statistics including UTM parameters.

The guiding design principle is separating content from the page itself: content_page holds structure, status, and permissions, while the actual text lives in content_page_translation, one row per language.

Core Data Structure

content_page (model ContentPage)

  • uuid (unique) and slug VARCHAR(255), jointly unique as (line_oa_id, slug)
  • status (enum ContentPageStatus) — draft / published / archived, plus version
  • access control: public_token (unique), require_auth, password_protected, password_hash
  • publishing metadata: published_at / published_by and archived_at / archived_by
  • statistics: view_count and unique_view_count (BIGINT)
  • categorisation: category_idcontent_category.id and subcategory_idcontent_subcategory.id
  • audience_ids JSONB — restricts which segments can see the page
  • friend tracking: friend_track_campaign_idfriend_track_campaign.id (ON DELETE SET NULL) together with friend_track_button_text for the add-friend button
  • soft delete via deleted_date and deleted_by

content_page_translation

Per-language content, unique on (content_page_id, language), with content_page_id as a ON DELETE CASCADE foreign key.

  • content: title, content, excerpt
  • SEO: meta_title, meta_description, meta_keywords, og_title, og_description, og_image_url, twitter_card

content_page_utm

A 1:1 companion to the page (content_page_id is unique) storing utm_source, utm_medium, utm_campaign, utm_term, and utm_content.

content_page_analytics

Also 1:1 with the page, holding scripts and event configuration.

  • ga_events JSONB, fb_pixel_events, line_tag_events, custom_head_scripts, custom_body_scripts
  • toggles enable_ga (default true), enable_fb_pixel, enable_line_tag

content_page_view

A per-visit log.

  • visitor details: viewer_ip, viewer_user_agent, viewer_referrer, viewer_line_uid
  • UTM values carried by the URL, plus session_id, language, device_type, viewed_at
  • indexes on (content_page_id), (session_id), and (viewed_at)
  • prisma/schema.prisma:1013 — model ContentPage
  • prisma/schema.prisma:1079 — model ContentPageTranslation
  • prisma/schema.prisma:1112 — model ContentPageUtm
  • prisma/schema.prisma:1135 — model ContentPageAnalytics
  • prisma/schema.prisma:1163 — model ContentPageView
  • schema-dumps/2026-07-24/schema.sql:1338, :1437, :1482, :1375, :1521

Connections to Other Services

  • cms-api-go — page management, translations, SEO and script configuration, publishing and archiving
  • client-api-go — the public page: checks access by token, password, or audience, renders the matching translation, writes a content_page_view row, and increments counters

Related domains: Content Categories & Link Collections, Audience, Friend-source Tracking