MyClaude Docs
MyClaude Docs

Getting Started

Buyers

Creators

CLI

API

Agent Integration

Developers

ContributingSelf-HostingWebhooks & IntegrationDesign System ReferenceData Model ReferenceAdmin Panel

Security

Legal

Developers

Data Model Reference

Complete Firestore data model for MyClaude: 13 collections, all fields, subcollections, indexes, security rules, and data flow diagrams.

ReferenceUpdated 2026-03-26

MyClaude uses 13 Firestore collections with camelCase naming, server-side order creation via Stripe webhooks, atomic username uniqueness, and XP deduplication logs.

Overview

PropertyValue
DatabaseCloud Firestore
Projectclaude-code-vault
Regionus-central1
Naming conventioncamelCase
Schema version1.1.0
Total collections13 (8 root + 5 subcollection groups)

All timestamps use Firestore server timestamps. All counters use FieldValue.increment() for atomic updates. Document IDs follow the convention noted per collection.

users/{uid}

User profiles for creators, buyers, and admins. Document ID is the Firebase Auth UID.

Core fields

FieldTypeRequiredDefaultDescription
uidstringyes—Firebase Auth UID
emailstringyes—Account email (never exposed to client)
usernamestringyes—Unique, lowercase, 3-30 chars. Pattern: ^[a-z0-9_-]{3,30}$
displayNamestringyes—Public display name (max 100 chars)
biostringno—Profile bio (max 500 chars)
avatarUrlstringno—Firebase Storage URL
countrystringno—Two-letter country code
localestringno"en"Preferred language (en, pt-BR, es)

Role and trust fields

FieldTypeRequiredDefaultDescription
rolestringno"user"One of: user, creator, verified_creator, admin
rankstringno—Current gamification rank ID
verifiedbooleannofalseManually verified by admin
bannedbooleannofalseAccount is banned
bannedBystringno—UID of admin who issued ban
bannedAttimestampno—When ban was issued
statusstringno—Set to "deleted" on account deletion

Stripe Connect fields

FieldTypeRequiredDefaultDescription
stripeAccountIdstringnonullStripe Connect Express account ID
stripeOnboardedbooleannofalseOnboarding completed

Gamification fields

FieldTypeRequiredDefaultDescription
xpnumberyes0Total experience points
levelnumberyes0Current level

stats (map)

Denormalized counters updated server-side via increment().

FieldTypeDefaultDescription
stats.followersnumber0Follower count
stats.followingnumber0Following count
stats.productsnumber0Published products
stats.downloadsnumber0Total downloads received
stats.likesnumber0Total likes received
stats.totalRevenuenumber0Lifetime revenue in cents (USD)
stats.totalSalesnumber0Total products sold
stats.reviewsReceivednumber0Reviews received across all products
stats.avgRatingnumber0Weighted average rating
stats.messagesSentnumber0Messages sent in conversations
stats.productsBoughtnumber0Products purchased
stats.achievementCountnumber0Achievements unlocked
stats.categoryCountmap{}Per-category product count, e.g. {skills: 3, agents: 1}

Timestamps

FieldTypeRequiredDescription
createdAttimestampyesServer timestamp at creation
updatedAttimestampyesServer timestamp at last update

Security rules

OperationRule
ReadPublic
Createauth.uid == userId
Updateauth.uid == userId (cannot modify stripeAccountId, stripeOnboarded)
DeleteNever (soft delete via account deletion endpoint)

users/{uid}/following/{targetUid}

Tracks who this user follows. Document ID is the target user's UID.

FieldTypeDescription
createdAttimestampWhen the follow occurred

users/{uid}/followers/{followerUid}

Tracks who follows this user. Document ID is the follower's UID.

FieldTypeDescription
createdAttimestampWhen the follow occurred

users/{uid}/achievements/{achievementId}

Unlocked achievements for the user.

FieldTypeDescription
titlestringAchievement name
descriptionstringWhat the user did to earn it
iconstringIcon identifier
tierstringOne of: bronze, silver, gold, diamond
unlockedAttimestampWhen unlocked

