data-primals-engine 1.6.5 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +160 -113
  2. package/client/index.js +3 -0
  3. package/client/package-lock.json +8121 -8824
  4. package/client/package.json +10 -3
  5. package/client/src/AssistantChat.jsx +369 -362
  6. package/client/src/DataEditor.jsx +383 -383
  7. package/client/src/DataLayout.jsx +54 -20
  8. package/client/src/ModelList.jsx +280 -280
  9. package/client/src/ViewSwitcher.scss +0 -31
  10. package/client/src/constants.js +81 -100
  11. package/client/src/contexts/CommandContext.jsx +274 -259
  12. package/client/vite.config.js +30 -30
  13. package/doc/AI-assistance.md +93 -0
  14. package/doc/Advanced-workflows.md +90 -0
  15. package/doc/Event-system.md +79 -0
  16. package/doc/Packs-gallery.md +73 -0
  17. package/package.json +30 -16
  18. package/src/constants.js +1 -1
  19. package/src/core.js +487 -477
  20. package/src/defaultModels.js +1 -1
  21. package/src/email.js +0 -2
  22. package/src/engine.js +342 -335
  23. package/src/filter.js +348 -343
  24. package/src/migrate.js +1 -1
  25. package/src/modules/assistant/assistant.js +30 -20
  26. package/src/modules/data/data.backup.js +4 -4
  27. package/src/modules/data/data.js +311 -302
  28. package/src/modules/data/data.operations.js +79 -64
  29. package/src/modules/data/data.relations.js +2 -1
  30. package/src/modules/data/data.scheduling.js +1 -1
  31. package/src/modules/mongodb.js +16 -8
  32. package/src/modules/user.js +0 -1
  33. package/src/modules/workflow.js +1828 -1815
  34. package/src/packs.js +5701 -5697
  35. package/src/profiles.js +19 -0
  36. package/swagger-en.yml +3390 -3385
  37. package/swagger-fr.yml +3385 -3380
  38. package/test/assistant.test.js +2 -2
  39. package/test/data.backup.integration.test.js +3 -1
  40. package/test/data.history.integration.test.js +0 -1
