# El Carnal > Comida mexicana al grill en Bogotá: burritos, tacos, nachos, alambres y combos. Pedidos a domicilio en Bogotá, Chía, Mosquera y Soacha, o recogida en cualquiera de nuestras 40+ sedes. El Carnal es una cadena colombiana de comida mexicana al grill operada por INVERSIONES EL CARNAL SAS. El sitio es la tienda en línea oficial: catálogo de productos, pedidos a domicilio, seguimiento en tiempo real, cupones y directorio de restaurantes. ## Tech Stack - **Frontend:** React 18 + Vite 5 + TypeScript + Tailwind CSS + shadcn/ui - **Backend:** Lovable Cloud (Supabase) — PostgreSQL, Edge Functions, Auth, Storage - **Payments:** Wompi (Colombia) — credit card, PSE, cash; Cash on delivery also supported - **Maps:** Leaflet + Google Maps (coverage validation, store locator) - **Notifications:** Resend (email), WATI (WhatsApp), Slack (POS alerts) - **Analytics:** Google Analytics 4, TikTok Pixel, Meta Pixel ## Main User Flows ### 1. Browse Menu & Add to Cart - User lands on `/` or `/menu` and sees the full product catalog. - Categories: Burros, Burros Vegetarianos, Combos, Nachos, Quesadillas, Alambres, Árabes, Postres, Bebidas, Adiciones. - Products are loaded from Supabase `products` and `product_overrides` tables (real-time catalog updates). - Tapping a product opens a customization modal: choose protein, toppings, sauces, drinks, and extras. - Quantities are enforced per category (e.g., max 1 protein, 2 toppings, 3 sauces). - Price updates dynamically in the modal as selections change. - Clicking "Agregar" adds the item to the cart with full customization snapshot. - Cart is persisted to `localStorage` and syncs across tabs. ### 2. Cart Review & Checkout - Cart drawer (mobile) or sidebar (desktop) shows all items with quantities, customizations, and prices. - User can adjust quantities, remove items, or apply a coupon code (`/cupones`). - Subtotal, delivery fee ($7,000 COP for Delivery), discount, and total are calculated in real time. - Delivery vs Pickup selector: toggles between home delivery (requires address within 2 km of a store) and in-store pickup. - Address validation uses Haversine distance against `delivery_stores` coordinates. - Checkout (`/checkout`) collects: name, phone, email, address (with autocomplete), payment method, and order notes. - Payment methods: Wompi (card, PSE, Nequi, Bancolombia), or Cash on delivery. - Wompi transactions are created via Edge Function; card payments use Wompi Widget; PSE uses a redirect flow. - On success, user is redirected to `/order-confirmation` with order details. ### 3. Track Order - `/tracking` lets users look up an order by order number or phone number. - Order stages: Pendiente → En preparación → Listo para entrega → En camino → Entregado. - PII is masked (phone partially hidden, address truncated). - Real-time updates are available to authenticated users on their account page (`/cuenta`). ### 4. Account & Authentication - `/auth` — login / register with email + password or Google OAuth. - `/cuenta` — order history, saved addresses, profile editing, loyalty program overview. - `/reset-password` — password reset flow. - Admin users access `/admin/login` and the dashboard at `/admin/*` (protected by `AdminGuard`). ### 5. Other Public Pages - `/restaurantes` — interactive map and list of 40+ locations in Bogotá, Chía, Mosquera, Soacha. - `/ubicaciones-comida-al-pastor` — SEO alias for the restaurant directory. - `/contact` — contact form, PQR (complaints), and corporate info. - `/privacy` — privacy policy (Ley 1581/2012). - `/terms` — terms and conditions. ## Key API / Edge Functions - `create-order` — validates cart, checks stock, calculates totals, inserts order + order_items. - `process-payment` — processes Wompi payments and updates order status. - `validate-coverage` — Haversine check against store coordinates; returns nearest store. - `track-order` — lookup order by number/phone with PII masking. - `wompi-webhook` — handles Wompi async payment notifications. - `sync-pending-wompi` — polls and reconciles pending Wompi transactions. - `send-order-confirmation` — sends email confirmation via Resend. - `send-order-notification` — sends WhatsApp alert to store via WATI. - `customer-chat` — Carnalito AI chat widget (assistant for menu, orders, and support). - `share-product` — generates shareable product links with Open Graph metadata. - `send-complaint-confirmation` — auto-replies to PQR submissions. - `reply-institutional-inquiry` — auto-replies to B2B / institutional sales inquiries. ## Database Highlights - `orders` — order header with customer, address, payment, and status. - `order_items` — line items with product snapshot, customization JSON, and product_image. - `products` / `product_overrides` — base catalog + real-time overrides (prices, availability, images). - `delivery_stores` — store locations with lat/lng and editable delivery radius. - `customers` — imported customer directory for analytics and marketing. - `coupons` — promotional codes with usage limits and expiration. - `carnal_tracking` — lightweight telemetry for traffic and conversion analytics. ## Business Rules - Delivery is only available within a 2 km radius of any active store (Haversine). - Delivery fee is $7,000 COP (free threshold may apply via coupons). - Cash orders are auto-confirmed; Wompi orders await webhook confirmation. - Vegetarian products automatically filter out meat-based extras. - Combo products (e.g., COMBO FUTBOLERO) have fixed base price + customization extras. - Test mode (`IS_TEST_ENVIRONMENT = true`) blocks real order processing. ## Contact - Website: https://elcarnal.co - Instagram: https://www.instagram.com/elcarnalcol/ - TikTok: https://www.tiktok.com/@elcarnalcol