@plantagoai Shared Packages
The @plantagoai namespace contains reusable packages shared across all PlantagoAI projects (Foundation, MarketHub, Soho, HerbPulse, Nomadex). Packages are consumed via local file links — no npm publishing required.
Package Map
| Package | Description | Wave | Status |
|---|---|---|---|
@plantagoai/firebase-core |
Firebase init, Firestore helpers, tenant-scoped queries | 1 | Complete |
@plantagoai/auth |
Ring-based auth, roles, multi-tenant middleware | 1 | Complete |
@plantagoai/payments |
Braintree, Apple Pay, Google Pay, subscriptions | 1 | Complete |
@plantagoai/ai |
Claude + Gemini wrappers with prompt caching | 1 | Complete |
@plantagoai/messaging |
Email (Resend), push (FCM), in-app notifications | 1 | Complete |
@plantagoai/db |
Schema validation, integrity, auto-fix, rules gen | 2 | Complete |
@plantagoai/i18n |
UI translations + AI content translation | 2 | Complete |
@plantagoai/legal |
Privacy/ToS generator + acceptance tracking | 2 | Complete |
@plantagoai/flows |
XState state machines + Firestore persistence | 2 | Complete |
@plantagoai/seeders |
Schema-driven data seeding from JSON/CSV/API | 2 | Complete |
Consumer Projects
| Project | Packages Used |
|---|---|
| Foundation | firebase-core, auth, payments, ai, messaging, db, flows |
| MarketHub | firebase-core, auth, payments, ai, messaging, i18n, flows, seeders |
| Soho | firebase-core, auth, ai |
| HerbPulse | firebase-core, auth, i18n, seeders |
| Nomadex | seeders (planned) |
Installation
Projects consume packages via local workspace links:
{
"dependencies": {
"@plantagoai/firebase-core": "file:../../shared/packages/firebase-core",
"@plantagoai/auth": "file:../../shared/packages/auth"
}
}
Firebase Cloud Functions use a different relative path:
{
"dependencies": {
"@plantagoai/auth": "file:../../../shared/packages/auth"
}
}
Workspace Layout
/Users/dagan/dev/shared/
packages/
firebase-core/ # Firebase init, env detection, CRUD, tenant queries
auth/ # Ring-based permissions, multi-tenant auth
payments/ # Braintree gateway, subscriptions, mobile pay
ai/ # Claude + Gemini with caching and cost tracking
messaging/ # Email, push, in-app notifications
db/ # Schema validation, fixes, export, rules gen
i18n/ # UI translations + AI content translation
legal/ # Privacy/ToS generation + consent tracking
flows/ # XState factory + persistence + presets
seeders/ # Data seeding from multiple sources
package.json # npm workspaces root
tsconfig.base.json # shared TypeScript config
Design Principles
All packages follow these requirements:
- Security: Auth isolation, tenant boundaries, input validation at system edges
- Privacy: Zero PII storage where possible, encrypted at rest
- Compliance: GDPR-compatible, audit trails
- Scale: Firestore-native patterns (no single-document bottlenecks)
- Cost efficiency: Prompt caching for AI, batch operations for Firestore
- Consistency: Typed interfaces, shared error handling
- Maintainability: Single source of truth per concern
- Resiliency: Graceful degradation, retry with backoff
Common Technical Stack
- Firebase: Auth, Firestore, RTDB, Cloud Functions (Node 22), Hosting, Storage
- Frontend: React + TypeScript + Vite (majority), Vue (Nomadex only)
- Backend: Firebase Cloud Functions (all); Anchor on-chain program for Foundation
- AI: Anthropic Claude API, Google Gemini
- Payments: Braintree (server-side), Apple Pay, Google Pay
- Messaging: Resend (transactional email), Firebase Cloud Messaging
- Blockchain: Solana (Anchor smart contracts, Foundation only)