# QR-Based M-Pesa Integration App
A comprehensive mobile application that integrates with Safaricom's M-Pesa via the Daraja API and uses QR codes for convenient transactions.
## Features
- **Phone Number Authentication**: Secure OTP-based authentication using M-Pesa registered phone numbers
- **QR Code Transactions**: Generate and scan QR codes for easy money transfers
- **M-Pesa Integration**: Direct integration with Safaricom's Daraja API for STK Push transactions
- **Real-time Balance**: View your M-Pesa balance directly in the app
- **Transaction History**: Track all your transactions with detailed history
- **Biometric Security**: Enhanced security with biometric authentication
- **Offline QR Generation**: Generate QR codes even when offline
## Technology Stack
### Frontend (Mobile App)
- **React Native with Expo**: Cross-platform mobile development
- **Expo Router**: File-based navigation with tabs and stack navigation
- **TypeScript**: Type-safe development
- **Expo Camera**: QR code scanning functionality
- **React Native QRCode SVG**: QR code generation
- **Expo Secure Store**: Secure local storage for tokens
### Backend (Supabase)
- **Supabase Database**: PostgreSQL with Row Level Security (RLS)
- **Supabase Edge Functions**: Serverless functions for M-Pesa API integration
- **Supabase Auth**: User authentication and authorization
- **Real-time subscriptions**: Live transaction updates
### External APIs
- **Safaricom Daraja API**: M-Pesa STK Push and balance queries
- **M-Pesa Sandbox**: Testing environment for transactions
## Architecture
```
Mobile App (React Native + Expo)
↓
Supabase (Database + Auth + Edge Functions)
↓
Safaricom Daraja API (M-Pesa Integration)
```
## Database Schema
### Users Table
- `id` (UUID, Primary Key)
- `phone_number` (Text, Unique, M-Pesa registered number)
- `name` (Text, User's full name)
- `email` (Text, Optional email address)
- `created_at`, `updated_at` (Timestamps)
### Transactions Table
- `id` (UUID, Primary …