Skip to content

rabbi696/mac-mini-m4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

153 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Mac Mini M4 Software Repository

Mac Mini M4 PHP MySQL Status

A comprehensive web platform for Mac Mini M4 users to discover, request, and download premium macOS applications optimized for Apple Silicon M4 chip performance.

๐Ÿš€ Features

Core Features

  • ๐Ÿ—‚๏ธ Software Catalog: Curated collection of Mac M4 compatible software
  • ๐Ÿ’ณ Multi-Payment Donation System: Support via PipraPay and UddoktaPay
  • ๐Ÿ“ Software Request System: Users can request specific software
  • ๐Ÿ† Top Donors Recognition: Showcase top contributors on homepage
  • ๐Ÿ“ฑ Responsive Design: Mobile-friendly interface
  • ๐Ÿ” Admin Panel: Complete administration system

Payment System

  • Dual Gateway Support: PipraPay and UddoktaPay integration
  • Smart Fallback: Automatic switching to available payment methods
  • Development Mode: Local testing without real API calls
  • Transaction Management: Complete donation tracking and verification
  • Admin Controls: Enable/disable payment methods, edit API settings

Admin Features

  • Donation Dashboard: View, edit, and delete transaction records
  • Payment Method Management: Configure API keys and toggle payment gateways
  • Contact Management: Handle user inquiries and feedback
  • Request Management: Process software requests from users
  • User Authentication: Secure admin login system

๐Ÿ› ๏ธ Technology Stack

  • Frontend: HTML5, CSS3, JavaScript (Vanilla)
  • Backend: PHP 8.0+
  • Database: MySQL 8.0+
  • Payment APIs: PipraPay, UddoktaPay
  • Development: Laravel Herd (local), DBngin (database)

๐Ÿ“‹ Requirements

  • PHP 8.0 or higher
  • MySQL 8.0 or higher
  • Web server (Apache/Nginx)
  • cURL extension enabled
  • JSON extension enabled

๐Ÿ”ง Installation

Local Development Setup

  1. Clone the repository

    git clone https://github.com/yourusername/mac-mini-m4.git
    cd mac-mini-m4
  2. Database Setup

    • Create a MySQL database named mac_software
    • Import the database structure:
    mysql -u root -p mac_software < database_backup.sql
  3. Environment Configuration Create a .env file in the project root:

    DB_HOST=127.0.0.1
    DB_DATABASE=mac_software
    DB_USERNAME=root
    DB_PASSWORD=
    DB_PORT=3306
    
    # PipraPay Configuration
    PIPRAPAY_API_KEY=your_piprapay_api_key
    PIPRAPAY_BASE_URL=https://payment.webservicebd.com/api
    PIPRAPAY_ENABLED=true
    
    # UddoktaPay Configuration
    UDDOKTAPAY_API_KEY=your_uddoktapay_api_key
    UDDOKTAPAY_BASE_URL=https://pay.webservicebd.com/api
    UDDOKTAPAY_ENABLED=true
  4. Admin Setup

    • Access /admin/setup-donations.php to create admin user
    • Configure payment settings in admin panel
  5. Local Server

    • Use Laravel Herd: Access via https://mac-mini-m4.test
    • Or use PHP built-in server: php -S localhost:8000

๐Ÿ“Š Database Schema

Core Tables

donations

CREATE TABLE donations (
    id INT AUTO_INCREMENT PRIMARY KEY,
    reference_id VARCHAR(100) UNIQUE NOT NULL,
    payment_id VARCHAR(100),
    amount DECIMAL(10,2) NOT NULL,
    currency VARCHAR(3) DEFAULT 'BDT',
    payment_method VARCHAR(50) DEFAULT 'unknown',
    transaction_id VARCHAR(255),
    metadata TEXT,
    donor_name VARCHAR(100) NOT NULL,
    donor_email VARCHAR(150),
    donor_phone VARCHAR(20),
    message TEXT,
    status ENUM('pending','completed','failed','cancelled') DEFAULT 'pending',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    verified_at TIMESTAMP NULL
);

admin_users

CREATE TABLE admin_users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

software_requests

