How dachugo/polleria-new-project works
Project Type & Purpose
• This is a hybrid mobile full-stack application built with Ionic (v8) + Angular (v19) on the frontend, Capacitor for native device access, and Supabase (PostgreSQL + Auth) + Stripe for backend services.
• Purpose: A mobile ordering and management system for a chicken restaurant (“Pollería Arenas”) providing customer-facing UI, secure auth, real-time order tracking, and payment processing.
High-Level Architecture Components
a. Mobile App (Ionic/Angular Hybrid)
• UI Layer: Angular “pages” (lazy-loaded modules) and reusable “components”
• Business Logic Layer: Injectable Angular “services” (auth, data, cart, pedidos, stripe, favoritos)
• Native Bridge: Capacitor runtime enabling Android & iOS builds
b. External Backend Services
• Supabase: Authentication (JWT + RLS), PostgreSQL database, storage
• Stripe: Payment gateway API
c. Platform Builds
• Android native project (under /android)
• iOS project (via Capacitor)
• Web/PWA (via Ionic serve / build)
Relationships & Data Flows
• User taps UI component → Angular page/component invokes corresponding Service
• Service uses Supabase JS SDK for CRUD on tables (usuarios, productos, carrito, pedidos, favoritos, tarjetas, estados_pedido)
• For payments, StripeService loads Stripe.js, creates payment intents, handles card elements → calls Stripe API
• Responses from Supabase/Stripe propagate back to the Service → UI updates state (via Reactive Forms or Observables)
• Capacitor plugins handle native features (camera for avatars, file system, notifications)
Architectural Patterns & Design Principles
• Modular, feature-based structure: each “page” is a lazy-loaded Angular module
• Reusable UI “components” separated into /src/app/components
• Injectable “services” encapsulate API interactions and business rules
• Route guards (AuthGuard) protect private pages
• Reactive programming (RxJS) for state and form management
• RLS (Row Level Security) enforces data isolation on Supabase
• Environment files manage secrets and endpoints