Skip to main content
Version: 4.x

BowPHP Structure

Overall structure​

BowPHP follows the MVC (Model View Controller) pattern.

FolderDescription
appContains the core logic of your application. Almost all of your application's classes will be in this folder
frontendContains the application's scripts and style files. Among other things, it contains the js, sass, and lang folders. This is where you put your static files and then compile them
templatesContains your application's views
configContains the various configuration files for the application's components.
migrationsFolder in which your application's migrations are saved
seedersFolder in which your application's seedings are saved
publicThe front controller and the compiled files are stored in this folder.
routesContains your application's routes
varContains the folder in which the cache, log, and storage of files uploaded through Bow's Storage system are saved.
testsContains the application's tests.

app folder​

This is your working directory in Bow. This is where you put all of your application's files.

Here you will find the following folders:

  • Configurations: Folder in which the application's custom configurations are saved.
  • Controllers: Folder in which the application's controllers are saved.
  • Middlewares: Folder in which the application's middlewares are saved.
  • Events: Folder in which the events generated by Bow Console are saved.
  • Models: Folder in which the application's models are saved.
  • Validations: Folder in which the application's validations are saved.
  • Exceptions: Folder in which the application's custom exceptions are saved.
  • Services: Folder in which the services generated by Bow Console are saved.

You will also find the following files:

  • Kernel.php: The configuration of the application launcher.

frontend folder​

This is where you put all the files that are used in your application's views. You will find the following folders here:

  • js: Your Javascript files are saved here.
  • sass: Your scss files are saved here.
  • lang: Folder in which your application's locales are saved.

See the webpack.mix.js section

migrations and seeders folders​

  • migrations: Groups together all of the database migration files.
  • seeders: Groups together all of the files used to insert test data into your database.

var folder​

Here, Bow will store the log files and the cache of your application. You will find the following folders here:

  • storage: Folder in which the application saves the application's uploaded files
  • logs: Folder in which the application's logs are saved.
  • session: Folder in which the application's session files are saved.
  • cache: Folder in which the application saves the application's caches
  • view: Folder in which the application saves the compilation cache of the views

tests folder​

Here, you will store your unit test files. And for the sake of good practice, we have:

  • Http: Your Http test files are saved here
  • Unity: Your Unity test files go here

Is something missing?

If you run into problems with the documentation or have suggestions to improve the documentation or the project in general, please open an issue for us, or send a tweet mentioning the Twitter account @bowframework or directly on github.