Skip to content

RBS Ecosystem Architecture ​

Complete System Overview ​

Last Updated: January 21, 2026 Company: Red Broom Software S.A.S (RFC: RBS2201168S7) Vision: Integrated SaaS ecosystem for Mexican SMBs with wallet, payments, accounting, and industry-specific POS systems


🎯 Core Philosophy ​

Separation of Concerns - Each component has a specific purpose:

  1. Colectiva - Central wallet and financial management (NOT a POS)
  2. Constanza - Accounting, tax compliance, and AI fiscal optimization
  3. Banxico Microservice - Payment processing infrastructure (CoDi/SPEI)
  4. Industry POS Apps - Vertical-specific point of sale systems

No Code Duplication - Shared functionality is centralized:

  • Payment processing β†’ Banxico Microservice
  • Wallet management β†’ Colectiva
  • Accounting/tax β†’ Constanza
  • Industry logic β†’ Individual POS apps

πŸ—οΈ System Architecture ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          RED BROOM SOFTWARE S.A.S. (Holding)            β”‚
β”‚          RFC: RBS2201168S7 - RESICO Regime              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚                      β”‚              β”‚
         β–Ό                      β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   COLECTIVA     β”‚    β”‚   CONSTANZA  β”‚    β”‚   BANXICO    β”‚
β”‚   (Wallet)      β”‚    β”‚  (Accounting)β”‚    β”‚ (Payments)   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Balance mgmt  │◄──── β€’ Tax AI     │◄──── β€’ CoDi/SPEI  β”‚
β”‚ β€’ Settlements   β”‚    β”‚ β€’ CFDI 4.0   β”‚    β”‚ β€’ QR codes   β”‚
β”‚ β€’ Payroll       β”‚    β”‚ β€’ Reports    β”‚    β”‚ β€’ Transfers  β”‚
β”‚ β€’ Multi-currencyβ”‚    β”‚ β€’ Compliance β”‚    β”‚ β€’ Balance    β”‚
β”‚ β€’ Crypto        β”‚    β”‚ β€’ NΓ³mina     β”‚    β”‚ β€’ Webhooks   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                    β”‚                    β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                          β–Ό             β–Ό             β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ CARACOL  β”‚            β”‚ LA HOJA  β”‚   β”‚  COSMOS  β”‚   β”‚ PLENURA  β”‚
   β”‚Restaurantβ”‚            β”‚   CafΓ©   β”‚   β”‚   Pet    β”‚   β”‚ Therapy  β”‚
   β”‚   POS    β”‚            β”‚   POS    β”‚   β”‚   POS    β”‚   β”‚   App    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Component Details ​

1. COLECTIVA - Central Wallet & Financial Hub ​

Location: ~/Projects/colectiva-RBSTech: SvelteKit 5, Firebase, Vercel Purpose: Unified financial management platform

Core Responsibilities:

  • βœ… Consolidated wallet across all businesses
  • βœ… Real-time balance tracking (MXN, USD, EUR, CNY, BTC, ETH)
  • βœ… Internal settlements (0% fee between group companies)
  • βœ… External transactions (0.8% fee)
  • βœ… Payroll automation and employee benefits
  • βœ… Multi-currency portfolio management
  • βœ… DeFi yield tracking
  • βœ… Equity token system (internal company shares)
  • βœ… Planning and organization tools

What It Is NOT:

  • ❌ NOT a POS system
  • ❌ NOT for direct customer sales
  • ❌ NOT a payment gateway (uses Banxico for that)

Integration Points:

  • Calls Banxico Microservice for payment processing
  • Receives accounting data from Constanza
  • Provides balance data to all POS apps
  • Manages payroll for all companies

URL: TBD (in development)


2. CONSTANZA - AI Accounting & Tax Compliance ​

Location: ~/Projects/ConstanzaTech: SvelteKit 4, Firebase, Vercel Purpose: Automated accounting and fiscal optimization

Core Responsibilities:

  • βœ… Multi-tenant accounting system
  • βœ… CFDI 4.0 invoice generation and timbrado
  • βœ… Fiscal Optimizer AI (RESICO monitoring)
  • βœ… Automatic transaction classification (AI)
  • βœ… SAT chart of accounts
  • βœ… Accounting entries (PΓ³lizas)
  • βœ… Consolidated reports for holdings
  • βœ… Tax reports (Balance, P&L, DIOT)
  • βœ… Employee benefits calculator
  • βœ… RESICO limit monitoring with alerts
  • βœ… e.Firma/FIEL Certificate Management - Upload, validate, and securely store digital certificates
  • βœ… Fiscal Calendar & Automatic Reminders - Track obligations with proactive alerts
  • βœ… CFDI Automatic Download - Download invoices directly from SAT
  • βœ… Organization Lifecycle Management - Deactivation, deletion, member management
  • βœ… Organization Settings - Team members, roles, and organization configuration

