Skip to content
Nibiru docsv0.9.2

Project Structure

A guided tour of every directory in a Nibiru project.

Stable Reading time ~ 1 min Edit on GitHub
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 vhost
  • 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>.tpl for the matching controller.
  • Subviews go under application/view/templates/<name>/<action>.tpl.
  • Shared partials live in application/view/templates/shared/.
  • Auto-generated under application/model/.
  • Filenames match table names. Each class extends a Db adapter (MySQL\Db or PostgreSQL\Db).
  • Folder: application/module/<name>/
  • Each module is its own MVC island plus traits, plugins, interfaces and settings.
  • The Registry auto-discovers *.ini settings inside each module’s settings/.
  • application/settings/config/database/<NNN>-<slug>.sql
  • Numbered. Run via ./nibiru -mi <env>.
  • One file per logical change — don’t squash.

This is intentional. composer.json sets vendor-dir: core/l. The framework’s autoloader expects it there. Don’t move it.

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.