EngineModule referenceplatform-analytics

@withpotter/platform-analytics — module reference

HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.

HTTP routes

Analytics /analytics

MethodPathAuthDescription
POST/analytics/eventTrack analytics event

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
TrackEventUseCaseexecute(dto: TrackEventDto, ip?: string): Promise<{ success: boolean }>

Entities

Sequelize models owned by this module.

PlatformAnalytics — table platform_analytics

FieldType
idstring
typePlatformEventType
pagestring
referrerstring | null
durationnumber | null
scrollDepthnumber | null
sessionIdstring | null
utmSourcestring | null
utmMediumstring | null
utmCampaignstring | null
utmContentstring | null
utmTermstring | null
userAgentstring | null
ipHashstring | null
createdAtDate

Repositories

Data-access classes wrapping the entities.

PlatformAnalyticsRepository

create · getPageViews · getUniqueVisitors · getAverageSessionDuration

Generated from the module’s source. Routes are relative to the engine root (default http://localhost:3001). For full request/response schemas use the live OpenAPI document.