CREATE TABLE software_requests (
    id INT AUTO_INCREMENT PRIMARY KEY,
    software_name VARCHAR(255) NOT NULL,
    software_version VARCHAR(50),
    additional_info TEXT,
    visitor_email VARCHAR(150) NOT NULL,
    date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    status ENUM('pending','completed','rejected') DEFAULT 'pending',
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

contact_messages

CREATE TABLE contact_messages (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(150) NOT NULL,
    message TEXT NOT NULL,
    date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

๐Ÿ”— API Endpoints

Donation System

  • POST /api/donate-multi.php - Process donations with multiple payment methods
  • GET /api/get-payment-methods.php - Retrieve available payment methods
  • GET /api/get-top-donors.php - Fetch top 5 donors for homepage display
  • POST /api/verify-donation.php - Verify payment status

Request System

  • POST /admin/process_request.php - Handle software requests
  • POST /admin/process_contact.php - Process contact form submissions

Admin API

  • POST /admin/donation-dashboard.php - Manage donations (CRUD operations)
  • POST /admin/manage-payment-methods.php - Configure payment settings

๐ŸŽจ Frontend Structure

Main Pages

  • index.html - Homepage with software catalog and top donors
  • donate.html - Donation form with payment method selection
  • contact-us.html - Contact form for user inquiries
  • dmca.html - DMCA takedown policy
  • terms-of-service.html - Terms of service
  • privacy-policy.html - Privacy policy

Admin Panel

  • admin/login.php - Admin authentication
  • admin/dashboard.php - Main admin dashboard
  • admin/donation-dashboard.php - Donation management
  • admin/manage-payment-methods.php - Payment configuration

๐Ÿ’ณ Payment Integration

PipraPay Setup

  1. Obtain API key from PipraPay
  2. Configure in admin panel or environment file
  3. Set webhook URL: /api/webhook-piprapay.php

UddoktaPay Setup

  1. Get API credentials from UddoktaPay
  2. Update configuration in admin settings
  3. Webhook endpoint: /api/webhook-uddoktapay.php

Development Mode

The system automatically detects local development environments and simulates payments:

  • Domains: localhost, 127.0.0.1, *.local
  • Excluded: mac-mini-m4.test (for real API testing)
  • Test donations redirect to success page with test parameters

๐Ÿ”’ Security Features

  • SQL Injection Protection: Prepared statements for all queries
  • XSS Prevention: HTML escaping for user inputs
  • Admin Authentication: Secure login with bcrypt password hashing
  • Input Validation: Server-side validation for all forms
  • CSRF Protection: Form token validation (recommended to implement)

๐Ÿ“ฑ Mobile Responsiveness

The website is fully responsive with:

  • Mobile-first design approach
  • Touch-friendly interface elements
  • Responsive grid layouts
  • Mobile navigation menu
  • Optimized images and assets

๐Ÿšฆ Development Mode

Local Testing Features

  • Automatic test mode detection for *.test domains
  • Simulated payment responses
  • Test donation tracking
  • Development logging
  • No real API charges during testing

Read more: Development Mode Documentation

๐Ÿ“ Directory Structure

mac-mini-m4/
โ”œโ”€โ”€ admin/                 # Admin panel files
โ”‚   โ”œโ”€โ”€ dashboard.php
โ”‚   โ”œโ”€โ”€ donation-dashboard.php
โ”‚   โ”œโ”€โ”€ manage-payment-methods.php
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ api/                   # API endpoints
โ”‚   โ”œโ”€โ”€ donate-multi.php
โ”‚   โ”œโ”€โ”€ get-top-donors.php
โ”‚   โ”œโ”€โ”€ PipraPay.php
โ”‚   โ”œโ”€โ”€ UddoktaPay.php
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ config/                # Configuration files
โ”‚   โ”œโ”€โ”€ db_config.php
โ”‚   โ”œโ”€โ”€ donation_config.php
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ images/                # Software images and assets
โ”œโ”€โ”€ logs/                  # Application logs
โ”œโ”€โ”€ utils/                 # Utility scripts
โ”œโ”€โ”€ index.html            # Homepage
โ”œโ”€โ”€ donate.html           # Donation page
โ””โ”€โ”€ README.md

๐Ÿ”ง Configuration

Payment Methods

Access admin panel โ†’ Payment Methods to configure:

  • API keys for each payment gateway
  • Enable/disable payment methods
  • Test payment settings

Donation Settings

  • Minimum donation amount
  • Currency settings (default: BDT)
  • Success/cancel redirect URLs
  • Webhook configurations

๐Ÿ“Š Analytics & Logging

Log Files

  • logs/donations.log - All donation attempts
  • logs/donation_errors.log - Payment errors and issues
  • logs/admin_actions.log - Admin panel activities
  • logs/php_error.log - PHP errors and warnings

Monitoring

  • Real-time donation tracking
  • Payment method availability
  • Error rate monitoring
  • Admin activity logging

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit a pull request

๐Ÿ“„ License

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

โš ๏ธ Disclaimer

Educational Purpose: This software is shared purely for educational purposes. Please consider purchasing software to support developers. The repository creator does not host or store copyrighted software and found these resources online for learning purposes only.

๐Ÿ“ž Support

๐Ÿ† Top Contributors

The homepage showcases top donors who support the project. Become a contributor by:

  • Making donations through the platform
  • Contributing to the codebase
  • Reporting bugs and suggesting improvements

๐Ÿ“‹ Recent Updates (v2.0)

โœจ Latest Features (September 2024)

  • ๐ŸŽฏ Multi-Payment Gateway: Added UddoktaPay alongside PipraPay
  • ๐Ÿ  Homepage Redesign: Two-column layout with top donors showcase
  • ๐Ÿ“ฑ Phone Number Field: Added optional phone collection in donation form
  • โœ… Required Fields: Made donor name and email mandatory
  • ๐Ÿ”ง Admin Enhancements:
    • Edit donation status functionality
    • Delete transaction records
    • Payment method toggle controls
    • Real-time payment gateway configuration
  • ๐Ÿงช Development Mode: Smart local testing without API charges
  • ๐Ÿ“Š Top Donors Display: Homepage recognition for contributors
  • ๐Ÿ”’ Enhanced Security: Improved validation and error handling

๐Ÿ› Bug Fixes

  • Fixed PipraPay API endpoint URL issues
  • Resolved local development detection problems
  • Improved mobile responsiveness
  • Enhanced error messages and user feedback

๐Ÿ› ๏ธ Technical Improvements

  • Database schema updates for phone numbers
  • Admin action logging system
  • Improved AJAX error handling
  • Better responsive design implementation
  • Code optimization and cleanup

๐Ÿ“Š Current Statistics

  • Active Payment Methods: 1 (PipraPay)
  • Supported Software: 27 applications
  • Total Donors: 7+ registered donors
  • Admin Features: 15+ management tools

๐Ÿ”ฎ Roadmap

Upcoming Features

  • Software auto-update notifications
  • User account system
  • Advanced donation analytics
  • Email newsletter integration
  • Mobile app development
  • Multi-language support

Made with โค๏ธ for the Mac M4 community

About

Mac Mini M4 Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors