Skip to content

Application anatomy

After creating an application named myapp, the following directory structure is created under projects/:

projects/
└── myapp/
    ├── config.json          ← DB connection parameters and app description
    ├── .jwt_secret          ← JWT signing secret (auto-generated, chmod 0600)
    ├── .htaccess            ← blocks web access to config.json and .jwt_secret
    ├── backups/             ← database backup files
    ├── db/
    │   └── bdus.sqlite      ← SQLite database (only for the sqlite engine)
    ├── export/              ← temporary export files (CSV, JSON, XLSX)
    ├── files/               ← uploaded record attachments
    └── geodata/             ← local GeoJSON/KML files for GeoFace layers

Welcome text

The editable welcome page (formerly welcome.md) is stored in the database, in the welcome column of bdus_cfg_app. It is managed through the application's home page editor.

System tables

All system tables are created automatically and prefixed with bdus_. User-defined data tables have no required prefix.

TablePurpose
bdus_api_keysAPI key authentication
bdus_cfg_appApp-level settings (status, max image size, welcome text)
bdus_cfg_fieldsField configuration
bdus_cfg_geofaceGeoFace / map layer configuration
bdus_cfg_relationsCross-table relation definitions
bdus_cfg_tablesTable configuration
bdus_cfg_templatesPrint templates (Twig source)
bdus_chartsUser-defined charts
bdus_file_linksFile ↔ record associations
bdus_filesUploaded file metadata
bdus_geodataGeospatial features (WKT geometry)
bdus_logApplication log entries
bdus_migrationsApplied migration tracking
bdus_queriesSaved search queries
bdus_rsStratigraphic relation pairs
bdus_userlinksManual cross-record links
bdus_usersUser accounts
bdus_user_table_privsPer-user per-table privilege overrides
bdus_versionsRecord version snapshots
bdus_vocabulariesControlled vocabulary items
bdus_zotero_libsZotero library connections
bdus_zotero_linksCitation links between records and Zotero items

config.json

Stores the database engine, connection parameters, and the app description. For SQLite it looks like:

json
{
  "definition":  "My archaeological database",
  "db_engine":   "sqlite",
  "db_host":     null,
  "db_port":     null,
  "db_name":     null,
  "db_username": null,
  "db_password": null
}

For MySQL or PostgreSQL, db_host, db_port, db_name, db_username, and db_password contain the actual connection details.

WARNING

config.json and .jwt_secret are protected by .htaccess and must never be committed to version control or served publicly.