BestDigitalCard — installation and usage (plain text)
Design and Developed by MediaByteX

This file is English text documentation. Also open
Documentation/index.html in a browser. Root README.txt has the same steps.

================================================================
ZIP LAYOUT
================================================================

    README.txt         Zip root — read this first
    Documentation/     This guide
    database/          database.sql (tables, plans, settings — no default accounts)
                       demo-data.sql (OPTIONAL: 4 dummy cards, demo customer, WELCOME20)
                       upgrade-1.0.2.sql (installs older than v1.0.2 only)
    source/            Upload this folder to public_html

================================================================
1. REQUIREMENTS
================================================================

PHP 8.1+
MySQL 5.7+ or MariaDB 10.3+ (utf8mb4)
Apache 2.4 with mod_rewrite, AllowOverride All
Extensions: mysqli, mbstring, openssl, json, curl, gd
Writable folders: uploads/  logs/

================================================================
2. WEB INSTALLER
================================================================

1. Unzip the package.
2. Upload every file INSIDE source/ to public_html.
   The server root must contain index.php, app/, install/, database/.
3. Create a MySQL database and a user with all privileges on it.
4. Visit https://YOUR-DOMAIN/install/
5. Enter host, database name, user, password, site URL, admin name, admin
   email and YOUR OWN strong admin password (typed twice). There is no
   default password: 10+ characters, uppercase, lowercase, number, symbol.
6. Optional: tick "Install demo content" (off by default) for 4 dummy cards,
   coupon WELCOME20 and a demo customer with a random one-time-shown password.
7. Click Install BestDigitalCard.

The wizard writes .env, imports /database/database.sql (+ demo-data.sql if
ticked), creates your administrator and locks itself with
install/installed.lock. If the lock cannot be written it shows an error,
not success. It also refuses to run again when the database already has an
administrator, even if installed.lock is deleted.

================================================================
3. MANUAL INSTALL (phpMyAdmin)
================================================================

1. Create database bestdigitalcard (utf8mb4_unicode_ci).
2. Import database/database.sql from this zip (tables, plans, settings —
   no default accounts, no demo cards, no coupons).
3. Optional: import database/demo-data.sql (4 dummy cards, demo customer with
   login disabled when imported manually, coupon WELCOME20).
4. Copy source/.env.example to .env on the server.
   Set DB_HOST, DB_USER, DB_PASS, DB_NAME, CRON_KEY
5. Create the first administrator ONCE:
       php install/create-admin.php
   or, without SSH: put SETUP_TOKEN=<random 32+ chars> in .env, open
   /install/create-admin.php, enter the token + email + strong password,
   then remove SETUP_TOKEN. The tool refuses to run once an admin exists.
6. chmod 775 uploads logs
7. Enable rewrite. Visit the site.

    mysql -u USER -p bestdigitalcard < database/database.sql
    mysql -u USER -p bestdigitalcard < database/demo-data.sql   (optional)
    php install/create-admin.php

Upgrading from 1.0.2: upload the files only (no SQL).
Upgrading from 1.0.0 / 1.0.1: import database/upgrade-1.0.2.sql once.

================================================================
4. LOGINS AND OPTIONAL DEMO CONTENT
================================================================

Admin   your email / the password you chose   /app/Admin/login.php
Demo    demo@example.com / random, shown once  /app/Auth/login.php
        (only if demo content was installed)

Dummy cards (demo content only):
    /business-card
    /menu-card
    /appointment-card
    /catalog-card

Delete the demo customer and coupon WELCOME20 before you go live.

================================================================
5. FIRST 10 MINUTES
================================================================

1. Admin → Site Settings: name, logo, site URL, support email, WhatsApp.
2. Leave email verification OFF until SMTP works.
3. Add Razorpay / Cashfree / manual UPI if you sell plans.
4. Edit plan prices under Plans.
5. Register a test customer and open My Cards to see the editor.
6. Create your own card. If demo content was installed, delete the dummy
   cards, demo customer and coupon WELCOME20 when you launch.

================================================================
6. HOW TO USE
================================================================

Admin panel  /app/Admin/
    Users, cards, plans, coupons, SMTP, payments, maintenance, error log.

User panel   /app/User/
    Create/edit cards, leads, reviews, Google review QR, invoices, checkout.

Public card  /your-slug
    WhatsApp, call, vCard, PDF, menu, catalogue, appointments, reviews, leads.

================================================================
7. REBRAND / RESKIN
================================================================

Product name, logo, tagline     Admin → Site Settings
Landing accent colour           source/index.php  :root CSS variables
Admin panel CSS                 source/resources/css/admin-panel.css
User panel CSS                  source/resources/css/user-panel.css
Public card CSS                 source/resources/card_assets/css/card.css
Dummy cards (demo content only) delete or edit in Admin → Cards
Legal pages                     follow the site name from settings
Author credit                   source/core/Config/author.php (MediaByteX)

Logo size: about 400×400 PNG.

================================================================
8. PAYMENTS, EMAIL, CRON
================================================================

Webhooks:
    /app/User/razorpay-webhook.php
    /app/User/cashfree-webhook.php

APP_ENV=production disables demo pay.

SMTP: Admin → Settings → Email. Port 587 TLS or 465 SSL.

Cron:
    0 2 * * * php /path/to/cron/subscription-check.php
    0 3 * * 0 php /path/to/cron/cleanup-logs.php
    or HTTPS with ?key=CRON_KEY from .env

================================================================
9. SUPPORT
================================================================

MediaByteX
Support is provided through this marketplace's item comments/messages.
Include domain, PHP version, screenshot, logs/php_errors.log

License: LICENSE.txt in the zip root.
Changelog: CHANGELOG.txt in the zip root.
