BestDigitalCard documentation

Self-hosted digital visiting card platform. Upload, install, publish QR cards. Design and Developed by MediaByteX.

Open this file from the unzipped package: Documentation/index.html. Plain text: README.txt in the zip root. If you install the optional demo content (database/demo-data.sql), the live dummy cards are /business-card, /menu-card, /appointment-card, /catalog-card. database/database.sql alone contains tables, plans and settings only — no default accounts.

Welcome

BestDigitalCard is a plain PHP + MySQL script. Customers register, choose a plan, and publish a mobile card with WhatsApp, QR, vCard, PDF, reviews, leads, menu, catalogue or appointments.

There is no Composer, no Node, no build step. Point the domain at the project root and run the installer.

Author: MediaByteX  ·  Version: 1.0.3

Requirements

Recommended PHP limits (also in .htaccess when PHP runs as Apache module):

upload_max_filesize = 20M
post_max_size       = 64M
max_file_uploads    = 100
max_input_vars      = 5000
memory_limit        = 256M

Installation

A. Web installer (recommended)

  1. Unzip the package. Upload every file inside the source folder to the web root (public_html, www, or htdocs). Keep the folder structure. On the server you must see index.php, app/, install/ and database/.
  2. Create an empty MySQL database and a user with all privileges on that database (cPanel → MySQL Databases).
  3. Visit https://your-domain.com/install/
  4. Enter host, database name, user, password, site URL and site name.
  5. Administrator account: enter your admin name, email and your own strong password twice. There is no default password. The password must have at least 10 characters with an uppercase letter, a lowercase letter, a number and a symbol (common passwords such as Admin@123 are rejected). It is stored with password_hash().
  6. Demo content (optional): tick Install demo content only if you want the 4 dummy cards, a demo customer account and coupon WELCOME20. It is off by default. When ticked, the demo customer (demo@example.com) gets a random password that is shown once on the success page.
  7. Click Install BestDigitalCard. The wizard writes .env, imports database/database.sql (and database/demo-data.sql if ticked), creates your administrator and upload folders, then writes install/installed.lock.
  8. If the lock file cannot be written, the installer shows an error instead of “finished”. Make install/ writable (or create an empty install/installed.lock, or delete the install/ folder).
  9. Open /app/Admin/login.php and sign in with the email and password you chose.
Reinstall protection. The installer refuses to run when install/installed.lock exists or when the database already contains an administrator (or the installed_at flag). Deleting the lock file alone does not re-open it. To start over, use a new, empty database.

B. Manual install (phpMyAdmin)

  1. Create database bestdigitalcard (utf8mb4_unicode_ci).
  2. Import database/database.sql (tables, plans, settings — no default accounts). It contains no administrator account, no default password, no demo cards, no demo customer and no coupons.
  3. Optional: import database/demo-data.sql for the 4 dummy cards, the demo customer and coupon WELCOME20. When imported by hand the demo customer has no usable password (it only owns the showcase cards).
  4. Copy .env.example to .env and set DB_HOST, DB_USER, DB_PASS, DB_NAME, CRON_KEY.
  5. Create your first administrator with the one-time setup tool (it refuses to run once an administrator exists, and locks the installer afterwards):
    • SSH / CLI: php install/create-admin.php — asks for email, name and password (hidden, typed twice).
    • Browser (no SSH): add SETUP_TOKEN= followed by a random secret of 32+ characters to .env, open https://your-domain.com/install/create-admin.php, enter the same token, your email and a strong password, then remove SETUP_TOKEN from .env.
  6. Make uploads/ and logs/ writable (0755 or 0775).
  7. Enable rewrite. Visit the site URL.
cp .env.example .env
# edit DB_* values
mysql -u USER -p bestdigitalcard < database/database.sql
mysql -u USER -p bestdigitalcard < database/demo-data.sql   # optional
php install/create-admin.php                                 # first admin (one time)

Nobody can sign in to the admin panel until the first administrator has been created this way (or by the web installer).

C. Upgrading

From v1.0.2: upload the v1.0.3 files (keep .env and uploads/). No database changes, no SQL import needed.

From v1.0.0 / v1.0.1:

  1. Back up your files and database.
  2. Upload the v1.0.2 files over the old ones (keep your .env and uploads/).
  3. Import database/upgrade-1.0.2.sql once. It re-opens orders left in the old processing state so they can complete, adds unique keys so one gateway order can never own two subscriptions, and marks the database as installed.
  4. All admins sign in again once. If you still use the old default admin password, change it now in Admin → Admins.
Do not upload a real .env from your PC. The installer creates one on the server. After install, delete or protect /install/ if you want; the lock file already blocks a second run.

Nginx (if you are not on Apache)

location ~ /\.(env|git) { deny all; }
location ~ ^/(core|cron|logs|database)/ { deny all; }
location / {
    try_files $uri $uri/ @cardrouter;
}
location @cardrouter {
    rewrite ^/([a-zA-Z0-9][a-zA-Z0-9_-]{1,80})$ /card.php?slug=$1 last;
}

Logins & optional demo content

RoleEmailPasswordURL
Adminthe email you enteredthe password you chose (no default)/app/Admin/login.php
Demo customer (optional)demo@example.comrandom, shown once by the installer (manual SQL import: login disabled)/app/Auth/login.php

The demo content is only present if you ticked Install demo content or imported database/demo-data.sql. Dummy published cards (homepage “View live demo” uses these slugs):

Without demo content, the homepage “View live demo” buttons open “card not found” until you publish your own cards with these slugs (or edit the links in index.php).

Delete the demo customer (Admin → Users) and coupon WELCOME20 before going live. Dummy names, phones and UPI IDs are sample data only.