users/{uid}/notifications/{notificationId}

In-app notifications. Auto-generated document ID.

FieldTypeRequiredDefaultDescription
typestringyes—One of: purchase, download, follow, review, achievement, message, refund, system
titlestringyes—Notification headline
bodystringno—Notification detail text
linkstringno—Internal route to navigate to
readbooleanyesfalseHas user seen this
actorUidstringno—UID of user who triggered this
actorUsernamestringno—Username of triggering user
createdAttimestampyes—Server timestamp

products/{productId}

Published artifacts (skills, squads, agents, etc.). Document ID is auto-generated by Firestore.

Identity fields

FieldTypeRequiredDefaultDescription
titlestringyes—Product name (max 120 chars)
slugstringyes—URL-safe identifier, immutable after creation
descriptionstringyes—Short description (max 5,000 chars)
readmestringno—Markdown content for product page (max 50,000 chars)

Classification fields

FieldTypeRequiredDefaultDescription
categorystringyes—One of: skills, squads, agents, workflows, design-systems, claude-md, prompts, applications, systems
tagsarray<string>no—Up to 10 tags

Pricing fields

FieldTypeRequiredDefaultDescription
pricenumberyes0Price in USD (0 = free). Stored as float, converted to cents for Stripe
currencystringno"usd"Currency code

File fields

FieldTypeRequiredDescription
fileUrlstringyesR2 storage key or legacy Firebase Storage path. Never exposed to client for paid products.
fileNamestringyesOriginal filename
fileSizenumberyesFile size in bytes
thumbnailUrlstringnoProduct thumbnail URL

Author fields (denormalized)

FieldTypeRequiredDescription
authorUidstringyesAuthor's Firebase UID
authorUsernamestringyesAuthor's username
authorDisplayNamestringyesAuthor's display name
authorAvatarstringnoAuthor's avatar URL

Status and moderation fields

FieldTypeRequiredDefaultDescription
statusstringyes"pending_review"One of: draft, pending_review, published, archived, removed
approvedBystringno—Admin UID who approved
approvedAttimestampno—Approval timestamp
removedBystringno—Admin UID who removed
removedAttimestampno—Removal timestamp

Status lifecycle: Client creates always set pending_review (enforced by Firestore rules). Only Admin SDK can set published or removed.

Version and license fields

FieldTypeRequiredDefaultDescription
versionstringno"1.0.0"Semantic version
changelogstringno—Changelog text (max 2,000 chars)
licensestringno"MIT"One of: MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, ISC, CC-BY-4.0, CC-BY-SA-4.0, CC0-1.0, Proprietary, Custom

Enrichment fields (CONDUIT pipeline)

Present on CLI-published products that have been processed by the CONDUIT content pipeline.

FieldTypeRequiredDescription
mcsLevelnumbernoMCS certification level (1-5)
languagestringnoPrimary language of the product
longDescriptionstringnoExtended description from CONDUIT enrichment
installTargetstringnoInstall target path
compatibilitymapnoCompatibility info, e.g. {claudeCode: ">=1.0"}
dependenciesmapnoDependency info, e.g. {myclaude: ["other-skill"]}

stats (map)

Denormalized counters. Updated server-side only — Firestore rules block client writes to stats.

FieldTypeDefaultDescription
stats.downloadsnumber0Download count
stats.likesnumber0Like count
stats.ratingnumber0Average rating (1-5)
stats.reviewsCountnumber0Number of reviews
stats.purchaseCountnumber0Number of purchases

Timestamps

FieldTypeRequiredDescription
createdAttimestampyesServer timestamp at creation
updatedAttimestampyesServer timestamp at last update

Security rules

OperationRule
ReadPublic
CreateAuthenticated + authorUid == auth.uid + status must be pending_review
UpdateauthorUid == auth.uid (cannot change status, authorUid, or stats)
DeleteauthorUid == auth.uid

products/{productId}/likes/{userId}

