Skip to main content

Data model

Authoritative schema: server/prisma/schema.prisma (Prisma 6).

All models​

ModelPurpose
AdminAdmin accounts
AdminSettingsPer-admin settings
UserParticipant records (linked to experiments)
ConstantSettingTunable platform constants
ExperimentUniversity experiment definition + secret join code
GameSessionUnified room (experiment / friends / solo)
PlayerSessionPer-player session token / reconnect state
SurveyResponseTyped survey answers per user
ExitSurveyExit survey payload
SinglePlayerForagingSP foraging results
MultiplayerForagingMP foraging aggregates
MultiplayerForagingRoundPer-round MP metrics (keyed by expID string)
ArithmeticTestArithmetic stress results
PracticeSessionFriends/solo practice data (separate from official experiment)
SimulationRunBot simulation job
SimulationRoundRounds within a simulation
SimulationBotResultPer-bot outcomes in a round

Core session graph​

Used for live rooms and reconnect:

  • GameSession.experimentId is nullable — friends/solo rooms have no experiment.
  • PlayerSession links to GameSession by roomCode (not numeric id).
  • MultiplayerForagingRound is not a Prisma relation to Experiment / GameSession; it stores an expID string used by export/analysis code.

Simulation subgraph​

Statuses on SimulationRun include pending, running, complete, failed, cancelled.

Survey and foraging data​

  • Official surveys: SurveyResponse (@@unique([userId, type])) plus ExitSurvey
  • Gameplay tables: SinglePlayerForaging, MultiplayerForaging, ArithmeticTest
  • Practice (non-experiment): PracticeSession indexed by roomCode

Export jobs and the data dictionary (Phase 2) document column-level meaning for analysis.