Basics

This page is intended to quickly run through the very basics of the file and directory structure. This is extensively based off via the Basics section of the documentation. The below table gives a quick rundown of the directories an Apex installation consists of.

Directory Description
boot Contains various configuration files that are loaded while bootstrapping Apex during a request such as DI container services, HTTP routes, and others.
docs All documentation for all packages, one sub-directory per-package.
etc Configuration files and database migrations for all packages, one sub-directory per-package.
public Public facing directory where all HTTP requests are routed to. Bare bones, only contains an index.php file to bootload Apex and the various Javascript / CSS / image files necessary.
src Contains all actual source code of all packages, one sub-directory per package.
storage Default storage location of all files that need to be stored, plus also includes the log files.
tests All unit tests, one sub-directpry per package.
vendor Standard Composer vendor directory that contains all dependencies.
views Contains all views, both HTML and PHP files for each, plus all theme and layout related files.

/boot/ Directory

The /boot/ directory contains various global configuration and other files as explained in the below table:

file Description
docker/ All necessary files for the Docker installation process.
init/ All necessary files for the initialization for both, runtime and test runs.
cluster.yml Utilizes the Apex Cluster package to provide event listeners, dispatchers, and horizontal scaling among other things.
container.php Defines the various PSR compliant and other services that are used by Apex and where they are located. This includes things such as cache, e-mailer, HTTP router, and more.
routes.yml Contains all HTTP routes utilized. Full information can be found on the HTTP Router page of the developer documentation.
site.yml Basic site configuration file that defines things such as the themes to use for different areas of the site, user groups, and so on.

apex CLI Tool

Within the installation directory there is also an apex PHP script which is a powerful CLI tool and is important to Apex based development. It contains 138 commands that consist of everythinh including but not limited to, package and branch management, code generation utilities, Chat GPT integration, and much more. You may view full deatils on the apex CLI Commands section of the developer documentation.

Service Container

Apex includes an easily accessible services container that contains various PSR compliant and other services which is governered by the /boot/container.php file. All services are easily accessible via the Apex\Svc\ namespace as explained within the Service Container page of the developer documentation.