One document per user per product. Document ID is the user's UID.

FieldTypeDescription
createdAttimestampWhen the like occurred

products/{productId}/versions/{versionId}

Version history. Each file upload creates a version record.

FieldTypeDescription
versionstringSemantic version string
fileUrlstringR2 storage key for this version
fileNamestringFilename
fileSizenumberBytes
changelogstringWhat changed
createdAttimestampUpload timestamp

products/{productId}/reviews/{reviewId}

Product reviews. Created server-side after purchase/download verification.

FieldTypeRequiredDescription
authorUidstringyesReviewer's UID
authorUsernamestringyesReviewer's username
authorDisplayNamestringnoReviewer's display name
authorAvatarstringnoReviewer's avatar URL
ratingnumberyes1-5 stars
commentstringyesReview text (max 1,000 chars)
createdAttimestampyesServer timestamp

products/{productId}/downloads/{userId}

Per-user download tracking. Used for review eligibility. Server-side only.

FieldTypeDescription
uidstringUser's UID
downloadedAttimestampServer timestamp

orders/{orderId}

Purchase records. Created exclusively by the Stripe webhook — never from client-side code. Document ID is the Stripe session ID (ensures idempotency).

Party fields

FieldTypeRequiredDescription
buyerUidstringyesBuyer's Firebase UID
sellerUidstringyesSeller's Firebase UID

Product snapshot (denormalized at purchase time)

FieldTypeRequiredDescription
productIdstringyesProduct document ID
productTitlestringyesProduct name at time of purchase
productCategorystringyesProduct category at time of purchase

Financial fields (all in cents USD)

FieldTypeRequiredDescription
amountnumberyesTotal charged
platformFeenumberyesPlatform cut
sellerAmountnumberyesSeller receives
currencystringyesCurrency code (default "usd")

Stripe references

FieldTypeRequiredDescription
stripeSessionIdstringyesCheckout session ID
stripePaymentIntentIdstringnoPayment intent ID

Status fields

FieldTypeRequiredDescription
statusstringyesOne of: completed, refunded, disputed
refundedAttimestampnoWhen refund was processed

Timestamps

FieldTypeRequiredDescription
createdAttimestampyesServer timestamp
updatedAttimestampyesServer timestamp

Security rules

OperationRule
ReadbuyerUid == auth.uid OR sellerUid == auth.uid
CreateNever from client (webhook transaction only)
UpdateNever from client (webhook transaction only)
DeleteNever

conversations/{conversationId}

Buyer-seller messaging threads. Document ID format: {productId}_{buyerUid}.

FieldTypeRequiredDefaultDescription
productIdstringyes—Related product
productTitlestringyes—Product name
productSlugstringyes—Product slug for linking
buyerUidstringyes—Buyer's UID
buyerUsernamestringyes—Buyer's username
buyerDisplayNamestringyes—Buyer's display name
buyerAvatarstringno—Buyer's avatar URL
sellerUidstringyes—Seller's UID
sellerUsernamestringyes—Seller's username
sellerDisplayNamestringyes—Seller's display name
sellerAvatarstringno—Seller's avatar URL
participantsarray<string>yes—[buyerUid, sellerUid] for array-contains queries
lastMessagestringno—Preview text (max 100 chars)
lastMessageAttimestampyes—Timestamp of most recent message
lastMessageSenderUidstringno—UID of last message sender
unreadBySellernumber—0Unread count for seller
unreadByBuyernumber—0Unread count for buyer
createdAttimestampyes—Server timestamp

Security rules

OperationRule
Readauth.uid in participants array
CreateServer-side only
UpdateServer-side only
DeleteNever

conversations/{conversationId}/messages/{messageId}

Individual messages within a conversation.

FieldTypeRequiredDescription
senderUidstringyesSender's UID
senderUsernamestringyesSender's username
senderDisplayNamestringyesSender's display name
senderAvatarstringnoSender's avatar URL
textstringyesMessage body (max 1,000 chars)
createdAttimestampyesServer timestamp

usernames/{username}