Revenue Model:

TierMonthlyAnnualTarget
RESICO$8,900$106,800Small businesses
General$15,000$180,000Medium businesses
Enterprise$30,000$360,000Holdings

Integration Points:

  • Receives transaction data from Colectiva and POS apps
  • Generates fiscal reports for all companies
  • Feeds tax data to Colectiva for decision-making
  • Provides compliance alerts

URL: https://constanza-oyc4b548x-rbss-projects-204990eb.vercel.app


3. BANXICO MICROSERVICE - Payment Infrastructure ​

Location: ~/Projects/Banxico_payment_microserviceTech: Node.js, TypeScript, Express, PostgreSQL/SQLite Purpose: Payment processing backend (CoDi, SPEI)

Core Responsibilities:

  • βœ… Generate CoDi QR codes (Banxico integration)
  • βœ… Process SPEI bank transfers
  • βœ… Manage internal coin currency (MXC)
  • βœ… User balance tracking
  • βœ… Transaction history
  • βœ… Payment status polling (auto-detect payments)
  • βœ… Webhook support for real-time notifications

Coin System (MXC):

  • 1 MXN = 1 MXC (1:1 exchange rate)
  • Users deposit MXN β†’ Get MXC coins
  • Transfer MXC between users (instant, free)
  • Withdraw MXC β†’ Get MXN in bank account

Deployment:

API Endpoints:

POST   /api/v1/coins/purchase         - Generate QR code
GET    /api/v1/coins/balance/:userId  - Check balance
POST   /api/v1/transfers/user-to-user - Transfer coins
POST   /api/v1/transfers/withdraw     - Withdraw to bank
GET    /api/v1/coins/purchase/status  - Check payment status

Integration Points:

  • Called by Colectiva for all payment operations
  • Can be called directly by POS apps (if needed)
  • Integrates with Banxico CoDi API (Beta environment)

4. CARACOL - Restaurant POS ​

Location: ~/Projects/caracolTech: SvelteKit, Firebase, Vercel Purpose: Point of sale system for restaurants

Features:

  • βœ… Table management
  • βœ… Order taking
  • βœ… Kitchen integration
  • βœ… Inventory tracking
  • βœ… Menu management
  • βœ… Sales reports
  • βœ… CFDI invoice generation (ecosystem stamping via Constanza)
  • βœ… Multiple payment methods
  • βœ… Automatic stamp retry with exponential backoff
  • βœ… Failed stamp queue with QStash scheduler
  • βœ… SAT Cancellation Status Query - Query SAT to check actual cancellation status
  • βœ… Bulk Invoicing - Non-blocking bulk invoice generation with loading states
  • βœ… Picking List Print - Print picking lists for kitchen orders
  • βœ… Cash Register Session Validation - Mexico City timezone-aware session management

Revenue: $7,000/month licensing Status: βœ… Production (main branch)

Integration:

  • Sends sales data to Constanza for accounting
  • Uses Colectiva for payment processing (via Banxico)
  • Generates invoices via ecosystem stamping (Camino allocation β†’ Constanza PAC)
  • QStash scheduler for failed stamp retries (every 5 minutes)

Reliability Features (Added January 2026):

  • Retry handler with 30s timeout and 3 immediate attempts
  • Failed stamp queue in Firestore with exponential backoff (5min β†’ 15min β†’ 45min β†’ 2h β†’ 6h)
  • Stamp allocation reversal when Constanza fails after Camino succeeds
  • Proper handling of PAC success code 0 (accepted, not error)
  • SAT status query to auto-update invoice status when cancellation completes
  • See: caracol/QSTASH_SETUP.md for scheduler documentation

5. LA HOJA - CafΓ© POS ​

Location: ~/Projects/la-hojaTech: Flutter, Firebase Purpose: Point of sale optimized for coffee shops

Features:

  • βœ… Quick sale interface
  • βœ… Inventory (beans, milk, supplies)
  • βœ… Loyalty programs
  • βœ… Prepaid cards
  • βœ… Sales reports

Status: 🚧 In development Base: Same codebase as Caracol, optimized for cafés

Integration:

  • Same pattern as Caracol
  • Shares accounting/payment infrastructure

6. COSMOS PET - Veterinary POS ​

Location: ~/Projects/Cosmos-petTech: Flutter, Firebase Purpose: Point of sale for veterinary clinics

Features:

  • βœ… Patient records
  • βœ… Appointment scheduling
  • βœ… Inventory (medications, supplies)
  • βœ… Service billing
  • βœ… Medical history

Status: 🚧 In development

Integration:

  • Same pattern as other POS apps
  • Specialized for veterinary workflows

7. CAMINO CRM - Marketing & Communications Hub ​

