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:
- Colectiva - Central wallet and financial management (NOT a POS)
- Constanza - Accounting, tax compliance, and AI fiscal optimization
- Banxico Microservice - Payment processing infrastructure (CoDi/SPEI)
- 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:
| Tier | Monthly | Annual | Target |
|---|---|---|---|
| RESICO | $8,900 | $106,800 | Small businesses |
| General | $15,000 | $180,000 | Medium businesses |
| Enterprise | $30,000 | $360,000 | Holdings |
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:
- URL: http://40.233.27.208:3000
- Status: β LIVE on Oracle Cloud
- Database: PostgreSQL (or SQLite for testing)
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 statusIntegration 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.mdfor 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 emailsPOST /api/internal/whatsapp- Send WhatsApp messagesPOST /api/ecosystem/voice/onboard- Enable Voice AIGET/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 BankAccounting Flow β
Transaction (POS/Wallet)
β
Constanza (Classification)
β
Accounting Entry (PΓ³liza)
β
Financial ReportsSettlement 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:
| Category | Jobs | Examples |
|---|---|---|
| Ecosystem-wide | 3 | calculate_billing, expire_trials, reset_usage_counters |
| Cross-app | 1 | sync_constanza_invoices |
| Camino-internal | 7 | invoice_retry, nurture_emails, voice-outbound |
App QStash (Upstash) β
For Firebase-based app-internal jobs:
| App | Jobs | Examples |
|---|---|---|
| La Hoja | 3 | mancha-retry, reset-allocations, cleanup-dead-letter |
| Caracol | 1 | stamp-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 β
- Constanza Memberships: $8,900 - $30,000/month
- POS Licensing: $7,000+/month
- Transaction Fees: 0.8% on external payments
- 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 β
| Component | Status | URL | Revenue |
|---|---|---|---|
| Colectiva | π§ Development | TBD | Planned |
| Constanza | β Production | Live | $0 (launching Dec) |
| Banxico Service | β Production | http://40.233.27.208:3000 | N/A (infrastructure) |
| Caracol | β Production | Private | $7,000/month |
| La Hoja | π§ Development | TBD | Planned |
| Cosmos Pet | π§ Development | TBD | Planned |
| Plenura | π‘ Backend Ready | Backend live | Planned |
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 β
- Identify which component owns the feature
- Check if functionality exists elsewhere (avoid duplication)
- Use existing services (Banxico, Constanza, Colectiva)
- Document integration points
Creating New POS App β
- Clone base POS structure (Caracol)
- Customize industry-specific features
- Integrate with Colectiva for payments
- Send transactions to Constanza for accounting
- Follow multi-tenant pattern
Testing Integration β
- Test each component independently
- Test integration points
- End-to-end flow testing
- 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:
- ECOSYSTEM_CONTEXT.md - How it fits in the larger system
- README.md - Project-specific documentation
- API documentation - If it exposes APIs
- Integration guides - How to connect with other components
π― Next Steps β
Immediate Priorities β
- β Complete Banxico-Plenura integration
- π§ Finish Colectiva wallet core features
- π§ Deploy Constanza for first client (December)
- π 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:
- Read this document first
- Read the component's ECOSYSTEM_CONTEXT.md
- Understand dependencies on other services
- Follow integration patterns
- Document changes
- Test integrations
π Support β
- Technical Lead: Julio Sitges
- Email: juliositgespomares@gmail.com
- Company: Red Broom Software S.A.S.
- RFC: RBS2201168S7
Remember: We're building a cohesive ecosystem, not isolated apps. Every component serves a specific purpose and integrates with the whole.