Skip to content

Salamander-Tech-Hub/HapoPay

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HapoPay - Smart Student Spending Platform

๐Ÿš€ Empowering Student Spending. Shaping Financial Futures.

HapoPay is a comprehensive parent-child money management platform that enables safe student spending through QR payments, real-time parental controls, and gamified financial education. Built with modern web technologies and powered by Supabase for real-time data management.

๐Ÿ”ง Supabase Integration Status

โœ… Completed Integration

  • Database Schema: Comprehensive schema with 10+ tables for users, children, transactions, rewards, and safety systems
  • Authentication: Supabase Auth with role-based access control (parent/student)
  • Real-time Features: Live transaction monitoring and balance updates
  • File Storage: Avatar and document upload capabilities
  • Row Level Security: Proper RLS policies for data protection
  • Helper Functions: Comprehensive API wrapper functions
  • Payment System: QR code payment processing with instant notifications
  • Reward System: Gamified spending with points, levels, and achievements

๐ŸŒ Target Audience

  • Parents: Seeking safe digital spending solutions for their children
  • Students: Learning financial responsibility through controlled spending
  • Families: Building healthy financial habits together
  • Educational Institutions: Supporting financial literacy programs

โœจ Key Features

๐Ÿฆ Core Financial Tools

  • Parent Dashboard: Complete family financial overview with real-time monitoring
  • Student Dashboard: Age-appropriate spending interface with balance tracking
  • QR Payment System: Secure contactless payments at participating merchants
  • Smart Spending Limits: Automatic category restrictions and weekly allowances
  • Emergency Funds: Instant money transfers for urgent situations
  • Transaction History: Detailed spending analytics and reporting

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Family Management

  • Multi-Child Support: Manage multiple children from single parent account
  • Individual Profiles: Customized settings and limits per child
  • Real-time Notifications: Instant alerts for all transactions
  • Safety Controls: Location-based spending restrictions and merchant filtering
  • Money Requests: Children can request funds with parental approval system

๐ŸŽฎ Gamification & Education

  • Reward Points System: Earn points for responsible spending and saving
  • Achievement Badges: Unlock rewards for financial milestones
  • Spending Challenges: Weekly goals to encourage smart financial decisions
  • Educational Content: Age-appropriate financial literacy resources
  • Progress Tracking: Visual representation of financial growth

๐Ÿ›ก๏ธ Safety & Security

  • Parental Controls: Comprehensive oversight of all spending activities
  • Merchant Restrictions: Block specific store categories or locations
  • Spending Alerts: Customizable notifications for various transaction types
  • Emergency Features: Quick access to emergency funds and contacts
  • Data Protection: Bank-level security with encrypted transactions

๐Ÿš€ Quick Setup Instructions

Prerequisites

  • Node.js (version 16 or higher)
  • Supabase account and project
  • Modern web browser

Installation

  1. Clone the repository:
git clone <repository-url>
cd hapopay
  1. Install Extentions:
Go to Extensions (Ctrl+Shift+X)
Search for Live Server by Ritwick Dey
Click Install
  1. Configure Supabase:

    • Create a project at supabase.com
    • Copy your project URL and anon key from Project Settings โ†’ API
    • Update config.js with your Supabase credentials
  2. Run database migrations:

    • Execute all SQL files in order:
      • database_setup.sql - Core tables and relationships
      • children_table_setup.sql - Child profile management
      • rewards_system_setup.sql - Gamification features
      • games_system_setup.sql - Achievement system
      • safety_system_setup.sql - Security controls
      • money_requests_setup.sql - Fund request system
      • emergency_requests_setup.sql - Emergency features
      • recurring_payments_setup.sql - Automated allowances
  3. Start the application:

