FForm Platform
enzh-CN

Todo module tutorial

Build a complete module from scratch with a database, ORM, authorization, APIs, actions, triggers, client controls, and deployment.

Todo module: step-by-step guide

The Todo sample is the beginner-friendly reference for a complete independent module. It demonstrates a module manifest, SDK references, database migration, server endpoints, a system form/DataGrid integration, a browser extension, translations, error handling, and packaging without modifying the closed FormPlatform Host.

Recommended sequence

1. Copy the sample module into its own directory outside the Host source tree.

2. Set a stable module name, assembly name, entry type, and SDK/platform version range in `module.json`.

3. Reference only `FormPlatform.Sdk.dll` and `FormPlatform.Extension.Abstractions.dll`.

4. Implement `IFormPlatformSdkModule`, then register services and `IDatabaseMigrationModule` through its lifecycle hooks.

5. Add immutable migration `001_...` for Todo tables and indexes.

6. Implement data operations through the SDK ORM/repository/unit-of-work contracts.

7. Map endpoints with authorization and `PlatformErrorResponse` failures.

8. Add Vue/browser extension controls only when a form and existing controls cannot express the requirement.

9. Register English and Chinese client messages under the module namespace.

10. Build against the target Host SDK, package under `Modules/<module-name>`, restart the Host, then test the module flow.

Design rules

Do not reference `FormPlatform.dll` or copy Host internals. Do not modify an applied migration. Do not rely only on hidden client buttons for authorization. Keep data/model ownership in the module namespace, make API errors stable and translatable, and expose configuration through normal Host configuration providers rather than hard-coded secrets.

The full Chinese practical walkthrough, including project layout and examples, is TODO_MODULE_STEP_BY_STEP.zh-CN.md. For a more advanced mixed Vue/form example, read the Resource Booking module documentation.