mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
6e86031576b2584903700e5373a8b5e6a9d37678
Service worker was caching main.js (cache-first strategy) so event listeners may not have been running. Added filemtime version param to main.js like CSS. Also added inline onclick to shop page buttons so they work regardless of whether event delegation is functional. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tom's Java Jive - E-commerce Coffee Shop
A complete e-commerce platform built with PHP 8.4 and MySQL 8.0 for cPanel hosting.
Quick Download
ZIP File: tomsjavajive-php.zip
Features
Storefront
- 🛒 Shopping cart with session management
- 📦 Product catalog with categories, search, and filtering
- 💳 Checkout with multiple payment options
- 📱 PWA support (installable, offline capable)
- 👤 Customer accounts with order history
Admin Panel
- 📊 Dashboard with sales overview
- 📈 Advanced analytics with charts
- 🛍️ Product management (CRUD)
- 📋 Order management
- 💰 POS (Point of Sale) system
- 👥 Customer management with wallet
- ⭐ Review moderation
- 🎁 Gift cards & coupons
- ✉️ Email campaigns
- 📦 Inventory tracking
- 🚚 Shipping configuration
- 💳 Payment settings
- 👤 Admin user management
Integrations (Placeholder Keys - Configure in Admin)
- 📧 SendGrid - Transactional emails
- 📱 Twilio - SMS notifications
- 🔔 Push Notifications - Web push
- 🏆 Loyalty Program - 4-tier rewards system
- 💳 Stripe Payments - cURL-based (no Composer needed)
Installation
Requirements
- PHP 8.0+ (tested on 8.4.19)
- MySQL 8.0+
- Apache with mod_rewrite
Steps
-
Upload Files
- Extract the ZIP to your
public_htmlfolder - Or upload via FTP
- Extract the ZIP to your
-
Create Database
Log into phpMyAdmin Create a new database (e.g., `tomsjavajive`) -
Import Schema
- Go to phpMyAdmin > Import
- Select
install/schema.sql - Click "Go"
-
Run Migrations (for full features)
- Import
install/migration_v2.sql - Import
install/migration_v3.sql
- Import
-
Configure Database
- Edit
config/database.php:
define('DB_HOST', 'localhost'); define('DB_NAME', 'your_database_name'); define('DB_USER', 'your_username'); define('DB_PASS', 'your_password'); - Edit
-
Create Admin User
- Visit:
https://yoursite.com/create-admin.php - Or import the default admin from schema.sql:
- Email:
admin@tomsjavajive.com - Password:
admin123!
- Email:
- Visit:
-
Configure Site URL
- Edit
config/config.php:
define('SITE_URL', 'https://yoursite.com'); define('SITE_NAME', "Tom's Java Jive"); - Edit
-
Delete Installation Files (Security)
Delete: create-admin.php Delete: install/ folder (optional, keep for reference)
Directory Structure
/
├── admin/ # Admin panel pages
│ ├── assets/ # Admin CSS/JS
│ ├── includes/ # Admin header/footer
│ └── *.php # Admin pages
├── account/ # Customer portal
│ └── includes/ # Account layout
├── api/ # AJAX endpoints
├── assets/ # Frontend assets
│ ├── css/
│ ├── js/
│ ├── images/
│ └── icons/
├── config/ # Configuration files
├── includes/ # Core PHP files
│ ├── auth.php # Authentication
│ ├── db.php # Database connection
│ ├── email.php # SendGrid integration
│ ├── sms.php # Twilio integration
│ ├── push.php # Push notifications
│ ├── loyalty.php # Loyalty program
│ └── functions.php # Helper functions
├── install/ # Installation files
│ ├── schema.sql # Main database schema
│ ├── migration_v2.sql
│ └── migration_v3.sql
├── manifest.json # PWA manifest
├── sw.js # Service worker
└── *.php # Storefront pages
Configuring Integrations
SendGrid (Email)
- Get API key from https://app.sendgrid.com/settings/api_keys
- Admin > Settings > Integrations
- Enter API key, from email, and from name
Twilio (SMS)
- Get credentials from https://console.twilio.com/
- Admin > Settings > Integrations
- Enter Account SID, Auth Token, and Phone Number
Push Notifications
- Generate VAPID keys at https://web-push-codelab.glitch.me/
- Admin > Settings > Integrations
- Enter Public and Private keys
Loyalty Program Tiers
| Tier | Points Required | Multiplier | Key Benefits |
|---|---|---|---|
| Bronze Bean | 0 | 1x | Birthday reward |
| Silver Roast | 500 | 1.25x | Free shipping $25+ |
| Gold Blend | 1,500 | 1.5x | Free all shipping |
| Platinum Reserve | 5,000 | 2x | VIP benefits |
Redemption: 100 points = $1 wallet credit
Security Notes
- All passwords are hashed with
password_hash() - PDO prepared statements prevent SQL injection
- CSRF protection on forms
- XSS prevention via
htmlspecialchars() - Session-based authentication
Stripe Payment Integration
The app includes a cURL-based Stripe integration that works without Composer:
Features
- PaymentIntent API - Inline card element payments
- Checkout Sessions - Hosted Stripe payment page (redirect)
- Webhooks - Payment confirmation handlers
- Demo Mode - Works without API keys for testing
Setup
- Get your API keys from https://dashboard.stripe.com/apikeys
- Edit
config/config.php:define('STRIPE_SECRET_KEY', 'sk_live_your_key'); define('STRIPE_PUBLISHABLE_KEY', 'pk_live_your_key'); define('STRIPE_WEBHOOK_SECRET', 'whsec_your_secret');
Webhook Setup
- Stripe Dashboard > Developers > Webhooks
- Add endpoint:
https://yoursite.com/api/webhook.php - Select events:
payment_intent.succeeded,checkout.session.completed
Files
includes/stripe.php- Core Stripe API class (cURL-based)api/create-payment-intent.php- Create PaymentIntentapi/create-checkout-session.php- Create Checkout Sessionapi/payment-status.php- Poll payment statusapi/webhook.php- Handle Stripe webhooks
Support
For issues or feature requests, contact your developer.
License
Proprietary - All rights reserved.
Version: 2.0
Last Updated: December 2025
Description
Languages
PHP
91.9%
CSS
5.2%
JavaScript
2%
Python
0.5%
HTML
0.4%