Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Development Commands

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.

Features

  • TypeScript Modeling : Models are defined in .mold.ts files 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.

Technical Objectives

  • 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.

Current Scope

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.

Architecture

Forma uses a schema-first approach:

  1. Modeling : Definition of structures in .mold.ts files.
  2. AST (Abstract Syntax Tree) : Static analysis of files to extract data structure.
  3. Generation : Automatic production of validation schemas and derived TypeScript types.
  4. Data Abstraction : (In development) A layer to manage data operations regardless of the storage.

Project Status

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.

Roadmap

Phase 1: Foundations (Completed)

  • CLI setup.
  • AST parser system.
  • "Forma Studio" visualization interface.

Phase 2: Code Generation (In progress)

  • Writing engine for generated files.
  • Automated generation of validation schemas and types.
  • Setup of the output directory for generated files.

Phase 3: Persistence & Abstraction (Planned)

  • Interface for operations (e.g., findMany, create).
  • Storage adapters (SQL, NoSQL, Files).

Phase 4: Synchronization (Planned)

  • Communication protocols between instances.
  • State synchronization management.

About

Agnostic data modeling tool for Node.js.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages