Strata Framework Documentation

Documentation Index

  • Quick Start
  • Features
  • Structure
  • Security
  • User & Admin System
  • Extending & Modules
  • Creating Your Own Modules (guidelines)
  • AJAX Endpoints
  • Planned Features
  • Release Notes

Quick Start

  1. Clone or download this repository.
  2. Change directory to the project root.
  3. Install Composer dependencies:
    cd htdocs
    composer install
  4. Set up your web server to use htdocs as the document root.
  5. Copy or edit htdocs/app/config.php for your environment (database, mail, theme, etc).
  6. Visit your site in the browser!

Database Installation Guide

  1. Create a new MySQL database (e.g., 1f_test)
  2. Import the schema using phpMyAdmin, MySQL Workbench, or the command line:
    mysql -u username -p database_name < mysql/db_instal.sql
  3. Run migrations (optional but recommended):
    php bin/migrate.php
  4. Create your first admin user:
    php bin/create_admin.php

    What’s Included: Only essential tables for a fresh install. No user, admin, or demo data—users start with a clean slate. Ready for migrations and admin creation.

    Next Steps: Log in as admin and configure your site. Add modules, users, and content as needed.

Features

  • Modular architecture: Easily add or remove modules (user system, forum, etc.)
  • Unified DB class: All database access uses the PDO-based DB class
  • Admin & user systems are independent
  • User authentication: Registration, login, profile, password reset (with token expiry)
  • Admin login & profile: Separate admin authentication, dashboard, and profile page
  • Email integration: Uses PHPMailer
  • CSRF protection: Automatic for all forms via the TokenManager class
  • Session management: Robust, secure, auto-started in app/start.php
  • Logging: Security/auth events logged to storage/logs/ via the Logger class
  • Dynamic navigation: Shows login/register/user menu based on config and session
  • Extensible: Add new modules in /htdocs/modules/
  • Admin links management: Add, edit, delete, and reorder links in the admin panel, with FontAwesome icon auto-detection and NSFW marking
  • NSFW support for links: Mark links as NSFW in the admin panel; public users must confirm before visiting NSFW links
  • Module enable/disable UI: Admin panel allows enabling/disabling modules and selecting the default module for the root page

Structure

  • htdocs/ — All PHP code, configs, and assets live here
  • app/ — Config, core classes, utilities
  • controllers/ — Controllers (one per route)
  • models/ — Data models
  • views/ — View templates and partials
  • themes/ — Theme folders (assets, custom views)
  • storage/ — Logs, uploads, and other runtime files
  • vendor/ — Composer dependencies (auto-generated)
  • htdocs/modules/ — Modular features (user system, forum, etc.)

Security & Customization

  • CSRF tokens are auto-generated and checked for all forms
  • Session is started automatically in app/start.php
  • Password reset uses secure tokens and expiry
  • Logging for security/auth events
  • Navigation adapts to user state and config
  • Configure mail settings in app/config.php
  • Extending: Add new modules, controllers, models, views, and assets as needed

Database Migrations & Seeding

  • Forward migrations: php bin/migrate.php
  • Rollback: php bin/rollback.php [steps]
  • Migration status: php bin/migration_status.php
  • Migration locking and logging
  • Migration generator: php bin/create_migration.php MigrationName
  • Seeding: php bin/seed.php
  • De-seeding: php bin/seed.php --down
  • Seed generator: Create your own seed and down seed files in the seeds/ directory

See the bin/ and migrations/ folders for more details and examples.

NSFW Links & Admin Links Management

  • Mark any link as NSFW in the admin panel (checkbox in add/edit forms)
  • NSFW links show a badge in admin and public views
  • Public users must confirm before visiting NSFW links (JS confirmation dialog)
  • Add, edit, delete, and reorder links from the admin panel
  • FontAwesome icon auto-detection for popular domains
  • NSFW marking and badge support
  • Enable or disable modules from the admin panel UI
  • Select the default module for the root page