MMOframework
Créer un projet en direct ↗
# www.mmoframework.fr — the developers' section (plan)
The site sells the framework; this section teaches it. A developer who has never seen MMOFramework lands on
`/developers`, follows a path from "install the hub" to "write a library of my own", and never has to guess where
the next step is. Phase 1 is done (below); the rest of the guides are to write.
## What exists, and what is missing
| Exists | Where | What it is |
|---|---|---|
| Reference documentation | every library's `docs/*.md` (mmo.core alone: Controller, Entities, Router, Schema, Events, Container…) | **what a class does**: complete, per library |
| Code reference | mmo.doc, `/documentation` | every class, function and element, generated from the code |
| Full-text search | `/search`, the MCP's `search_documentation` | finds a word across every library |
| Agent guides | `mmoframework://guide`, the skills (`mmoframework`, `mmo-client`), `docs/mcp/*.md` | the conventions and traps, written for an agent |
| Hub guides | `docs/PROJECT.md`, `docs/LIBRARY.md`, mmo.core's `NewProject.md`, `NewLibrary.md` | how a project and a library are made |
**Missing: the learning path.** All of it is reference, organised by library: it answers "what does
`aController` do", not "how do I add an API to my project". A newcomer has to know the vocabulary (projet,
librairie, module, hub, mode) before the documentation makes sense, and nothing orders the pages. The guides fill
that gap, and **link to the reference instead of repeating it**.
## Decisions taken
| | |
|---|---|
| Where the guides live | **`mmo.guides`** (`libs/guides`), a library of the hub: versioned with the framework, packaged in the site's release, indexed by mmo.doc **and by the MCP server**, so an agent gets the tutorials too |
| Who can read them | **public**: they are a selling point, they are indexed, and an agent fetches them without signing in |
| Languages | **French and English from the first guide**: English in `docs/` (what mmo.doc and the agents read), French in `src/i18n/fr/`. A guide is published only once written in both (a test checks it) |
| Code in the guides | **every sample comes from a project that runs and is tested** (below) |
## The section on the site
**One entry in the header, "Developers"**, replacing "Documentation" and "Search": the marketing header stays
short, and everything technical is one click away. `/developers` is the developers' home page:
```
/developers start here: who you are → where to begin; the tracks; what's new
/developers/guides// one guide
/developers/cheatsheets/ the commands of mmo.php, the configuration keys, the attributes, the .jhs syntax
/developers/ai connecting an agent (today's Why AI page, its technical half)
/documentation/… unchanged: mmo.doc's reference, linked from every guide
/search unchanged, and searching the guides too (they are documents of a package)
```
**Its own shell.** The marketing pages use the `landing` root (a sticky header, full-width sections). The
developers' pages use a documentation layout, same Blueprint theme:
- left: the track's guides, in order, the current one marked, a tick on those read (`localStorage`, nothing stored server side);
- centre: the guide;
- right: the guide's headings;
- under it: previous / next, "edit this page" (the guide's file in its repository), the reference pages it used.
**How it is built**, the way the library pages already are:
- `src/pages/developers/index.json`: the section, its home page, the cheat sheets;
- a `PageContents` listener (`src/functions.php`, like `libraries/`) adds one page per guide, read from
`mmo.guides`' index — no `index.json` to keep in step with the guides;
- `src/pages/developers/guide.phtml` renders a guide's markdown with mmo.doc's parser and printer (the same as
`/documentation`'s pages), its head (level, time, prerequisites) and its navigation;
- `\MMO\guides\Guides` reads the index (`libs/guides/src/guides.json`: tracks, order, level, minutes, prerequisites,
what it links to), like `Libraries.php` reads the manifests;
- `/developers` and every guide are in the sitemap and in `llms.txt`.
The playground is part of the path: the first guide's "create the project" step opens `/playground` with its
name and libraries filled in, for those who want to look before they install.
## A guide
Every guide has the same shape, so a reader knows where to look:
1. **head**: level (beginner · intermediate · advanced), minutes, prerequisites (the guides before it), what you
will have at the end;
2. **steps**, each one: what and why in two lines, the code, how to check it worked (a URL to open, a command and
its output);
3. **common mistakes**: the traps the skills already list, where they belong;
4. **going further**: the reference pages (`/documentation/mmo.core/...`), the next guide.
**The code is never written in the markdown alone.** Each guide has its example project in
`libs/guides/examples///`, written over the project its `scaffold` names, with its tests. A guide quotes
its files in ordinary fenced blocks that name them, ```` ```php from=src/pages/about/about.phtml ````, so the
markdown stays whole for mmo.doc and the agents. `phpunit` in `libs/guides` checks each quote is a part of its file,
line for line, and runs the example's own tests, so `mmo.php verify` fails the day a change of the framework breaks a
guide — the guides cannot rot silently. Still to add: a test that every symbol a guide names exists in mmo.doc's
index.
## The tracks
### 1. Getting started — beginner
From nothing to a deployed application. The capstone is a projects board with a CSV export: not the benchmark's
invoices, which the site shows nowhere but beside the benchmark itself (docs/REDESIGN.md).
| # | Guide | Covers | From |
|---|---|---|---|
| 1 | What MMOFramework is | packages not composer, the hub, projet · librairie · module, the modes (the tree decides, not the host) | README, PROJECT.md |
| 2 | Install the hub | PHP, Apache, the clone and its submodules, `tools/mmo.php`, the hub page | the hub's README |
| 3 | Your first project | `mmo.php project`, every file of the tree and why, the first run | PROJECT.md, NewProject.md |
| 4 | Configuration | `config.json` → `dev`/`prod` → `local`, keys named by class, `{MMO\x}` aliases, `$[..]` | NewProject.md, Container.md |
| 5 | Pages | `src/pages`, `index.json`, `.phtml`, the menu, the theme's shell, translations | mmo.client Pages.md |
| 6 | Your first controller | `aController`, `#[APIRoute]`, `Route`, responses and formats, registering it, route order | Controller.md, Router.md |
| 7 | Entities and a database | `Entity`, schemas, mmo.pdo on SQLite, repositories, filters, `db/patches` | Entities.md, Schema.md, mmo.pdo |
| 8 | Your first `.jhs` element | the syntax, views and data, calling the controller, SCS styles | JHS.md, docs/mcp |
| 9 | Tests and `verify` | phpunit, what `mmo.php verify` runs and why it is the definition of done | Testing.md |
| 10 | Deploy | mmo.admin: `deploy.json`, targets, a release, the health check, rollback | mmo.admin deploy.md |
| ★ | Capstone: a projects board | the whole track again, on one real feature: projects by status, a CSV export | docs/REDESIGN.md: no invoices on the site |
### 2. Building applications — intermediate
One guide per need a real project meets, in any order once track 1 is done.
- Routing in depth: parameters, formats and media types, the JSON API answer, OpenAPI
- Forms, validation, converters and serialization
- Events: listening rather than modifying (`DocumentInit`, `PageContents`, the entity events)
- Users and rights: mmo.oauth, roles, protecting a route and a page
- Data in depth: joins, handlers, statements (mmo.pdo), the same queries on MongoDB
- Files: uploads, storage per client, the trash (mmo.edms)
- Long jobs, scripts and the shell
- Translations: `I18n`, `src/i18n`, `mmo.php i18n`
- The client in depth: reactive views, the design system, guided tours, the editor
- A project for several clients: modules, variants, a `deploy.json` per target
- Security: CSP, field encryption, secrets, `mmo.php links`/`audit`, ISO 27001 checks
### 3. Extending the framework — advanced
What makes the framework the agency's: changing its behaviour without forking it.
- How the framework is put together: `Shared()`, the container, the order a package is loaded in
- Extend or listen? Subclassing a framework class (a controller, `PageController`, an entity, a printer) versus an
event, and replacing a framework class by configuration
- Writing a module (`mmo.php module`)
- Writing a library (`mmo.php new`, `make`): the manifest contract (LIBRARY.md), its bootstrap, its docs, its
demo, its tests, `mmo.php check`
- Shipping custom elements and styles from a library (`?jhs`, `$[..]`)
- Documenting for people and agents: docblocks, `@example`, `docs/mcp`, `llms.txt`
- Versions: the ranges (`"21.*"`), a breaking change, releases and phars
- Contributing: change tracking, the boards, the ticket flow
### 4. Working with AI agents
- Connecting Claude Code (or any MCP client) to the framework's server and to a project's own
- What a project carries for an agent: `AGENTS.md`, `CLAUDE.md`, `.mcp.json`, the skills
- The loop: ask, let the agent search the documentation, `verify`, review
### Alongside the tracks
- **Cheat sheets**: `mmo.php`'s commands, the configuration keys by class, the attributes, the `.jhs` syntax
- **Glossary**: every word of the framework, with the guide that introduces it
- **Troubleshooting / FAQ**: the questions asked twice (from the skills' traps and mmo.pdo's Troubleshooting.md)
- **Upgrading**: one page per major version of mmo.core and mmo.client
## Phases
0. **Agree** this plan (done).
1. **The frame** (done): `mmo.guides` (`src/guides.json` with every track and guide, planned ones listed;
`Guides`; `tests/unit/TestExamples.php`, which checks every ```` ```lang from= ```` quote against the
project `ProjectScaffold` makes plus `examples//`, then runs that project's own phpunit), the `/developers`
page and `developers//` (`src/pages/developers/`, `src/functions.php`), "Developers" in the header
in place of Documentation and Search, `tests/unit/TestDevelopers.php`, and **"Your first project"** in English
and French. Left: mmo.guides has no GitHub repository yet, so it is not a submodule of the hub (`gh` is not
installed: the two commands `mmo.php new` printed); the sitemap and `llms.txt` do not list the guides yet.
2. **Getting started**: the rest of track 1 and the capstone. The section goes public here. Written so far: What
MMOFramework is, Install the hub, Your first project, Configuration, Pages, Your first controller,
Entities and a database, Your first .jhs element, Tests and verify, Deploy. Left: the projects board capstone.
3. **Building applications**: track 2, by what projects ask most (users and rights, data, events first).
4. **Extending**: track 3, then track 4 (most of it moves from the Why AI page).
5. **Alongside**: cheat sheets, glossary, FAQ; French, track by track.
Each guide is reviewed by running it from a clean machine — ideally by someone who does not know the framework.