Skip to main content

System Architecture

Modules​

ModulePortPurpose
admin-api (PMS)8080Manage SDUI, pricing rules, partners, listings, offers, wallet, loyalty tiers
crs8080Search, detail, offers, AI search, sales intelligence, wallet/loyalty
website8080Customer-facing APIs with traffic context, wallet hold/confirm, loyalty opt-in
wallet-loyalty—Wallet operations, loyalty services, tier evaluation, scheduled jobs
listing-core—Shared search, pricing, offer resolution logic
dao—JDBI DAOs organized by domain (listing, pricing, channel, website, property, place, etc.)
common—Entities, DTOs, enums
common-cache—Two-level cache (Caffeine L1 + Redis OM L2)
ai-search—RAG search for properties and listings
notification—Email, SMS, WhatsApp
test-utils—Shared test infrastructure (BasePostgresIntegrationTest)

Tech Stack​

  • Java 25 + Spring Boot 4.0.3
  • PostgreSQL with pgvector for embeddings
  • Redis Stack (Redis OM Spring) for L2 cache
  • Caffeine for L1 local cache
  • JDBI 3 for data access (no JPA/Hibernate)
  • Spring AI with OpenAI for AI features
  • Liquibase for migrations
  • Scalar for API documentation

Data Flow​

Request with Traffic Context​

Browser → Website API
│
├─ BevCookieInterceptor
│ └─ Sets/reads bev cookie (1-year, HttpOnly)
│
├─ TrafficContextInterceptor
│ ├─ Fresh params? → Persist + cache
│ └─ No params? → Resolve from bev: L1 → L2 → DB
│
├─ Controller (SDUI / Listings / Offers)
│ └─ TrafficContext injected automatically
│
└─ Service Layer
├─ SDUI: Visibility rules evaluated against context
├─ Pricing: PricingContextService matches rules
└─ Offers: Filtered by PricingAdjustment

Caching Layers​

L1 (Caffeine)          L2 (Redis OM)         DB (PostgreSQL)
5-min TTL 7-day TTL Permanent
Per-JVM Shared Source of truth
──────────── → miss → ──────────── → miss → ────────────
← fill ← ← fill ←