{"id":29328778,"url":"https://github.com/maseranw/payfast-sub-app","last_synced_at":"2026-04-29T20:33:42.699Z","repository":{"id":303242963,"uuid":"1014714257","full_name":"maseranw/payfast-sub-app","owner":"maseranw","description":"Modern PayFast subscription app using Supabase + React + @ngelekanyo/payfast-subscribe-client","archived":false,"fork":false,"pushed_at":"2025-09-11T03:33:35.000Z","size":350,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T02:45:21.511Z","etag":null,"topics":["frontend","payfast","payments","react","typescript","vite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@ngelekanyo/payfast-subscribe-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maseranw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-06T09:11:58.000Z","updated_at":"2025-07-30T22:33:44.000Z","dependencies_parsed_at":"2025-07-06T15:34:49.038Z","dependency_job_id":"76546987-015c-4857-bad0-ae9f806c2cc8","html_url":"https://github.com/maseranw/payfast-sub-app","commit_stats":null,"previous_names":["maseranw/payfast-sub-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maseranw/payfast-sub-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maseranw%2Fpayfast-sub-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maseranw%2Fpayfast-sub-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maseranw%2Fpayfast-sub-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maseranw%2Fpayfast-sub-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maseranw","download_url":"https://codeload.github.com/maseranw/payfast-sub-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maseranw%2Fpayfast-sub-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frontend","payfast","payments","react","typescript","vite"],"created_at":"2025-07-07T22:37:06.454Z","updated_at":"2026-04-29T20:33:42.681Z","avatar_url":"https://github.com/maseranw.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PayfastReactSubscribeApp - Supabase + PayFast Subscription App\n\nThis application serves as a comprehensive example demonstrating how to integrate and use the @ngelekanyo/payfast-subscribe-client package. It showcases a modern subscription management platform built with React, TypeScript, and Supabase, featuring PayFast payment processing, secure user management, and premium feature gating with a polished dark/light theme.\n\nBy exploring this app, developers can learn how to seamlessly implement PayFast subscriptions in their own projects using @ngelekanyo/payfast-subscribe-client.\n\n\n🔗 **Designed to work with [@ngelekanyo/payfast-subscribe-client](https://www.npmjs.com/package/@ngelekanyo/payfast-subscribe-client)**\n\n## Features\n\n### 🔐 Authentication \u0026 User Management\n\n- **Secure Authentication**: Email/password login with Supabase Auth\n- **User Profiles**: Complete profile management with personal information\n- **Protected Routes**: Secure access control throughout the application\n\n### 💳 Subscription Management\n\n- **PayFast Integration**: Secure payment processing for South African users\n- **Multiple Plans**: Flexible subscription tiers (Basic, Pro)\n- **Subscription Control**: Pause, resume, and cancel subscriptions\n- **Real-time Status**: Live subscription status updates\n\n### ✨ Premium Features\n\n- **Reverse Text Tool**: Transform text by reversing character order\n- **Emoji Blast Generator**: Create random emoji combinations\n- **Feature Gating**: Plan-based access control for premium tools\n\n### 🎨 Modern UI/UX\n\n- **Dark/Light Theme**: Toggle between themes with system preference detection\n- **Responsive Design**: Optimized for all device sizes\n- **Beautiful Animations**: Smooth transitions and micro-interactions\n- **Gradient Backgrounds**: Modern glass-morphism design elements\n\n### 📞 Customer Support\n\n- **Contact System**: Built-in contact form with priority levels\n- **Message Management**: Track and manage customer inquiries\n- **Quick Response**: Automated acknowledgments and status tracking\n\n### 🏗️ Technical Excellence\n\n- **TypeScript**: Full type safety throughout the application\n- **Modern React**: Hooks, Context API, and functional components\n- **Supabase Backend**: Real-time database with Row Level Security\n- **Tailwind CSS**: Utility-first styling with dark mode support\n\n## Setup\n\n1. **Clone and install dependencies**:\n\n   ```bash\n   npm install\n   ```\n\n2. **Set up Supabase**:\n\n   - Create a new Supabase project\n   - Run the provided migrations to set up database tables\n   - Copy your Supabase URL and anon key\n\n3. **Environment Variables**:\n\n   ```bash\n   cp .env.example .env\n   ```\n\n   Fill in your Supabase credentials and PayFast backend URL.\n\n4. **PayFast Backend**:\n\n   - The app uses `@ngelekanyo/payfast-subscribe-client` for PayFast integration\n   - Backend URL is configured via `VITE_BACKEND_URL` environment variable\n   - Default backend: `https://payfast-test-nh3j.onrender.com`\n\n5. **Run the app**:\n   ```bash\n   npm run dev\n   ```\n\n## Database Schema \u0026 Migrations\n\n- All database schema changes, tables, policies, indexes, triggers, and sample data are consolidated into a single migration file for ease of setup:\n/supabase/migrations/database.sql\n\n- This file contains all necessary SQL commands to create and secure the database schema for this app, including user profiles, subscription plans, features, subscriptions, contact messages, and associated RLS policies.\n\n- When setting up the database, simply run this migration script to initialize your Supabase project.\n\n### Core Tables:\n\n#### 👤 user_profiles\n\n- User profile information (name, avatar, phone)\n- Links to Supabase Auth users\n- Row Level Security enabled\n\n#### 💼 subscription_plans\n\n- Available subscription tiers\n- Pricing and billing cycle information\n- Feature arrays for plan capabilities\n\n#### 🔄 subscriptions\n\n- User subscription records\n- PayFast integration fields\n- Status tracking and period management\n- Automatic updated_at triggers\n\n#### ⚡ subscription_features\n\n- Available premium features\n- Feature keys for access control\n- Descriptive names and metadata\n\n#### 🔗 plan_features\n\n- Many-to-many relationship between plans and features\n- Enables flexible feature combinations\n- Unique constraints prevent duplicates\n\n#### 📧 contact_messages\n\n- Customer support message system\n- Priority levels and status tracking\n- Admin response capabilities\n- Full audit trail with timestamps\n\n### Security Features:\n\n- **Row Level Security (RLS)**: Enabled on all tables\n- **User Isolation**: Users can only access their own data\n- **Authenticated Access**: All operations require valid authentication\n- **Secure Policies**: Granular permissions for different operations\n\n## Key Features Explained\n\n### 🌙 Dark Mode Implementation\n\n- **System Preference Detection**: Automatically detects user's system theme\n- **Manual Toggle**: Users can override system preference\n- **Persistent Storage**: Theme choice saved in localStorage\n- **Smooth Transitions**: All elements transition smoothly between themes\n- **Comprehensive Coverage**: Dark mode styling for all components\n\n### 💳 PayFast Integration\n\n- **Secure Payments**: All payment processing handled by PayFast\n- **Subscription Management**: Full lifecycle management (create, pause, resume, cancel)\n- **Real-time Updates**: Subscription status updates in real-time\n- **Error Handling**: Comprehensive error handling and user feedback\n- **South African Focus**: Optimized for South African payment methods\n\n### 🔒 Feature Gating System\n\n- **Plan-based Access**: Features unlocked based on subscription plan\n- **Real-time Checking**: Access control checked in real-time\n- **Graceful Degradation**: Clear messaging when features are unavailable\n- **Upgrade Prompts**: Seamless upgrade flow for locked features\n\n## PayFast Integration\n\nThe application uses the `@ngelekanyo/payfast-subscribe-client` package for seamless PayFast integration:\n\n- **Payment Initiation**: Secure payment form generation\n- **Subscription Management**: Full subscription lifecycle support\n- **Webhook Handling**: Automatic payment status updates\n- **Error Recovery**: Robust error handling and retry mechanisms\n\n## Project Structure\n\n```\nsrc/\n├── components/          # Reusable UI components\n│   ├── Layout.tsx      # Main layout with navigation and theme toggle\n│   ├── Footer.tsx      # Application footer with links\n│   └── ProtectedRoute.tsx # Route protection wrapper\n├── context/            # React context providers\n│   ├── AuthContext.tsx # Authentication and user management\n│   └── ThemeContext.tsx # Dark/light theme management\n├── features/           # Feature components (ReverseText, EmojiBlast)\n├── lib/               # Utility libraries (Supabase, PayFast)\n├── pages/             # Page components\n│   ├── Dashboard.tsx   # Main user dashboard\n│   ├── Subscribe.tsx   # Subscription management\n│   ├── Contact.tsx     # Customer support contact form\n│   ├── Login.tsx       # Authentication page\n│   ├── Success.tsx     # Payment success page\n│   └── Cancel.tsx      # Payment cancellation page\n├── App.tsx            # Main app component with routing\n└── main.tsx           # Application entry point\n```\n\n## Environment Variables\n\n```bash\n# Supabase Configuration\nVITE_SUPABASE_URL=your_supabase_project_url\nVITE_SUPABASE_ANON_KEY=your_supabase_anon_key\n\n# PayFast Backend URL\nVITE_BACKEND_URL=https://payfast-test-nh3j.onrender.com\n```\n\n## Tech Stack\n\n### Frontend\n\n- **React 18**: Latest React with concurrent features\n- **TypeScript**: Full type safety and better developer experience\n- **Vite**: Fast build tool and development server\n- **Tailwind CSS**: Utility-first CSS framework with dark mode\n- **React Router DOM**: Client-side routing\n- **Lucide React**: Beautiful, customizable icons\n- **React Hot Toast**: Elegant toast notifications\n\n### Backend \u0026 Services\n\n- **Supabase**: PostgreSQL database with real-time capabilities\n- **Supabase Auth**: Authentication and user management\n- **PayFast**: South African payment gateway\n- **Row Level Security**: Database-level security policies\n\n### Development Tools\n\n- **ESLint**: Code linting and quality checks\n- **TypeScript ESLint**: TypeScript-specific linting rules\n- **PostCSS**: CSS processing with Autoprefixer\n- **Git**: Version control with comprehensive .gitignore\n\n## Performance \u0026 Optimization\n\n- **Code Splitting**: Automatic code splitting with Vite\n- **Tree Shaking**: Unused code elimination\n- **Optimized Images**: Efficient image loading and caching\n- **Lazy Loading**: Components loaded on demand\n- **Memoization**: React.memo and useMemo for performance\n- **Database Indexing**: Optimized database queries with proper indexes\n\n## Security Features\n\n- **Row Level Security**: Database-level access control\n- **Authentication Required**: All sensitive operations require authentication\n- **CSRF Protection**: Built-in CSRF protection with Supabase\n- **SQL Injection Prevention**: Parameterized queries prevent SQL injection\n- **XSS Protection**: React's built-in XSS protection\n- **Secure Headers**: Proper security headers configuration\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaseranw%2Fpayfast-sub-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaseranw%2Fpayfast-sub-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaseranw%2Fpayfast-sub-app/lists"}