Project Structure
A guided tour of every directory in a Nibiru project.
my-app/├── core/ # Framework code (don't edit)│ ├── a/ # Abstract classes + adapters│ ├── c/ # Concrete classes (router, view, form types…)│ ├── f/ # Factories (db, form)│ ├── i/ # Interfaces│ ├── l/ # Composer vendor (yes, in core/)│ ├── t/ # Traits│ └── framework.php # Main bootstrap├── application/ # Your app│ ├── controller/ # *Controller.php files│ ├── model/ # Auto-generated models (from DB schema)│ ├── module/ # Modules (the second M in MMVC)│ │ └── users/ # each with its own MVC + plugins│ ├── settings/│ │ └── config/│ │ ├── settings.<env>.ini│ │ ├── database/ # numbered SQL migration files│ │ └── navigation/main.json│ └── view/│ ├── templates/ # Smarty .tpl files│ ├── templates_c/ # Smarty compile cache (auto)│ ├── cache/ # HTML cache (when caching=true)│ └── mockup/ # Static design mockups├── public/ # CSS / JS / images / fonts (web-served)├── nibiru # CLI binary├── index.php # Entry point├── composer.json└── vhost.conf # Sample nginx vhostNotable conventions
Section titled “Notable conventions”Controllers
Section titled “Controllers”- File:
application/controller/<name>Controller.php - Class:
Nibiru\<name>Controller extends Nibiru\Adapter\Controller - Required methods:
pageAction(),navigationAction(). Optional: any<verb>Action().
- File:
application/view/templates/<name>.tplfor the matching controller. - Subviews go under
application/view/templates/<name>/<action>.tpl. - Shared partials live in
application/view/templates/shared/.
Models
Section titled “Models”- Auto-generated under
application/model/. - Filenames match table names. Each class extends a
Dbadapter (MySQL\DborPostgreSQL\Db).
Modules
Section titled “Modules”- Folder:
application/module/<name>/ - Each module is its own MVC island plus traits, plugins, interfaces and settings.
- The Registry auto-discovers
*.inisettings inside each module’ssettings/.
Migrations
Section titled “Migrations”application/settings/config/database/<NNN>-<slug>.sql- Numbered. Run via
./nibiru -mi <env>. - One file per logical change — don’t squash.
Composer vendor in core/l/
Section titled “Composer vendor in core/l/”This is intentional. composer.json sets vendor-dir: core/l. The framework’s autoloader expects it there. Don’t move it.
templates_c/ and cache/
Section titled “templates_c/ and cache/”Smarty must be able to write to templates_c/. Caching is opt-in via the INI key [ENGINE] caching = true. Both folders should be in your .gitignore.