Thanks to visit codestin.com
Credit goes to docs.platine-php.com

# Architecture

# Introduction

The default Platine application structure is intended to provide a great starting point for both large and small applications. But you are free to organize your application however you like. Platine imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class.

# The Root Directory

# The App Directory

The app directory contains the core code of your application. We'll explore this directory in more detail soon; however, almost all of the classes in your application will be in this directory.

# The Config Directory

The config directory, as the name implies, contains all of your application's configuration files. It's a great idea to read through all of these files and familiarize yourself with all of the options available to you.

# The Public Directory

The public directory contains the index.php file, which is the entry point for all requests entering your application and configures autoloading. This directory also houses your assets such as images, JavaScript, and CSS.

# The Storage Directory

The storage directory contains your logs, views templates, file based sessions, file caches, and other files generated by the framework. This directory is segregated into migrations, resource, and tmp directories. The migrations directory is used to store any files generated migrations and seeders files. The resource directory is used to store view templates and translation files. Finally, the tmp directory contains your application's log, session, cache files.

# The Tests Directory

The tests directory contains your automated tests. Example PHPUnit (opens new window) unit tests and feature tests are provided out of the box. Each test class should be suffixed with the word Test. You may run your tests using the phpunit or php vendor/bin/phpunit commands.

# The Vendor Directory

The vendor directory contains your Composer (opens new window) application dependencies.

# The App Directory

The majority of your application is housed in the app directory. By default, this directory is namespaced under Platine\App and is autoloaded by Composer using the PSR-4 autoloading standard (opens new window).

The app directory contains a variety of additional directories such as Console, Http, Model and Provider. Think of the Console and Http directories as providing an API into the core of your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but do not actually contain application logic. In other words, they are two ways of issuing commands to your application. The Console directory contains all of your Platine commands, while the Http directory contains your Actions (controllers), middleware.

# The Console Directory

The Console directory contains all of the custom Platine commands for your application.

# The Exception Directory

The Exception directory contains your application's exception and is also a good place to place any exceptions thrown by your application. In this directory you already have the application base exception class Platine\App\Exception\ApplicationException, it's recommended that all the application Exception extend this base class.

# The Http Directory

The Http directory contains your actions (controllers) and middleware. Almost all of the logic to handle requests entering your application will be placed in the Action directory.

# The Model Directory

The Model directory contains all of your Entities and Repositories classes. The ORM included with Platine provides a beautiful, simple Data mapper implementation for working with your database. Each database table has a corresponding "Entity" and "Repository" which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.

# The Provider Directory

The Provider directory contains all of the service providers for your application. Service providers bootstrap your application by binding services in the container, registering events, routes, commands or performing any other tasks to prepare your application for incoming requests.

In a fresh Platine application, this directory will already contain several providers. You are free to add your own providers to this directory as needed.