firestore-patterns

Standardize Firestore data access with read, write, and query patterns.

Updated Sep 9, 2025
One-click install
npx skills add https://github.com/LennyDevX/nuxchain-app --skill firestore-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firestore-patterns
Source: https://github.com/LennyDevX/nuxchain-app/tree/main/.windsurf/skills/firestore-patterns
Command: npx skills add https://github.com/LennyDevX/nuxchain-app --skill firestore-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Work with Firestore in NuxChain. Use when user says "Firestore", "database", "save user data", "read from DB", "collection", "document", "Firebase", "airdrop data", "user profile", "analytics", or any data persistence task.

Core Features & Use Cases

  • Read Pattern: Provide examples for reading documents from Firestore, including checking existence and returning data.
  • Write Pattern: Provide examples for writing documents with merge semantics and serverTimestamp.
  • Query Pattern: Provide examples for querying collections such as airdrop registrations with filters and limits.
  • Use Case: Managing user profiles and analytics events in collections like users/{walletAddress}, airdrop/registrations/{address}, analytics/events/{eventId}.

Quick Start

Apply the read and write Firestore patterns to manage user profiles in the users collection.

Frequently Asked Questions about firestore-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Firestore read and write operations for user profiles?

Structure Firestore read and write operations for user profiles using standardized patterns across the users/{walletAddress} collection. These patterns utilize Firestore SDK methods with address normalization and merge behavior to ensure data consistency when accessing user profile documents.

What is the best way to query airdrop registration data in Firestore?

Query airdrop registration data in Firestore by applying specific query patterns to the airdrop/registrations/{address} collection. These patterns provide concrete examples for filtering registrations and applying limits using standard Firestore SDK methods to retrieve targeted airdrop entries.

How does merge behavior and serverTimestamp ensure Firestore data consistency?

Merge behavior and serverTimestamp ensure Firestore data consistency by preventing overwrite conflicts during write operations. Using merge semantics updates specific document fields without replacing the entire document, while serverTimestamp securely records the server's time for analytics events.

Can I use these Firestore patterns for analytics event tracking?

You can use these Firestore patterns for analytics event tracking within the analytics/events/{eventId} collection. The patterns standardize data access pipelines, ensuring consistent writes and reads for analytics events across your NuxChain application using the Firestore SDK.

Do I need to normalize wallet addresses before writing to Firestore?

You need to normalize wallet addresses before writing to Firestore to maintain reliable data consistency. The provided write patterns explicitly incorporate address normalization for documents stored in the users/{walletAddress} and airdrop/registrations/{address} collections.

When should I check document existence in a Firestore read pattern?

Check document existence in a Firestore read pattern when retrieving user profiles or registration data to prevent null reference errors. The read patterns demonstrate checking document existence prior to returning data from collections like users/{walletAddress}.