This repository contains the public web app for the AI business card service.
- PHP (server-rendered pages + API endpoints)
- MySQL
- Stripe (payment, subscriptions, billing portal, bank transfer)
- Plain JavaScript / CSS
backend/api/- API endpointsbackend/config/- app and DB configbackend/includes/- shared helpers/functionsbackend/database/- schema and migrationsassets/- frontend JS/CSS/images- project root (
*.php) - public pages
At minimum, ensure these are configured in environment/config:
STRIPE_SECRET_KEYSTRIPE_PUBLISHABLE_KEYSTRIPE_WEBHOOK_SECRETSTRIPE_BILLING_PORTAL_CONFIGURATION_ID(optional; used when set)- DB credentials (
backend/config/database.phpusage)
Also ensure BASE_URL is correct for your environment.
- Initial payment is created via
backend/api/payment/create-intent.php. - Monthly subscription is created/linked through Stripe.
- Card update is done through Stripe Billing Portal:
- API:
backend/api/mypage/billing-portal-session.php - UI button: shown in
edit.phpwhen subscription/payment conditions are met.
- API:
- Bank transfer info page:
bank-transfer-info.php - For new-user initial bank transfer, current behavior is:
- initial fee + annual fee are combined in one transfer request.
- Renewal bank transfer uses renewal pricing path.
business_cards.url_slugnow uses a random alphanumeric string generator.- Generation helper:
generateUniqueBusinessCardUrlSlug()inbackend/includes/functions.php. - Existing slugs remain unchanged; only newly generated records use the random format.
Run required migrations before deploying features that depend on them, especially:
backend/database/migrations/add_payment_type_renewal.sqlbackend/database/migrations/add_payments_renewal_subscription_extended.sql
Keep backend/database/schema.sql in sync with production DB changes.
- Stripe mode must match keys and data (test vs live).
- If Stripe IDs exist in DB but not in the same Stripe mode, billing portal and subscription operations fail.
- Avoid manual insertion of Stripe object IDs unless they are real objects in the same Stripe account/mode.
- PHP syntax checks:
php -l backend/api/payment/create-intent.phpphp -l backend/api/payment/webhook.phpphp -l edit.php
- Verify webhook delivery in Stripe Dashboard and application logs.