Atomic username uniqueness registry. Document ID is the lowercase username string. Admin SDK only — no client reads or writes.

FieldTypeRequiredDescription
uidstringyesUID of the username owner
claimedAttimestampyesServer timestamp

Security rules

All operations: Admin SDK only. Client reads and writes are denied.

reports/{reportId}

Content reports for moderation. Auto-generated document ID.

FieldTypeRequiredDefaultDescription
reporterUidstringyes—UID of reporter
targetTypestringyes—One of: product, review, user
targetIdstringyes—ID of reported entity
reasonstringyes—One of: malicious_content, spam, inappropriate, copyright, other
descriptionstringno—Details (max 1,000 chars)
statusstringyes"pending"One of: pending, resolved, dismissed
resolvedBystringno—Admin UID who resolved
resolvedAttimestampno—Resolution timestamp
createdAttimestampyes—Server timestamp

Security rules

OperationRule
ReadAdmin only (Admin SDK)
CreateAuthenticated + reporterUid == auth.uid
UpdateAdmin only (Admin SDK)
DeleteNever

xp_logs/{logId}

XP award deduplication. Document ID format: {uid}_{action}_{dedupKey}. Prevents double-awarding XP for the same action.

FieldTypeRequiredDescription
actionstringyesXP action type
amountnumberyesXP awarded
uidstringyesUser UID
createdAttimestampyesWhen XP was awarded

Security rules

OperationRule
ReadOwner only (logId prefix matches auth.uid)
CreateOwner only (logId prefix matches auth.uid)
UpdateNever
DeleteNever

audit_logs/{logId}

Security-relevant action log. Admin SDK only, fire-and-forget. Auto-generated document ID.

FieldTypeRequiredDescription
actionstringyesAction performed
uidstringyesUID of actor
detailsmapnoAdditional context
timestamptimestampyesServer timestamp

Security rules

All operations: Admin SDK only. No client access.

rate_limits/{limitId}

Firestore-backed rate limiting for serverless API routes. Document ID format: {ip}__{path}. Admin SDK only.

FieldTypeRequiredDescription
countnumberyesRequest count in current window
resetAtnumberyesUnix timestamp (ms) when window resets
ipstringyesClient IP address
pathstringyesAPI route path

Security rules

All operations: Admin SDK only. No client access.

Composite indexes

products

FieldsPurpose
status ASC, createdAt DESCExplore page — newest first
status ASC, stats.likes DESCExplore page — most liked
status ASC, stats.downloads DESCExplore page — most downloaded
status ASC, stats.rating DESCExplore page — highest rated
status ASC, category ASC, createdAt DESCCategory filter — newest
status ASC, category ASC, stats.likes DESCCategory filter — most liked
status ASC, category ASC, stats.downloads DESCCategory filter — most downloaded
authorUid ASC, createdAt DESCAuthor dashboard
authorUsername ASC, status ASC, createdAt DESCPublic profile page
authorUid ASC, status ASC, createdAt DESCAuthor page (UID variant)

orders

FieldsPurpose
sellerUid ASC, createdAt DESCSeller sales dashboard
buyerUid ASC, createdAt DESCBuyer purchase history
productId ASC, buyerUid ASC, status ASCPurchase verification (download auth)
buyerUid ASC, status ASC, createdAt DESCFiltered purchase history

conversations

FieldsPurpose
participants ARRAY_CONTAINS, lastMessageAt DESCUser's conversation list
productId ASC, sellerUid ASC, lastMessageAt DESCProduct-specific threads

reports

FieldsPurpose
status ASC, createdAt DESCAdmin moderation queue
reporterUid ASC, targetType ASC, targetId ASCDuplicate report check
reporterUid ASC, createdAt ASCReporter history

Storage

Product files and user assets are stored across two systems:

