Reference

Data model

The Prisma schema at a glance — every table and how they relate.

The canonical schema lives in rustplus-api/prisma/schema.prisma. The summary below mirrors that file; for migrations and exact column types check the source.

Identity & billing

  • Userid, steamId (unique), displayName, avatarUrl, email?, createdAt, lastSeenAt.
  • SubscriptionuserId (unique), tier (SCOUT/OPERATOR/OVERLORD), status (ACTIVE/TRIALING/PAST_DUE/CANCELED), currentPeriodEnd?, cancelAtPeriodEnd, stripeCustomerId, stripeSubscriptionId.
  • BetaTestersteamId, tier, note?, addedBy?, expiresAt?, revokedAt?, revokedBy?.
  • StripeWebhookEventid (Stripe event id), createdAt. Used for replay protection.

Pairing & credentials

  • PairedServer — one row per Rust+ pairing. id, userId, serverName, ip, port, playerToken (encrypted), pairedAt, lastSeenAt.
  • FcmCredentialuserId (unique), blobEncrypted, keyVersion, createdAt, updatedAt. Encrypted with CREDS_ENCRYPTION_KEY.
  • DevicePairing — pairing codes / device tokens. code, tokenHash, label, expiresAt, activatedAt?.

Discord

  • DiscordIntegration — one per user. guildId, guildName, installedAt, plus a Boolean per channel family + the resolved channel ID per family.

Dashboard sharing

  • DashboardGuestAccess — many per owner. ownerUserId, pairedServerId, guestUserId? (set after first sign-in), guestSteamId, revokedAt?.

Intel store

  • MapNote — tags, SAMs, death markers. pairedServerId, category, x, y, label?, ttl?.
  • SmartDevice — switches / alarms / monitors / cameras. State + custom command per device.
  • TrackedShopItem — shop watch entries.
  • PlayerIntelNote — tracked-player notes & tags.
  • PlayerSteamLink — bind BattleMetrics player → Steam ID.
  • Watchlist — saved filters over PlayerIntelNote.

Tools

  • SavedConveyorFilter — per-user conveyor sorter manifests.
  • SavedGeneBatch — per-user plant genetics solutions.

Catalog

  • Item — the canonical Rust item catalog. Driven by the admin's Items page.
  • ConveyorShortname — mapping conveyor shortnames → items. Driven by the admin's Conveyor Map page.
  • ContentStore — key/value JSON blobs for FAQ, crafting recipes, raid calculator, bot messages.

Admin

  • AdminAudit — one row per admin write. actorSteamId, actorUserId?, action, target?, payload?, result?, createdAt.
  • BattleMetricsQuota — daily quota counter.

Relationships at a glance

User ──┬─ Subscription (1:1)
       ├─ BetaTester (via steamId)
       ├─ PairedServer (1:many)
       │    └─ SmartDevice (1:many)
       │    └─ MapNote (1:many)
       │    └─ TrackedShopItem (1:many)
       │    └─ PlayerIntelNote (1:many)
       ├─ FcmCredential (1:1)
       ├─ DiscordIntegration (1:1)
       └─ DashboardGuestAccess (1:many owner ← guest)