Use Live Server (VS Code)
Use browser dev tools or VS Code debugger
  1. Open your browser: Navigate to the served local URL (typically http://localhost:3000)

๐Ÿ›  Technology Stack

  • Frontend: Vanilla HTML5, CSS3, JavaScript (ES6+)
  • Backend: Supabase (PostgreSQL database, Authentication, Storage)
  • Styling: Custom CSS with responsive design
  • Icons: Font Awesome 6.0
  • PDF Generation: jsPDF for transaction reports
  • Real-time: Supabase real-time subscriptions
  • Security: Row Level Security (RLS) policies

๐Ÿ“ฑ Mobile-First Design

HapoPay is designed with a mobile-first approach featuring:

  • Responsive layouts that adapt from mobile to desktop
  • Touch-friendly interface optimized for smartphones
  • QR code scanning capabilities
  • Offline transaction queuing
  • Progressive Web App (PWA) features
  • Fast loading times on low-bandwidth connections

๐ŸŽฏ Core User Flows

Parent Registration & Setup

  1. Sign Up: Create parent account with email verification
  2. Profile Setup: Complete family information and preferences
  3. Add Children: Register child profiles with spending limits
  4. Initial Funding: Add money to family account
  5. Configure Settings: Set up safety controls and notifications

Student Spending Experience

  1. Login: Secure student authentication
  2. View Balance: Check available spending money
  3. QR Payment: Scan merchant QR code to pay
  4. Transaction Confirmation: Receive instant payment confirmation
  5. Earn Rewards: Collect points for responsible spending

Money Management

  1. Send Money: Parents transfer funds to children instantly
  2. Request Funds: Students request money with reason
  3. Emergency Access: Quick emergency fund disbursement
  4. Recurring Allowances: Automated weekly/monthly payments
  5. Spending Analytics: Track and analyze spending patterns

๐Ÿ“ Project Structure

hapopay/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ Images/           # Application assets and logos
โ”‚   โ”‚   โ””โ”€โ”€ supabaseClient.mjs # Supabase client configuration
โ”‚   โ””โ”€โ”€ scripts/
โ”‚       โ””โ”€โ”€ test-supabase.mjs  # Database connection testing
โ”œโ”€โ”€ *.html                     # Main application pages
โ”‚   โ”œโ”€โ”€ index.html            # Landing page
โ”‚   โ”œโ”€โ”€ signup.html           # Parent registration
โ”‚   โ”œโ”€โ”€ parentLogin.html      # Parent authentication
โ”‚   โ”œโ”€โ”€ studentLogin.html     # Student authentication
โ”‚   โ”œโ”€โ”€ parentDashboard.html  # Parent control panel
โ”‚   โ”œโ”€โ”€ studentDashboard.html # Student interface
โ”‚   โ””โ”€โ”€ verify.html           # Email verification
โ”œโ”€โ”€ *.sql                     # Database schema and migrations
โ”œโ”€โ”€ style.css                 # Application styling
โ”œโ”€โ”€ script.js                 # Core JavaScript functionality
โ”œโ”€โ”€ config.js                 # Public configuration
โ””โ”€โ”€ package.json              # Dependencies and scripts

๐ŸŒŸ Key Pages & Features

Landing Page (index.html)

  • Modern, responsive design showcasing key features
  • Clear call-to-action for parent registration
  • Feature highlights with intuitive icons
  • Mobile-optimized navigation

Parent Dashboard

  • Family Overview: Total balance, spending summaries, child activities
  • Child Management: Individual child profiles with custom settings
  • Transaction Monitoring: Real-time transaction feed with filtering
  • Analytics: Spending patterns, category breakdowns, trends
  • Quick Actions: Send money, adjust limits, emergency controls
  • Settings: Safety controls, notification preferences, account management

Student Dashboard

  • Balance Display: Current available spending money
  • Recent Transactions: Transaction history with merchant details
  • Rewards Progress: Points earned, level progression, achievements
  • Quick Pay: QR code scanner for instant payments
  • Goals: Savings targets and spending challenges
  • Profile: Personal information and preferences

๐ŸŽจ Design System

Colors

  • Primary Blue: #007bff - Main actions and branding
  • Success Green: #28a745 - Positive actions and confirmations
  • Warning Orange: #ffc107 - Alerts and important notices
  • Danger Red: #dc3545 - Critical actions and errors
  • Light Gray: #f8f9fa - Backgrounds and subtle elements

Typography

  • Font Family: System fonts for optimal performance
  • Responsive Sizing: Scales appropriately across devices
  • Weight Hierarchy: Clear information hierarchy with font weights

Components

  • Cards: Consistent card design for information display
  • Buttons: Action-oriented button styles with hover states
  • Forms: User-friendly form inputs with validation
  • Navigation: Intuitive navigation patterns

๐Ÿ—„๏ธ Database Schema Overview

Core Tables

  • auth.users: Supabase authentication users
  • children: Child profiles linked to parent accounts
  • transactions: All financial transactions and transfers
  • money_requests: Student fund requests to parents
  • emergency_requests: Emergency fund access requests
  • rewards: Points and achievement tracking
  • games: Gamification system data
  • safety_settings: Parental control configurations
  • recurring_payments: Automated allowance schedules

Key Features

  • Automatic Relationships: Foreign key constraints ensure data integrity
  • Real-time Updates: Database triggers for instant notifications
  • Comprehensive RLS: Row-level security for all sensitive data
  • Audit Trail: Complete transaction history with timestamps
  • Flexible Schema: Extensible design for future features

๐Ÿ›ก๏ธ Security Features

Authentication & Authorization

  • Supabase Auth: Industry-standard authentication system
  • Role-based Access: Separate parent and student permissions
  • Session Management: Secure session handling with automatic expiry
  • Email Verification: Required email confirmation for account security

Data Protection

  • Row Level Security: Database-level access controls
  • Encrypted Storage: All sensitive data encrypted at rest
  • Secure Transmission: HTTPS/TLS for all data transfers
  • Input Validation: Comprehensive client and server-side validation

Financial Security

  • Transaction Limits: Configurable spending and transfer limits
  • Fraud Detection: Unusual spending pattern alerts
  • Merchant Verification: Verified merchant network
  • Emergency Controls: Instant account freezing capabilities

๐Ÿšง Development Status & Progress

โœ… HapoPay 1.0 - COMPLETED FEATURES

Core Platform (Web-Based)

  • โœ… Parent-Child Money Management: Complete family financial ecosystem
  • โœ… QR Payment System: Secure contactless payments for students
  • โœ… Real-time Transaction Monitoring: Live spending alerts and notifications
  • โœ… Supabase Integration: Full backend with authentication and real-time data
  • โœ… Gamified Reward System: Points, levels, and achievement tracking
  • โœ… Safety & Parental Controls: Spending limits, merchant restrictions, emergency controls
  • โœ… Multi-Child Support: Manage multiple children from single parent account
  • โœ… Emergency Fund System: Instant money transfers for urgent situations
  • โœ… Recurring Allowances: Automated weekly/monthly payments
  • โœ… Transaction History: Detailed spending analytics and reporting
  • โœ… Mobile-Responsive Design: Optimized for all device sizes

Database & Security

  • โœ… Comprehensive Schema: 10+ tables for users, transactions, rewards, safety
  • โœ… Row Level Security: Database-level access controls
  • โœ… Role-Based Authentication: Separate parent/student permissions
  • โœ… Real-time Subscriptions: Live data updates across all interfaces

๐Ÿ”ง HapoPay 1.5 - IN PROGRESS

  • ๐Ÿ”ง Advanced Analytics Dashboard: Enhanced spending insights and trend analysis
  • ๐Ÿ”ง Educational Content Integration: Financial literacy modules for students
  • ๐Ÿ”ง Merchant Network Expansion: Growing QR code payment acceptance
  • ๐Ÿ”ง Push Notification System: Real-time mobile alerts

๐Ÿš€ HapoPay 2.0 - EXPENSE TRACKER APP BLUEPRINT

Building on our solid foundation, HapoPay 2.0 will introduce a comprehensive expense tracking app with AI-powered insights

๐Ÿ“ฑ Core Features (Monefy-Style Foundation)

  • โŒ Quick Expense Entry: One-tap expense logging with category icons
  • โŒ Visual Reports: Pie charts and bar charts for spending breakdown
  • โŒ Multi-Currency Support: Handle different currencies and account types
  • โŒ Cloud Sync: Google Drive, iCloud, Dropbox integration
  • โŒ Biometric Security: Passcode and fingerprint protection

๐Ÿค– AI-Powered Unique Features

  • โŒ AI Spending Insights:
    • Monthly analysis: "You spent 20% more on dining this month"
    • Predictive alerts: "Transport budget will run out in 10 days"
    • Personalized savings recommendations
  • โŒ Smart Logging:
    • Voice entry: "R120, petrol" โ†’ auto-categorized
    • Receipt scanning with AI extraction
    • Camera-based expense capture
  • โŒ Predictive Analytics: Forecast spending patterns and budget alerts

๐ŸŽฎ Advanced Gamification

  • โŒ Savings Challenges:
    • "Save R500 this week"
    • "No takeout for 5 days"
    • Progress badges and streak tracking
  • โŒ Brand Partnerships: Discounts and rewards for completed challenges
  • โŒ Social Features: Family leaderboards and shared goals

๐Ÿ’ฐ Smart Financial Features

  • โŒ Smart Rounding: Round up expenses (R37 โ†’ R40) for micro-savings
  • โŒ Automatic Savings: Spare change saved into dedicated wallet
  • โŒ Investment Integration: Connect with investment partners
  • โŒ Group Expenses: Shared wallets for families, roommates, trips
  • โŒ Bill Splitting: Built-in expense sharing and settlement

๐Ÿ“Š Advanced Analytics & Reporting

  • โŒ AI-Generated Reports: Monthly spending summaries with insights
  • โŒ Trend Analysis: Weekly/monthly spending pattern recognition
  • โŒ Goal Tracking: Progress toward financial objectives
  • โŒ Forecasting: "Next month, you'll likely save R1,500"

๐ŸŽฏ HapoPay 3.0 - FUTURE VISION

  • โŒ Native Mobile Apps: Flutter-based iOS and Android applications
  • โŒ Physical Card Integration: Debit cards linked to student accounts
  • โŒ Advanced AI: Machine learning for personalized financial advice
  • โŒ Cryptocurrency Support: Digital currency management for teens
  • โŒ Investment Education: Guided investment learning for students
  • โŒ Open Banking Integration: Connect with major South African banks

๐Ÿ“ˆ Feature Comparison: Current vs Planned

Feature Category HapoPay 1.0 (โœ… Built) HapoPay 2.0 (โŒ Planned)
User Management Parent-child accounts Individual expense tracking
Payment Method QR codes Manual/voice/photo entry
Analytics Basic transaction history AI-powered insights
Gamification Points & achievements Savings challenges & social
Platform Web-based responsive Native mobile apps
AI Features None Predictive analytics & smart logging
Expense Tracking Transaction monitoring Comprehensive expense management
Savings Balance management Smart rounding & micro-savings
Social Features Family-focused Groups & bill splitting

๐Ÿ›  Technical Evolution Path

Current Stack (HapoPay 1.0)

  • Frontend: Vanilla HTML5, CSS3, JavaScript
  • Backend: Supabase (PostgreSQL, Auth, Storage)
  • Platform: Web-based with mobile responsiveness

Planned Stack (HapoPay 2.0)

  • Frontend: Flutter (cross-platform mobile)
  • Backend: Firebase + Supabase hybrid
  • AI/ML: TensorFlow Lite for on-device processing
  • Additional: Voice recognition, OCR for receipts
  • Security: End-to-end encryption for financial data

๐Ÿ” Testing Instructions

Authentication Testing

  • Parent registration completes successfully
  • Email verification process works
  • Parent login redirects to dashboard
  • Student login redirects to student dashboard
  • Logout clears session properly
  • Password reset functionality works

Core Functionality Testing

  • Parent can add children to account
  • Money transfers work between parent and children
  • QR payments process correctly
  • Spending limits enforce properly
  • Reward points accumulate correctly
  • Real-time notifications appear
  • Transaction history displays accurately

Security Testing

  • Unauthorized access is prevented
  • Data isolation between families works
  • Spending limits cannot be bypassed
  • Emergency controls function properly

๐Ÿ“Š Performance Optimizations

  • Lazy Loading: Heavy components loaded on demand
  • Image Optimization: Compressed images with appropriate formats
  • Database Indexing: Optimized queries for fast data retrieval
  • Caching Strategy: Strategic caching for frequently accessed data
  • Minified Assets: Compressed CSS and JavaScript files

๐ŸŒ Browser Support

  • Chrome: 90+ (Recommended)
  • Firefox: 88+
  • Safari: 14+
  • Edge: 90+
  • Mobile Browsers: iOS Safari 14+, Chrome Mobile 90+

๐Ÿ“„ Environment Variables

Create a .env file from .env.example:

SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_anon_key

Security Notes:

  • Never commit real secrets to version control
  • Keep service_role keys server-side only
  • Use environment-specific configurations

๐Ÿš€ Deployment

Production Deployment

  1. Build the application: Ensure all assets are optimized
  2. Configure environment: Set production Supabase credentials
  3. Deploy to hosting: Upload to your preferred hosting service
  4. Configure domain: Set up custom domain and SSL
  5. Test thoroughly: Verify all functionality in production

Recommended Hosting

  • Netlify: Automatic deployments with GitHub integration
  • Vercel: Optimized for modern web applications
  • Firebase Hosting: Google's hosting platform
  • Traditional Web Hosting: Any service supporting static files

๐Ÿค Contributing

We welcome contributions to improve HapoPay:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Ensure mobile-first responsive design
  • Write comprehensive tests for new features
  • Update documentation for any changes
  • Maintain security best practices

๐Ÿ“ž Support

For support and questions:

  • Email: [email protected]
  • Documentation: Available in the application
  • GitHub Issues: Report bugs and feature requests
  • Community: Join our developer community

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ”ง Technical Notes

Database Triggers

  • User Creation: Automatic profile setup on registration
  • Transaction Processing: Real-time balance updates
  • Reward Calculation: Automatic point allocation
  • Notification System: Instant alert generation

API Integration

  • Supabase Client: Comprehensive database operations
  • Real-time Subscriptions: Live data updates
  • File Storage: Avatar and document management
  • Authentication: Secure user management

Performance Features

  • Efficient Queries: Optimized database interactions
  • Real-time Updates: Minimal latency for critical operations
  • Responsive Design: Fast loading across all devices
  • Error Handling: Graceful error management and recovery

HapoPay - Empowering the next generation of financially responsible students through safe, smart, and engaging money management.

About

HapoPay is a comprehensive parent-child money management platform that enables safe student spending through QR payments, real-time parental controls, and gamified financial education. Built with modern web technologies and powered by Supabase for real-time data management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 71.5%
  • CSS 12.4%
  • JavaScript 10.0%
  • PLpgSQL 6.1%