An interactive schema design tool for Node.js projects, it allows defining data models in TypeScript and automating the generation of validation schemas and associated types.
Main commands for working on the project:
npm run build: Compiles the CLI and the Web interface (Studio).npm run build:cli: Compiles only the CLI.npm run build:ui: Compiles only the Web interface (Studio).npm run local: Executes the CLI locally.
- TypeScript Modeling : Models are defined in
.mold.tsfiles using standard TypeScript syntax. - Static Analysis (AST) : The CLI analyzes model files to extract their structure without executing the code.
- Automatic Generation : Production of validation schemas (Zod) and derived TypeScript types to ensure consistency between definition and usage.
- Visualization : An integrated "Studio" tool allows inspecting models and relations defined in the project.
- Consistency : Ensure a single source of truth. The entity definition serves as the basis for generating TypeScript types and validation schemas.
- Productivity : Reduce time spent on configuration and updating data structures via a CLI assistant.
- Portability : Designed to work in any Node.js environment (Express, Fastify, etc.) without complex configuration.
Forma is currently a code generation tool. It focuses exclusively on static analysis of models and the automatic production of types and schemas to facilitate development.
It does not yet handle:
- Database connections (no SQL/NoSQL drivers).
- Query execution or data manipulation (no Query Engine).
- Runtime data persistence or synchronization.
These features are planned for subsequent phases of the roadmap.
Forma uses a schema-first approach:
- Modeling : Definition of structures in
.mold.tsfiles. - AST (Abstract Syntax Tree) : Static analysis of files to extract data structure.
- Generation : Automatic production of validation schemas and derived TypeScript types.
- Data Abstraction : (In development) A layer to manage data operations regardless of the storage.
| Module | Status | Description |
|---|---|---|
| CLI (Init/Setup) | Completed | Project initialization and configuration. |
| AST Parser | Completed | Metadata extraction from .mold.ts files. |
| Forma Studio | MVP | Graphic interface to visualize models. |
| Zod/TS Generator | In progress | Converting AST into typed schemas. |
| Query Engine | Planned | Data operation abstraction. |
| Synchronization | Planned | Distributed communication mechanisms. |
- CLI setup.
- AST parser system.
- "Forma Studio" visualization interface.
- Writing engine for generated files.
- Automated generation of validation schemas and types.
- Setup of the output directory for generated files.
- Interface for operations (e.g.,
findMany,create). - Storage adapters (SQL, NoSQL, Files).
- Communication protocols between instances.
- State synchronization management.