Overview

XenoPHP follows a strict Model-Controller (MC) architecture optimized for high-performance APIs and backend services. This page details the purpose of each directory and key file.

app/ Application Logic
Http/ Controllers ("C")
Models/ Models ("M")
Core/ Framework Core (Console, Http, Models, Providers, Routes)
bootstrap/ Framework bootstrapper
config/ Application configuration files
database/ Migrations, seeds, and factories
DocHTML/ This documentation
node_modules/ Node.js dependencies (for dev tools)
packages/ Library packages
public/ Web entry point (index.php) and assets
routes/ API Route definitions
storage/ Logs, compiled caches, file storage
tests/ Automated tests
vendor/ Composer dependencies
.env Environment variables
composer.json PHP Dependency map
package.json Node types and scripts
xeno XenoPHP CLI executable

Core Directories

app/

The heart of your application, containing the "Model-Controller" logic:

  • Http/Controllers/: The "C" in MC. Handles incoming API requests.
  • Models/: The "M" in MC. Database interactions and logic.

Core/

The framework's engine room, separate from user code:

  • Console/: Custom CLI commands.
  • Http/: Core Middleware and API Controllers.
  • Models/: Core Models (e.g., AccessLog).
  • Providers/: Service providers.
  • Routes/: Internal routes.

routes/

Contains your API route definitions.

  • api.php - Defines API endpoints (JSON responses).

Note: Internal routes (console, web fallbacks) are located in Core/Routes.

database/

  • migrations/ - Database schema structure definitions.
  • seeders/ - Classes to populate database with initial data.
  • factories/ - Logic to generate fake data for testing.

Configuration files

config/

All of your application's configuration files are stored here. Notable files:

  • app.php - Main app settings (Timezone, Locale, Key).
  • database.php - Database connections (MySQL, SQLite, etc).
  • cors.php - Cross-Origin Resource Sharing settings (Vital for APIs).

root files

  • .env - Local environment variables (Database credentials, API keys).
  • xeno - The command line interface script. Run it with php xeno.