Find framework reference pages for controllers, routes, middleware, modules, database, views, and security.

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.

  1. Use Routing to understand how URLs reach your code.
  2. Use Controllers to create the request handler.
  3. Use Views to render the HTML.
  4. 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.

  1. Read Controllers.
  2. Read Views if the controller returns HTML.
  3. 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.

  1. Start with the Shelter REST API guided project.
  2. Use Routing for API route files.
  3. Use Controllers for API controller structure.
  4. 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.

  1. Use Database for connection, migrations, and SQLManager.
  2. Use Database Patterns to decide between helpers, sqlScript(), repositories, SQLite, and MySQL.
  3. Use Modules to keep repository code out of controllers.
  4. 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.

  1. Use Middleware to protect route groups.
  2. Use Security for CSRF and form safety.
  3. 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.

  1. Read Recommended App Architecture.
  2. Read Modules.
  3. Use Request Lifecycle to understand where middleware, controllers, modules, and views run.
  4. Put app-specific services, repositories, and permission classes under src/Modules.
  5. Keep official framework code inside CorianderCore untouched.

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, and sqlScript().
  • 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.