package/README.md CHANGED
@@ -1,114 +1,161 @@
1
- # data-primals-engine
2
- [![Node.js CI](https://github.com/anonympins/data-primals-engine/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/anonympins/data-primals-engine/actions/workflows/node.js.yml)
3
- ![](https://img.shields.io/npm/dw/data-primals-engine)
4
- ![](https://img.shields.io/github/v/release/anonympins/data-primals-engine)
5
- ![](https://img.shields.io/github/license/anonympins/data-primals-engine)
6
-
7
- **data-primals-engine** is a powerful and flexible **Node.js** backend framework designed to accelerate the development of complex data-driven applications. Built on **Express.js** and **MongoDB**, it provides a solid foundation so you can focus on what makes your application unique.
8
-
9
- ---
10
-
11
- <p align="center">
12
- <a href="https://data.primals.net/prez1.jpg" target="_blank"><img alt="Light" src="https://data.primals.net/prez1.jpg" width="35%"></a>
13
- <a href="https://data.primals.net/prez6.jpg" target="_blank"><img alt="Light" src="https://data.primals.net/prez6.jpg" width="35%"></a>
14
- <a href="https://data.primals.net/api-docs" target="_blank"><img alt="Dark" src="https://data.primals.net/prez5.jpg" width="25%"></a>
15
- </p>
16
-
17
- ---
18
-
19
- ## 🚀 Key Features
20
-
21
- - **Visual Data Modeling**: Define and update schemas via a UI or JSON, without migrations.
22
- - **Automation Workflows**: Trigger complex actions based on data events (create, update) or schedules (cron).
23
- - **Dynamic & Extensible API**: Create custom API endpoints directly from the UI in a secure environment.
24
- - **Advanced Data Management**: Benefit from complex queries, aggregations, automatic change auditing, and a permission system (RBAC).
25
- - **AI Integration**: Native support for OpenAI, DeepSeek, and Google Gemini models via LangChain.
26
- - **Complete Ecosystem**: Includes file management (S3), internationalization (i18n), encrypted backups, and starter packs.
27
-
28
- For a detailed exploration of each feature, check out the wiki pages:
29
-
30
- ---
31
-
32
- ## Quick Start
33
-
34
- ### 1. Prerequisites
35
- - **Node.js** 20
36
- - **MongoDB** (local or remote)
37
-
38
- ### 2. Installation
39
-
40
- ```bash
41
- git clone https://github.com/anonympins/data-primals-engine.git
42
- cd data-primals-engine
43
- npm install
44
- ```
45
-
46
- ### 3. Configuration
47
-
48
- Create a `.env` file in the project root to configure the connection to your database :
49
-
50
- ```env
51
- MONGO_DB_URL=mongodb://127.0.0.1:27017/my_database
52
- JWT_SECRET=a_long_and_random_secret
53
- ```
54
-
55
- To discover all available environment variables (AWS, SMTP, AI, etc.), consult the **configuration documentation**.
56
-
57
- ### 4. Launch
58
-
59
- ```bash
60
- # Development mode with automatic reloading
61
- npm run devserver
62
-
63
- # Production mode
64
- npm run server
65
- ```
66
-
67
- By default, the application is available at `http://localhost:7633`.
68
-
69
- ---
70
-
71
-
72
- ## 🧭 Explore the Platform
73
- Discover the core features to get started building and managing your data.
74
- Link to the official documentation: https://data.primals.net/en/documentation/
75
-
76
- - 🧠 [Core Concepts](https://github.com/anonympins/data-primals-engine/wiki/Concepts): Explore the fundamentals of data modeling
77
- - 🔌 [Custom API Endpoints](https://github.com/anonympins/data-primals-engine/wiki/Custom-Endpoints): Create dynamic HTTP routes directly from the backend
78
- - 🏗️ [Data Models](https://data.primals.net/en/documentation/create-models): Structure your information.
79
- - 🗃️ [Data Management](https://data.primals.net/en/documentation/manage-data): Create, read, update, and delete your entries.
80
- - 📊 [Views (Table, Kanban)](Views): Visualize your data in different ways. *(Page to be created)*
81
- - 📈 [Dashboards, KPIs, and Charts](https://data.primals.net/en/documentation/dashboards): Track your key metrics.
82
- - 👥 [Users](https://data.primals.net/en/documentation/users): Manage access to the platform.
83
- - 🔐 [Roles and Permissions](https://data.primals.net/en/documentation/roles-permissions): Define who can see and do what.
84
- - ⚙️ [Automation with Workflows](https://data.primals.net/en/documentation/automation-workflows): Create automated processes.
85
-
86
- ## 🔌 Integrate with your tools
87
- Connect the platform to your external applications and services via our API.
88
-
89
- - 📡 [API Requests](https://data.primals.net/en/documentation/api): The basics for interacting with the REST API.
90
- - 🚀 [Advanced Requests](https://data.primals.net/en/documentation/advanced-requests): Filters, sorts, projections, and more.
91
- - 📦 [Bulk Operations](https://data.primals.net/en/documentation/bulk-operations): Perform operations on large volumes of data.
92
-
93
- ## 🧩 Extend Capabilities
94
- Go further by developing your own features and business logic.
95
-
96
- - ⚡ [Event System](Event-system): React to events in real time. *(Page to create)*
97
- - 🧠 [Advanced Workflows](Advanced-workflows): Create complex logic with custom scripts. *(Page to create)*
98
- - 📦 [Modules](Modules): Package and share your developments. *(Page to create)*
99
- - ❤️ [Contribute to the project (CONTRIBUTING.md)](https://github.com/anonympins/data-primals-engine/blob/main/CONTRIBUTING.md): Join the developer community.
100
-
101
- ## 💻 For Developers
102
- Essential tools for a seamless development experience.
103
-
104
- - 📖 [Explore the API with Swagger](https://data.primals.net/api-docs/): Test API access points directly from your browser.
105
- - 📮 [Postman Collection](https://data.primals.net/doc/API.postman_collection.json): Import our collection to start querying in just a few clicks.
106
-
107
- ## 🤝 Contribution
108
-
109
- Contributions are welcome! Check out the open issues to get started.
110
-
111
- ---
112
-
113
- ## 📄 License
1
+ # data-primals-engine
2
+ [![Node.js CI](https://github.com/anonympins/data-primals-engine/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/anonympins/data-primals-engine/actions/workflows/node.js.yml)
3
+ ![](https://img.shields.io/npm/dw/data-primals-engine)
4
+ ![](https://img.shields.io/npm/last-update/data-primals-engine)
5
+ ![](https://img.shields.io/github/v/release/anonympins/data-primals-engine)
6
+ ![](https://img.shields.io/github/license/anonympins/data-primals-engine)
7
+
8
+ **data-primals-engine** is a powerful and flexible **Node.js** backend framework designed to accelerate the development of complex data-driven applications. Built on **Express.js** and **MongoDB**, it provides a solid foundation so you can focus on what makes your application unique.
9
+
10
+ > Whether you're building a CRM, e-commerce site, CMS, or SaaS platform, **data-primals-engine** provides the strong foundations so you can focus on what makes your application unique.
11
+
12
+ ---
13
+
14
+ <p align="center">
15
+ <a href="https://data.primals.net/prez1.jpg" target="_blank"><img alt="Light" src="https://data.primals.net/prez1.jpg" width="35%"></a>
16
+ <a href="https://data.primals.net/prez6.jpg" target="_blank"><img alt="Light" src="https://data.primals.net/prez6.jpg" width="35%"></a>
17
+ <a href="https://data.primals.net/api-docs" target="_blank"><img alt="Dark" src="https://data.primals.net/prez5.jpg" width="25%"></a>
18
+ </p>
19
+ ---
20
+
21
+ ## 🚀 Key Features
22
+
23
+ - **Visual Data Modeling**: Define and update schemas using a powerful UI Model Creator, or directly with JSON. No migrations required.
24
+ - **Custom API Endpoints**: Create server-side logic and new API endpoints directly from the UI in a secure, sandboxed environment.
25
+ - **Automation Workflows**: Trigger complex actions based on data events (create, update, delete) or schedules (cron).
26
+ - **Advanced Querying & Aggregation**: Go beyond simple filters with a visual Condition Builder, deep relation expansion, complex lookups, and dynamic calculated fields.
27
+ - **Rich UI Data Views**: Ready-to-use React components to display your data, including a powerful and configurable Data Table, a Kanban board, and a Calendar view.
28
+ - **Integrated Backup & Restore**: Secure, encrypted user data backups with rotation policies, supporting both local and AWS S3 storage.
29
+ - **Automatic Data Auditing**: Automatically tracks all changes (create, update, delete) for every record, providing a complete version history for auditing and traceability.
30
+ - **Event-Driven & Extensible**: A core event system allows for deep customization and the easy creation of new modules or plugins.
31
+ - **Authentication & Authorization**: Robust role-based access control (RBAC) and pluggable user providers.
32
+ - **Built-in File Management**: Handle file uploads seamlessly with integrated support for AWS S3 storage.
33
+ - **🧠 AI Integration**: Natively supports OpenAI, DeepSeek and Google Gemini models via LangChain for content generation, analysis, and more.
34
+ - **🌐 Internationalization (i18n)**: Fully supports multilingual interfaces and user-specific translated data.
35
+ - **📦 Starter Packs**: Quickly bootstrap applications with pre-built data packs for CRM, e-commerce, and more.
36
+ - **📄Auto-Generated API Documentation**: Interactive API documentation available via the interface or at `/api-docs`.
37
+
38
+ ## 🌟 Why Choose data-primals-engine?
39
+
40
+ - **Zero Boilerplate**: Focus on your business logic, not infrastructure
41
+ - **Scalability**: Architecture designed for rapidly growing applications
42
+ - **Modularity**: Enable/disable features as needed
43
+ - **Batteries Included**: Everything you need to get started quickly
44
+ - **Proven Performance**: Handles 50k+ documents efficiently
45
+ - **AI Ready**: Built-in LangChain integration for main providers (OpenAI,Gemini,Anthropic,DeepSeek)
46
+
47
+ ---
48
+
49
+ ## 📊 Proven Performance
50
+
51
+ The engine has been rigorously tested to ensure stability and scalability. Load tests simulating complex, multi-step user journeys (including model creation, data import, and API interactions) show excellent results:
52
+ - **Zero Failures**: 100% success rate under sustained concurrent load.
53
+ - **Excellent Responsiveness**: Median response times as low as 15-30ms.
54
+ - **Linear Scaling**: Predictable performance as user load increases.
55
+
56
+ For detailed reports, see the Performance Testing Documentation.
57
+
58
+ ---
59
+
60
+ ## ⚙️ Requirements
61
+
62
+ - Node.js ≥ 20
63
+ - MongoDB (local or remote), see installation guide
64
+ - NPM or Yarn
65
+
66
+ ---
67
+
68
+ ## ⚡ Quick Start
69
+
70
+ ### 1. Prerequisites
71
+ - **Node.js** ≥ 20
72
+ - **MongoDB** (local or remote)
73
+
74
+ ### check
75
+ ```bash
76
+ # Verify required versions
77
+ node -v # Must show v20
78
+ mongod --version # Must be installed
79
+ ```
80
+
81
+ ### 2. Installation
82
+
83
+ ```bash
84
+ npm i data-primals-engine
85
+ ```
86
+ or
87
+ ```bash
88
+ git clone https://github.com/anonympins/data-primals-engine.git
89
+ cd data-primals-engine
90
+ npm install
91
+ ```
92
+
93
+ ### 3. Configuration
94
+
95
+ Create a `.env` file in the project root to configure the connection to your database :
96
+
97
+ ```env
98
+ MONGO_DB_URL=mongodb://127.0.0.1:27017/my_database
99
+ JWT_SECRET=a_long_and_random_secret
100
+ ```
101
+
102
+ To discover all available environment variables (AWS, SMTP, AI, etc.), consult the **configuration documentation**.
103
+
104
+ ### 4. Launch
105
+
106
+ ```bash
107
+ # Development mode with automatic reloading
108
+ npm run devserver
109
+
110
+ # Production mode
111
+ npm run server
112
+ ```
113
+
114
+ By default, the application is available at `http://localhost:7633`.
115
+
116
+ ---
117
+
118
+
119
+ ## 🧭 Explore the Platform
120
+ Discover the core features to get started building and managing your data.
121
+ Link to the official documentation: https://data.primals.net/en/documentation/
122
+
123
+ - 🧠 [Core Concepts](https://github.com/anonympins/data-primals-engine/wiki/Concepts): Explore the fundamentals of data modeling
124
+ - 🔌 [Custom API Endpoints](https://github.com/anonympins/data-primals-engine/wiki/Custom-Endpoints): Create dynamic HTTP routes directly from the backend
125
+ - 🏗️ [Data Models](https://data.primals.net/en/documentation/create-models): Structure your information.
126
+ - 🗃️ [Data Management](https://data.primals.net/en/documentation/manage-data): Create, read, update, and delete your entries.
127
+ - 📊 [Views (Table, Kanban)](Views): Visualize your data in different ways. *(Page to be created)*
128
+ - 📈 [Dashboards, KPIs, and Charts](https://data.primals.net/en/documentation/dashboards): Track your key metrics.
129
+ - 👥 [Users](https://data.primals.net/en/documentation/users): Manage access to the platform.
130
+ - 🔐 [Roles and Permissions](https://data.primals.net/en/documentation/roles-permissions): Define who can see and do what.
131
+ - ⚙️ [Automation with Workflows](https://data.primals.net/en/documentation/automation-workflows): Create automated processes.
132
+
133
+ ## 🔌 Integrate with your tools
134
+ Connect the platform to your external applications and services via our API.
135
+
136
+ - 📡 [API Requests](https://data.primals.net/en/documentation/api): The basics for interacting with the REST API.
137
+ - 🚀 [Advanced Requests](https://data.primals.net/en/documentation/advanced-requests): Filters, sorts, projections, and more.
138
+ - 📦 [Bulk Operations](https://data.primals.net/en/documentation/bulk-operations): Perform operations on large volumes of data.
139
+
140
+ ## 🧩 Extend Capabilities
141
+ Go further by developing your own features and business logic.
142
+
143
+ - ⚡ [Event System](Event-system): React to events in real time. *(Page to create)*
144
+ - 🧠 [Advanced Workflows](Advanced-workflows): Create complex logic with custom scripts. *(Page to create)*
145
+ - 📦 [Modules](Modules): Package and share your developments. *(Page to create)*
146
+ - ❤️ [Contribute to the project (CONTRIBUTING.md)](https://github.com/anonympins/data-primals-engine/blob/main/CONTRIBUTING.md): Join the developer community.
147
+
148
+ ## 💻 For Developers
149
+ Essential tools for a seamless development experience.
150
+
151
+ - 📖 [Explore the API with Swagger](https://data.primals.net/api-docs/): Test API access points directly from your browser.
152
+ - 📮 [Postman Collection](https://data.primals.net/doc/API.postman_collection.json): Import our collection to start querying in just a few clicks.
153
+
154
+ ## 🤝 Contribution
155
+
156
+ Contributions are welcome! Check out the open issues to get started.
157
+
158
+ ---
159
+
160
+ ## 📄 License
114
161
  Distributed under the **MIT License**. See the `LICENSE` file.
package/client/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
  export { ModelProvider, useModelContext } from './src/contexts/ModelContext';
5
5
  export { AuthProvider, useAuthContext } from './src/contexts/AuthContext';
6
6
  export { UIProvider, useUI } from './src/contexts/UIContext';
7
+ export { CommandProvider, createInsertCommand, createUpdateCommand, createDeleteCommand, DeleteCommand, InsertCommand, UpdateCommand , useCommand } from './src/contexts/CommandContext';
7
8
  export { NotificationProvider, useNotificationContext } from './src/NotificationProvider';
8
9
 
9
10
  // Hooks
@@ -22,3 +23,5 @@ export { default as MessageRotator } from './src/MessageRotator';
22
23
  export { default as DocumentationPageLayout } from './src/DocumentationPageLayout';
23
24
  export { default as ContentView } from './src/ContentView';
24
25
  export { default as AssistantChat } from './src/AssistantChat';
26
+
27
+ export * from './src/constants.js';