Documentation
Start from what you want to build. Each path points to the exact framework pieces you need, without forcing you to read every reference page first.
I Want To Create A Page
A normal page usually needs a route, a controller action, and a view.
If you are deciding where files should live, start with Recommended App Architecture.
- Use Routing to understand how URLs reach your code.
- Use Controllers to create the request handler.
- Use Views to render the HTML.
- Use Security when the page contains a form.
Useful command:
php coriander make:controller Blog
I Want To Create A Controller
Controllers should stay thin. They read the request, call app-owned modules or repositories, and return a response or render a view.
- Read Controllers.
- Read Views if the controller returns HTML.
- Read Routing if you need custom URLs.
For API endpoints, generate an API controller:
php coriander make:controller Shelter --api
I Want To Create An API
An API usually needs route files, API controllers, validation, JSON responses, and database access.
- Start with the Shelter REST API guided project.
- Use Routing for API route files.
- Use Controllers for API controller structure.
- Use Database when the API reads or writes persistent data.
The guided project includes a playground so you can test GET, POST, PATCH, and DELETE behavior without changing a real database.
I Want To Use A Database
Database work usually starts with a migration, then moves into repositories or modules that call SQLManager.
- Use Database for connection, migrations, and
SQLManager. - Use Database Patterns to decide between helpers,
sqlScript(), repositories, SQLite, and MySQL. - Use Modules to keep repository code out of controllers.
- Use Routing and Controllers to expose the data through pages or APIs.
Useful commands:
php coriander make:migration create_posts_table
php coriander migrate
For larger SQL queries, prefer sqlScript() so the query stays readable and reusable.
I Want Authentication Or Permissions
Authentication tells the app who the user is. Permissions decide what that user may do.
- Use Middleware to protect route groups.
- Use Security for CSRF and form safety.
- Follow the Forum permissions guided project for a complete web example.
The forum project shows guests, members, and admins using the same permission rules from views, controllers, middleware, write services, and API endpoints.
I Want To Organize Reusable Code
Use custom modules for app-owned logic that should not live in controllers or CorianderCore.
- Read Recommended App Architecture.
- Read Modules.
- Use Request Lifecycle to understand where middleware, controllers, modules, and views run.
- Put app-specific services, repositories, and permission classes under
src/Modules. - Keep official framework code inside
CorianderCoreuntouched.
Recommended shape:
src/
Modules/
Blog/
BlogRepository.php
BlogService.php
For Experienced Users
Use this section when you already know the feature you need and want the reference page directly.
- Recommended App Architecture: where controllers, modules, repositories, middleware, views, validation, and permissions belong.
- Request Lifecycle: how requests move through
public/index.php, routes, middleware, controllers, modules, and responses. - Database Patterns: when to use migrations,
SQLManager,sqlScript(), repositories, SQLite, and MySQL. - Production Checklist: environment, hosting, HTTPS, proxies, database, logs, assets, and final release checks.
- Errors And Debugging: common 404, 405, asset, environment, database, CSRF, and hosting issues.
- Testing An App: route smoke tests, module tests, repository tests, permission tests, and documentation quality checks.
- Upgrade Guide: how to update the framework without mixing app behavior into
CorianderCore. - CLI: scaffolding commands, maintenance commands, and framework updates.
- Routing: route files, groups, middleware, response handling, and not-found behavior.
- Controllers: web controllers, API controllers, rendering, and action structure.
- Middleware: PSR-15 middleware and route-group protection.
- Views: public views, view data, escaping, and forms.
- Database: migrations, SQLite/MySQL configuration,
SQLManager, andsqlScript(). - Modules: app-owned reusable logic outside controllers.
- Security: CSRF, headers, trusted proxies, and request safety.
- Cache: cache behavior and invalidation.
- Sitemap: sitemap metadata and public pages.
- NodeJS Integration: Tailwind, TypeScript, builds, and frontend assets.
Guided Projects
- Build a Forum with User Permissions: full web app with SQLite, authentication, permissions, admin middleware, write services, API endpoints, and public-demo protection.
- Build a Shelter REST API: full JSON API with filtering, validation, database access, consistent errors, and a request playground.
Framework Update Rule
Do not put app or documentation behavior inside CorianderCore. Framework updates can replace that folder. Keep app-owned code in src, public/public_views, documentation, database, resources, and nodejs.