System Architecture Document
MAFORI Event Ticketing & Voucher Platform — Technical architecture, data flow & infrastructure
Presentation Layer (Client)
Browser & Mobile Web App
Application Layer
Base44 Serverless Functions
Data Layer
Base44 BaaS Entity Store
Integration Layer
External Services & Partner APIs
Architecture Layers
Browser & Mobile Web App
Single-page application rendered in the browser, served as a static build. No server-side rendering — all pages are client-side React components.
Base44 Serverless Functions
Backend logic runs as isolated Deno serverless functions. Each function is an independent HTTP handler — no long-running server process.
Base44 BaaS Entity Store
All persistent data is stored as structured entities in the Base44 managed database with automatic row-level security (RLS).
External Services & Partner APIs
Third-party services connect through dedicated backend functions or OAuth connectors, never directly from the client.
Browser requests /event/:id — client fetches public event data via getPublicEventData function
React renders event details, ticket selection, and Yoco payment widget
Payment token created client-side, sent to createYocoCheckout function
confirmYocoPayment verifies with Yoco, creates Ticket + Payment records, generates QR
ticketPdfGenerator renders branded ticket with QR code and voucher overlay
sendTicketEmail emails PDF to customer via Resend, logs to EmailLog entity
Scanner reads QR, checks Ticket status via real-time subscription, marks as scanned
Security Architecture
Row-Level Security (RLS)
Every entity enforces access control at the database level — users can only read/write data they are authorised for.
Role-Based Access Control
Six roles (admin, manager, cashier, scanner, viewer, tester) with distinct permissions enforced on both client and server.
OAuth Authentication
Platform-managed JWT sessions with automatic token refresh. No custom auth backend — eliminates common auth vulnerabilities.
Secret Management
API keys and secrets stored as environment variables on the server, never embedded in client code.
Payment Security
All payment processing handled by PCI-DSS compliant gateways (Yoco, PayFast). No card data touches our servers.
Input Validation
All user input validated on both client and server. Entity schemas enforce data type and constraint validation.
Audit Logging
All user actions, payment events, and integration calls are logged for traceability and compliance.
Iframe Protection
X-Frame-Options: DENY and restrictive CSP headers prevent clickjacking and content injection.
Deployment & Infrastructure
Hosting
Base44 managed cloud (auto-scaled)
Frontend Build
Vite static bundle (CDN-distributed)
Backend Runtime
Deno Deploy serverless (edge)
Database
Base44 managed NoSQL with RLS
File Storage
Base44 cloud storage (public + private)
CDN / Delivery
Global edge network with caching
SSL / TLS
Automatic HTTPS with managed certificates
Mobile Delivery
Responsive PWA (installable, iOS/Android)
This document is confidential and intended for authorised stakeholders only. © 2026 MAFORI. All rights reserved.