docs: add project documentation, memory, and setup guides

This commit is contained in:
2025-12-24 17:47:53 -07:00
parent 237f57cf36
commit ca0ba1dc94
5 changed files with 204 additions and 0 deletions

25
MEMORY.md Normal file
View File

@ -0,0 +1,25 @@
# Project Memory
## Project Context
This project (`product_inventory`) integrates Google Sheets with Shopify. It serves as a master inventory management tool where users edit product data in a Google Sheet, and scripts automatically sync those changes to Shopify.
**Critical Components:**
- **Google Apps Script**: Runs the logic.
- **"vars" Sheet**: Holds all configuration and API keys. NEVER hardcode credentials.
- **Shopify Admin API**: Used for syncing. REST for Orders, GraphQL for Products.
## Work Patterns & Agreements
1. **Documentation First**: Before implementing complex features, we update the plan and often the documentation (README/ARCHITECTURE).
2. **Safety First**: We use `SafeToAutoRun: false` for commands that deploy or modify external state until verified.
3. **Strict Typing**: We use TypeScript. No `any` unless absolutely necessary (and even then, we try to avoid it).
4. **Artifact Usage**: We use `task.md`, `implementation_plan.md`, and `walkthrough.md` to track state.
## Key Technical Decisions
- **Queue System**: We implemented `onEditQueue.ts` to batch edits. This prevents hitting Shopify API rate limits and Google Apps Script execution limits during rapid manual edits.
- **Hybrid API**: We use REST for retrieving Orders (legacy/easier for flat data) and GraphQL for Products (more efficient/flexible).
- **Global Exports**: Functions in `src/global.ts` are explicitly exposed to be callable by Apps Script triggers.
## User Preferences
- **OS**: Windows.
- **Shell**: PowerShell.
- **Node Manager**: `fnm`.