Directory Structure

Table of contents

  1. Overview
  2. Directory Descriptions


1. Overview Table of Contents

This is the standard structure of a Chappy.php project. It follows a clean and modular layout to support MVC architecture, console commands, configuration, views, and static assets.

.
├── LICENSE
├── README.md
├── app
│   ├── Controllers
│   ├── CustomValidators
│   ├── Lib
│   ├── Models
│   ├── acl.json
│   ├── admin_menu_acl.json
│   ├── menu_acl.json
│   └── user_menu.json
├── composer.json
├── composer.lock
├── config
│   ├── config.php
│   ├── console.php
│   ├── database.php
│   ├── password.php
│   └── session.php
├── console
├── database
│   ├── database.sqlite
│   ├── migrations
│   └── seeders
├── docs
├── index.php
├── package.json
├── package-lock.json
├── public
├── resources
│   ├── css
│   ├── js
│   └── views
├── server.php
├── storage
│   ├── app
│   └── logs
├── tests
└── vite.config.js


2. Directory Descriptions Table of Contents

/app Contains your core application logic:

  • Controllers/ – Handle HTTP requests and business logic.
  • Models/ – Represent and interact with database tables.
  • CustomValidators/ – Custom form and data validators.
  • Lib/ – Shared libraries and helpers (e.g. console tools).
  • *.json – Access control configuration for dynamic menus and permissions.


/config

  • Holds framework and application config files such as database settings, session handling, and console definitions.


/console

  • Entry point for custom CLI commands using Chappy.php’s built-in console interface.


/database

  • Includes the SQLite file, migration scripts, and seeders used to set up and populate the database.


/docs

  • User-facing documentation, including Jekyll-based site content for GitHub Pages.


/public

  • The web server root. Contains front-end assets like logos and any public files accessible via URL.


/resources Framework-managed frontend resources:

  • css/ – App-specific stylesheets.
  • js/ – JavaScript files and frontend utilities.
  • views/ – PHP views organized by section (e.g., layouts/, components/).


/storage Used to store uploaded files and logs:

  • app/ – For private and public file uploads.
  • logs/ – Application and CLI logs.


/tests

  • Contains PHP unit test classes.


/index.php

  • Main entry point for the application, invoked by the web server.


/server.php

  • Used by the built-in PHP development server.


composer.json / package.json

  • Define PHP and JavaScript dependencies respectively.