Location: ~/Projects/camino/crmTech: SvelteKit 5, Supabase, Vercel Purpose: CRM, marketing automation, and ecosystem communications

Core Responsibilities:

  • βœ… OAuth2 SSO Provider for entire ecosystem
  • βœ… Email automation (Resend integration)
  • βœ… WhatsApp Business API integration
  • βœ… Voice AI outbound calls
  • βœ… Lead management and nurturing
  • βœ… Social media campaign management
  • βœ… Landing page builder
  • βœ… Team collaboration with approval workflows
  • βœ… Subscription management across ecosystem apps
  • βœ… Developer session handling for cross-app access

Key APIs:

  • POST /api/internal/email - Send templated emails
  • POST /api/internal/whatsapp - Send WhatsApp messages
  • POST /api/ecosystem/voice/onboard - Enable Voice AI
  • GET/POST /oauth/* - OAuth2 SSO endpoints

Integration Points:

  • All ecosystem apps use Camino for notifications
  • Provides SSO for Constanza, Caracol, La Hoja, Cosmos Pet, Colectiva
  • Manages subscription billing across all apps
  • Tracks stamp allocations for ecosystem invoicing

Status: βœ… Production URL: https://camino-crm.vercel.app


8. PLENURA - Therapy Booking Platform ​

Location: ~/Projects/plenuraTech: Go backend, Flutter frontend, Firebase Purpose: Marketplace for therapy services

Features:

  • βœ… Therapist profiles
  • βœ… Service booking
  • βœ… Availability management
  • βœ… Client reviews
  • βœ… Payment processing (integrated with Banxico)

Status: βœ… Backend complete, frontend in development

Integration:

  • Uses Banxico Microservice for payments
  • Coin-based system (MXC) for therapist payments
  • Clients deposit β†’ Pay therapists β†’ Therapists withdraw

Payment Flow:

Client deposits 500 MXN β†’ Gets 500 MXC
Client books therapy (200 MXN) β†’ Transfers 200 MXC to therapist
Therapist withdraws 200 MXC β†’ Gets 200 MXN in bank

πŸ”„ Data Flow & Integration Patterns ​

Payment Flow (Standardized) ​

Any App (POS/Plenura)
    ↓
Colectiva Wallet
    ↓
Banxico Microservice
    ↓
Banxico CoDi API β†’ User's Bank

Accounting Flow ​

Transaction (POS/Wallet)
    ↓
Constanza (Classification)
    ↓
Accounting Entry (PΓ³liza)
    ↓
Financial Reports

Settlement Flow (Internal Transfers) ​

Source Company (via Colectiva)
    ↓
Colectiva Wallet (0% fee)
    ↓
Destination Company

🎨 Design Principles ​

1. Single Source of Truth ​

  • Payments: Banxico Microservice only
  • Wallet: Colectiva only
  • Accounting: Constanza only
  • Industry Logic: Individual POS apps

2. API-First Architecture ​

  • All components expose REST APIs
  • Authentication via Firebase
  • Standardized error handling
  • Comprehensive documentation

3. Multi-Tenancy ​

  • Each business is a separate tenant
  • Shared infrastructure
  • Isolated data
  • Centralized billing

4. Fiscal Compliance ​

  • All transactions recorded
  • CFDI 4.0 compliant
  • SAT catalog integration
  • Automatic tax calculations

⏰ Scheduled Jobs Architecture ​

The ecosystem uses two cron systems based on database technology:

Camino pg_cron (Supabase) ​

For ecosystem-wide and Supabase-based jobs:

CategoryJobsExamples
Ecosystem-wide3calculate_billing, expire_trials, reset_usage_counters
Cross-app1sync_constanza_invoices
Camino-internal7invoice_retry, nurture_emails, voice-outbound

App QStash (Upstash) ​

For Firebase-based app-internal jobs:

AppJobsExamples
La Hoja3mancha-retry, reset-allocations, cleanup-dead-letter
Caracol1stamp-retry (failed invoice stamp retries)

Decision Criteria ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Is the job ecosystem-wide or cross-app?            β”‚
β”‚   YES β†’ Use Camino pg_cron                          β”‚
β”‚   NO  ↓                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Does the app use Supabase?                          β”‚
β”‚   YES β†’ Use Camino pg_cron (convenience)            β”‚
β”‚   NO  ↓                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ App uses Firebase β†’ Use App's own QStash            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

See: /home/brillo/Projects/CRON_ARCHITECTURE_ANALYSIS.md for detailed analysis.


πŸ” Security & Access Control ​

Authentication ​

  • Firebase Authentication (all apps)
  • JWT tokens for API calls
  • Role-based access control (RBAC)

Data Isolation ​

  • Firestore security rules
  • Organization-level isolation
  • User permission layers

Payment Security ​

  • PCI DSS considerations
  • Encrypted credentials
  • Secure API keys
  • Webhook signatures

Scheduled Job Security ​

  • QStash signature verification for external schedulers
  • pg_cron runs within Supabase (trusted environment)
  • API keys stored in environment variables (never in code)

πŸ’° Revenue Model ​

RBS Income Streams ​

  1. Constanza Memberships: $8,900 - $30,000/month
  2. POS Licensing: $7,000+/month
  3. Transaction Fees: 0.8% on external payments
  4. Additional Services: Consulting, training, custom features

Cost Structure ​

  • Hosting: ~$200/month (Firebase, Vercel, Oracle Cloud)
  • Banxico API: Minimal (beta testing)
  • Development: Internal
  • PAC (CFDI): Per invoice usage

πŸ“Š Current Status Dashboard ​

ComponentStatusURLRevenue
Colectiva🚧 DevelopmentTBDPlanned
Constanzaβœ… ProductionLive$0 (launching Dec)
Banxico Serviceβœ… Productionhttp://40.233.27.208:3000N/A (infrastructure)
Caracolβœ… ProductionPrivate$7,000/month
La Hoja🚧 DevelopmentTBDPlanned
Cosmos Pet🚧 DevelopmentTBDPlanned
Plenura🟑 Backend ReadyBackend livePlanned

Total Current Revenue: ~$384,000/year RESICO Limit: $3,500,000/year Utilization: 10.97% Available Growth: $3,116,000


πŸš€ Development Workflow ​

Adding New Features ​

  1. Identify which component owns the feature
  2. Check if functionality exists elsewhere (avoid duplication)
  3. Use existing services (Banxico, Constanza, Colectiva)
  4. Document integration points

Creating New POS App ​

  1. Clone base POS structure (Caracol)
  2. Customize industry-specific features
  3. Integrate with Colectiva for payments
  4. Send transactions to Constanza for accounting
  5. Follow multi-tenant pattern

Testing Integration ​

  1. Test each component independently
  2. Test integration points
  3. End-to-end flow testing
  4. Production deployment

πŸ“ Directory Structure ​

~/Projects/
β”œβ”€β”€ ECOSYSTEM_ARCHITECTURE.md     ← THIS FILE
β”œβ”€β”€ MASTER_ROADMAP.md              ← Product roadmap
β”œβ”€β”€ CONTEXTO_COMPLETO_ECOSISTEMA_RBS.md  ← Detailed context
β”‚
β”œβ”€β”€ colectiva-RBS/                 ← Wallet & Financial Hub
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Colectiva fits in ecosystem
β”‚   └── [app code]
β”‚
β”œβ”€β”€ Constanza/                     ← Accounting & Tax
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Constanza fits in ecosystem
β”‚   └── [app code]
β”‚
β”œβ”€β”€ Banxico_payment_microservice/  ← Payment Infrastructure
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Banxico fits in ecosystem
β”‚   └── [microservice code]
β”‚
β”œβ”€β”€ caracol/                       ← Restaurant POS
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Caracol fits in ecosystem
β”‚   └── [app code]
β”‚
β”œβ”€β”€ la-hoja/                       ← CafΓ© POS
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How La Hoja fits in ecosystem
β”‚   └── [app code]
β”‚
β”œβ”€β”€ Cosmos-pet/                    ← Veterinary POS
β”‚   β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Cosmos fits in ecosystem
β”‚   └── [app code]
β”‚
└── plenura/                       ← Therapy Platform
    β”œβ”€β”€ ECOSYSTEM_CONTEXT.md       ← How Plenura fits in ecosystem
    └── [app code]

πŸ“ Documentation Standards ​

Each project MUST have:

  1. ECOSYSTEM_CONTEXT.md - How it fits in the larger system
  2. README.md - Project-specific documentation
  3. API documentation - If it exposes APIs
  4. Integration guides - How to connect with other components

🎯 Next Steps ​

Immediate Priorities ​

  1. βœ… Complete Banxico-Plenura integration
  2. 🚧 Finish Colectiva wallet core features
  3. 🚧 Deploy Constanza for first client (December)
  4. πŸ“‹ La Hoja MVP completion

Q1 2026 ​

  • Launch Constanza memberships
  • Onboard 5-10 RESICO clients
  • Complete Plenura frontend
  • Launch La Hoja

Q2 2026 ​

  • Cosmos Pet beta
  • Expand Caracol features
  • International payment support
  • Crypto portfolio in Colectiva

🀝 Contributing ​

When working on any component:

  1. Read this document first
  2. Read the component's ECOSYSTEM_CONTEXT.md
  3. Understand dependencies on other services
  4. Follow integration patterns
  5. Document changes
  6. Test integrations

πŸ“ž Support ​


Remember: We're building a cohesive ecosystem, not isolated apps. Every component serves a specific purpose and integrates with the whole.

Red Broom Software Ecosystem