First 10 minutes after install

  1. Log in as admin → Site Settings.
  2. Set site name, logo, site URL, support email and WhatsApp.
  3. Turn Email verification on only after SMTP works (default is off so registration works without mail).
  4. Add Razorpay / Cashfree / manual UPI if you sell plans.
  5. Edit plans and prices under Plans.
  6. Register a test customer (or, if demo content was installed, log in as the demo customer) and open My Cards to see the editor.
  7. Create your own card. If demo content was installed, delete the dummy cards, demo customer and coupon WELCOME20 when you go live.

Admin panel

Path: /app/Admin/

User panel

Path: /app/User/ after /app/Auth/register.php or login.

A card is public only when it is published, the user is active, and (for paid plans) a subscription is active and not expired.

Card types

TemplateFileBest for
business-cardapp/Card/3-business-card.phpConsultants, agencies, shops
menu-cardapp/Card/1-menu-card.phpRestaurants, cafes
appointment-cardapp/Card/4-appointment-card.phpSalons, clinics
catalog-cardapp/Card/2-catalogue-card.phpProduct sellers

Pretty URL: https://your-domain.com/your-slug rewrites to card.php?slug=your-slug.

Payments

Enable gateways in Admin → Settings → Payments. Webhooks:

APP_ENV=production in .env disables demo “activate without pay”. Keep that value on a live server.

Email / SMTP

Admin → Settings → Email. Host, port (587 TLS or 465 SSL), username, password, from name/email.

Until SMTP is saved, PHP mail() is used and often fails on shared hosting. Leave email verification off until a test password-reset arrives.

Cron jobs

Both scripts accept CLI or HTTPS with CRON_KEY from .env.

0 2 * * * php /path/to/cron/subscription-check.php
0 3 * * 0 php /path/to/cron/cleanup-logs.php

# or
https://your-domain.com/cron/subscription-check.php?key=YOUR_CRON_KEY

Subscription cron expires plans and sends 7-day / 1-day reminder emails when SMTP works.

Rebranding / reskin

Change the public brand without rewriting PHP logic. Do these in order.

  1. Name, tagline, logo, support contacts — Admin → Site Settings. Logo: PNG or JPG, about 400×400 px.
  2. Landing accent colour — edit the :root CSS variables at the top of index.php. Default accent is #16a34a.
  3. Admin panel — resources/css/admin-panel.css
  4. User panel — resources/css/user-panel.css
  5. Public cards — resources/card_assets/css/card.css and template JS in resources/card_assets/js/pages/
  6. Dummy cards (only if the optional demo content was installed) — Admin → Cards, or delete the demo@example.com customer in Admin → Users. Create your own card before launch.
  7. Legal pages — legal.php already uses the site name from settings.
  8. Accounts — the admin password is set by you during install; delete the optional demo customer before launch.

Author credit (MediaByteX) lives in core/Config/author.php, source comments, and the card footer. The product name in Admin → Settings is independent of that credit.

/* Design and Developed by MediaByteX */

Folder map

README.txt        English documentation (zip root)
START-HERE.txt    One-page quick start
LICENSE.txt       License + third-party credits
CHANGELOG.txt     Version history
Documentation/    This HTML guide + INSTALLATION.txt
database/         database.sql (tables, plans, settings — no default accounts),
                  demo-data.sql (optional: 4 dummy cards, demo customer, WELCOME20),
                  upgrade-1.0.2.sql
source/           Upload THIS folder to public_html

--- inside source/ (what you upload) ---
install/          Web installer + create-admin.php (both lock after success)
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)
.env.example      Copy to .env
app/Admin         Admin pages
app/Auth          Login, register, password reset
app/User          Customer dashboard
app/Card          Four public templates + partials
core/Config       database.php, site.php, author.php
core/Helpers      mailer, SEO, card save, uploads
cron/             Subscription + log cleanup
resources/        CSS, JS, card artwork, blog posts
uploads/          User media (keep writable)
logs/             PHP error log folder

Troubleshooting

Installer or homepage says service unavailable. Wrong DB details in .env, or database/database.sql not imported. Check logs/php_errors.log.

Pretty URLs 404. Enable mod_rewrite and AllowOverride All for the vhost. Confirm .htaccess uploaded.

Blank page after install. PHP version below 8.1, or a missing extension. The installer lists checks.

Cannot write .env. Make the web root writable for one install, or create .env yourself from .env.example.

Uploads fail. Folder permissions on uploads/. On PHP-FPM, raise upload_max_filesize in php.ini (htaccess php_value is ignored).

Card says not found. Not published, user inactive, or paid plan with no active subscription.

Emails never arrive. Fill SMTP. Test with forgot-password on your own test customer account.

Installer says “already installed”. The lock file exists or the database already has an administrator. This is the reinstall protection; use a new, empty database for a fresh install.

Installer says the lock file could not be written. Make install/ writable, or create an empty install/installed.lock, or delete the install/ folder.

Admin was logged out unexpectedly. Since v1.0.2 every admin request is checked against the database. Deactivating, deleting or changing the password of an admin ends that admin’s sessions immediately.

Homepage images missing. Keep uploads/misc/*.png from the package (hero, about, review, pdf-card, WhatsApp, manage-reviews).

Credits

Full PHP source. No ionCube, no encoded files, no Composer packages. License terms: LICENSE.txt.

Changelog

v1.0.3

v1.0.2

v1.0.1

v1.0.0

Support

MediaByteX

Support is provided through this marketplace's item comments/messages.

When you write, include: domain, PHP version, a screenshot, and the last lines of logs/php_errors.log.

© BestDigitalCard · Design and Developed by MediaByteX