Deploying

Deploying xCRUDNova

What a fresh install actually needs, end to end.

1. Requirements

  • PHP 8.1+ with the pdo_mysql extension.
  • MySQL or MariaDB.
  • Apache with mod_rewrite enabled (nginx works too, with an equivalent rewrite rule - see step 3).
  • No build step, no Composer install, no npm - everything ships ready to run.

2. Database connection

One file: src/Config.php. Set $dbHost/$dbName/$dbUser/$dbPass there, and review $blacklistedTables/$blacklistedColumns in that same file against your OWN schema before going further - every real table is reachable through the CRUD engine by default (nothing to register per table first), so anything that should never be touched generically needs to be listed there explicitly.

3. Web server rewrite rule

Every request routes through one entry point, core/router.php - the .htaccess at the project root already has this, nothing to write by hand for Apache:

DirectoryIndex core/router.php

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ core/router.php?xcrud_route=$1 [QSA,L]

4. Where things live

  • core/ - the request entry points (router, the ajax API, auth, uploads) and the client-side xcrud.js.
  • src/ - the PHP class library (Xcrud, the config classes, and friends).
  • pages/ - one file per route; each just configures an Xcrud instance (see "Simple app, 3 lines of code").
  • core/functions.php - hook functions (before_insert(), column_callback(), ...), loaded automatically by route.

5. Enabling the role/menu/login layer

Import sql/xcrud_pro.sql into your database, then set XcrudConfig::$loginAuthentication = true; - this is what turns on the dashboard shell, roles, and the sidebar menu you are looking at right now.

That is the whole deployment - continue to Simple app, 3 lines of code to see the smallest possible page.

Notifications
No notifications yet.
Account
X
xCRUD Nova
visitor