Directory Structure

myapp/
├── application/                 # Domain code
│   ├── _Global.php              #   Application globals (extends BaseGlobal)
│   ├── _Const.php               #   Application constants
│   ├── _Config.php              #   Base configuration, including data sources
│   ├── _Config/                 #   Stage-specific configuration (alpha · beta · production, see README.md)
│   └── <Namespace>/             #   Models and DAOs
├── public/                      # ← document root
│   ├── .htaccess
│   ├── __flexagon.php           #   Front controller for all requests
│   ├── _entry.php               #   Request-start hook
│   ├── _prepare.php             #   Post-session hook
│   ├── _router.php              #   Dispatch point
│   ├── _Template/               #   Shared templates (head · tail · error404)
│   └── **/*.php                 #   Pages mapped 1:1 to URLs
├── script/                      # CLI jobs
├── docker/                      # Container setup (Apache · entrypoint · php.ini)
├── .env.example.php             # Example .env.php (the secret keys)
├── Dockerfile                   # dev · alpha · beta · production targets
├── compose.yaml                 # Containers for local development
├── build.xml                    # Deploys without containers (ant production)
├── composer.json
├── flexagon.php                 # Bootstrap loader
└── vendor/
    └── flexagon/framework/      # Framework core

Under application/, namespaces map directly to directory paths. ExampleUser\UserDAO → application/ExampleUser/UserDAO.php.

The _Flexagon\ namespace resolves to the framework itself and normally does not need to be defined by the application.

Expose only public/ to the web. The project root holds secrets in .env.php and application/ holds settings and code; if the document root points to the project root, they may be served as is.