SystemContentAccess
Cloudflare R2Product files (products/{key}/{fileName})Presigned URLs only (5-30 min expiry)
Firebase StorageAvatars (users/{uid}/**), thumbnails (products/{id}/thumbnails/)Public read for images
Firebase Storage (legacy)Old product files (products/{id}/files/)allow read: if false (signed URLs only)

Max file size: 50MB for product files, 5MB for images. Images restricted to image/* content type.

Data flow diagrams

Purchase flow

Buyer clicks "Buy"
  → POST /api/stripe/checkout (Bearer token)
  → Server verifies auth token
  → Server creates Stripe Checkout Session
  → Buyer redirected to Stripe payment page
  → Buyer completes payment
  → Stripe fires webhook
  → POST /api/stripe/webhooks
  → Server creates order document (Firestore transaction)
  → Server increments product stats.purchaseCount
  → Server increments seller stats.totalSales + totalRevenue
  → Server increments buyer stats.productsBought
  → Buyer returns to product page
  → Client checks order exists for user+product
  → Download button becomes available

Download flow

User clicks "Download"
  → POST /api/products/download (Bearer token)
  → Server verifies auth token
  → If paid: server checks order exists (buyerUid + productId)
  → If free: server allows
  → Server generates presigned R2 URL (5 min expiry)
  → Server records download in products/{id}/downloads/{uid}
  → Server increments product stats.downloads
  → Server increments author stats.downloads
  → Returns signed URL
  → Client opens URL in new tab

Publish flow

Creator submits product form
  → Client uploads file to R2 via presigned upload URL
  → Client uploads thumbnail to Firebase Storage
  → Client creates product document (status: "pending_review")
  → Firestore rules enforce status == "pending_review"
  → Admin reviews product (Admin SDK)
  → Admin sets status to "published"
  → Product appears in explore page

Review flow

User clicks "Write Review"
  → POST /api/products/reviews (Bearer token)
  → Server verifies auth token
  → Server checks download record exists (review eligibility)
  → Server creates review in products/{id}/reviews/{reviewId}
  → Server recalculates product stats.rating + stats.reviewsCount
  → Server increments author stats.reviewsReceived
  → Server recalculates author stats.avgRating

Safe types

Two safe types strip sensitive fields before passing data to client components:

TypeOmitsPurpose
SafeProductfileUrlPrevents client from accessing paid product files directly
SafeUserProfileemail, stripeAccountId, stats.totalSales, stats.totalRevenueProtects PII and financial data

Server components fetch full documents, strip fields, then pass SafeProduct or SafeUserProfile to client islands.

Design System Reference

Complete reference for MyClaude's design system: color tokens, typography scale, surfaces, glow shadows, motion, z-index, spacing, component inventory, and the token-only enforcement policy.

Admin Panel

Reference for the MyClaude admin panel: role-based access, report management, product quarantine, user moderation, API routes, and audit logging.

On this page

Overviewusers/{uid}Core fieldsRole and trust fieldsStripe Connect fieldsGamification fieldsstats (map)TimestampsSecurity rulesusers/{uid}/following/{targetUid}users/{uid}/followers/{followerUid}users/{uid}/achievements/{achievementId}users/{uid}/notifications/{notificationId}products/{productId}Identity fieldsClassification fieldsPricing fieldsFile fieldsAuthor fields (denormalized)Status and moderation fieldsVersion and license fieldsEnrichment fields (CONDUIT pipeline)stats (map)TimestampsSecurity rulesproducts/{productId}/likes/{userId}products/{productId}/versions/{versionId}products/{productId}/reviews/{reviewId}products/{productId}/downloads/{userId}orders/{orderId}Party fieldsProduct snapshot (denormalized at purchase time)Financial fields (all in cents USD)Stripe referencesStatus fieldsTimestampsSecurity rulesconversations/{conversationId}Security rulesconversations/{conversationId}/messages/{messageId}usernames/{username}Security rulesreports/{reportId}Security rulesxp_logs/{logId}Security rulesaudit_logs/{logId}Security rulesrate_limits/{limitId}Security rulesComposite indexesproductsordersconversationsreportsStorageData flow diagramsPurchase flowDownload flowPublish flowReview flowSafe types