create-steedos-app 3.0.2-beta.11 → 3.0.2-beta.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-steedos-app",
3
- "version": "3.0.2-beta.11",
3
+ "version": "3.0.2-beta.12",
4
4
  "keywords": [
5
5
  "react",
6
6
  "steedos"
@@ -49,5 +49,5 @@
49
49
  "engines": {
50
50
  "node": ">=14"
51
51
  },
52
- "gitHead": "6355c86ba1122cc8e44065d74a010e3e2dfffc9f"
52
+ "gitHead": "980c6c585aeffd2b82a100bbe6f6e7658fbe10da"
53
53
  }
@@ -1,31 +1,92 @@
1
- # Steedos 项目模板
1
+ # Steedos Example App
2
2
 
3
- 华炎魔方提供了超越传统无代码平台的深度定制和开发能力,不仅允许没有编程背景的用户快速创建应用,还为有经验的开发人员提供了强大的工具和框架,使他们能够进行更复杂的自定义和集成。
3
+ This is an enterprise-grade low-code/no-code application built on the [Steedos Platform](https://www.steedos.com/).
4
4
 
5
- - [文档](https://docs.steedos.com)
5
+ This project was scaffolded using `create-steedos-app`. It provides a foundation for rapid metadata modeling, API extensions, and business logic development.
6
6
 
7
- # 快速向导
7
+ ## 🛠 Prerequisites
8
8
 
9
- ## 运行数据库
9
+ Before you begin, ensure you have the following installed in your development environment:
10
10
 
11
- 您可以在本地安装 mongodb redis,或者使用 docker 快速启动。
11
+ - **Node.js**: v22.0 or higher
12
+ - **MongoDB**: v7.0 or higher
13
+ - **Redis**:
14
+ - **Yarn**
12
15
 
13
- ```bash
14
- docker-compose up mongodb redis
15
- ```
16
+ ## 🚀 Quick Start
17
+
18
+ ### 1. Start Db Services
16
19
 
20
+ Make sure your MongoDB and Redis services are running. You can start them using the following commands:
17
21
 
18
- ## 运行 Steedos
22
+ ```bash
23
+ yarn start:db
24
+ ```
25
+ ### 2. Install Dependencies
19
26
 
20
- ### 安装依赖
27
+ Run the following command in the project root to install the required Node packages:
21
28
 
22
29
  ```bash
30
+ yarn install
23
31
  yarn
24
- yarn build
25
32
  ```
26
33
 
27
- ### 运行 Steedos
34
+ ### 3. Start the Server
35
+
36
+ Start the development server. Steedos will output the access URL in the console.
28
37
 
29
38
  ```bash
30
39
  yarn start
31
40
  ```
41
+
42
+ ### 4. Access the Application
43
+
44
+ Once the server starts successfully, open your browser and visit:
45
+ `http://localhost:5100` (Default port)
46
+
47
+
48
+ ## 📂 Project Structure
49
+
50
+ Here is an overview of the core file structure:
51
+
52
+ ```text
53
+ my-project/
54
+ ├── .env # Environment variables (Do not commit sensitive info)
55
+ ├── .env.local # Local environment overrides
56
+ ├── package.json # Project dependencies and scripts
57
+ ├── steedos-config.js # Core Steedos configuration
58
+ ├── steedos-packages/example-app/ # Core app directory
59
+ │ ├── main/
60
+ │ │ └── default/
61
+ │ │ ├── objects/ # Object definitions (Metadata)
62
+ │ │ ├── app/ # app definitions (Metadata)
63
+ │ └── package.json # Business package definition
64
+ ```
65
+
66
+ ## ⚙️ Configuration
67
+
68
+ Create or modify the `.env` file in the project root to configure the database connection and service ports:
69
+
70
+ ```shell
71
+ # Service Port
72
+ PORT=5100
73
+
74
+ # Database Connection (MongoDB)
75
+ MONGO_URL=mongodb://127.0.0.1:27017/steedos
76
+
77
+ # Root URL (Important for attachments and API callbacks)
78
+ ROOT_URL=http://localhost:5100
79
+
80
+ # Metadata Storage Directory
81
+ STEEDOS_STORAGE_DIR=./storage
82
+ ```
83
+
84
+ ## 💻 Development Guide
85
+
86
+ ### Exporting Metadata
87
+
88
+ If you modify configurations via the UI (Steedos Objects), you can sync changes back to your local code using the Steedos command line tools or the VS Code extension.
89
+ ## 📚 Resources
90
+
91
+ - [Steedos Documentation](https://docs.steedos.com/)
92
+ - [Steedos GitHub Repository](https://github.com/steedos/steedos-platform)
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "steedos-project-templates",
2
+ "name": "steedos-project-template",
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
5
  "workspaces": [
@@ -0,0 +1,3 @@
1
+ # Steedos Example App
2
+
3
+ This is an enterprise-grade low-code/no-code application built on the [Steedos Platform](https://www.steedos.com/).
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "steedos-example-app",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "package.service.js",
6
+ "dependencies": {}
7
+ }
@@ -0,0 +1,21 @@
1
+ const project = require('./package.json');
2
+ const packageLoader = require('@steedos/service-package-loader');
3
+
4
+ module.exports = {
5
+ name: "example-service",
6
+
7
+ mixins: [packageLoader],
8
+
9
+ metadata: {
10
+ $package: {
11
+ name: project.name,
12
+ version: project.version,
13
+ path: __dirname,
14
+ isPackage: true
15
+ }
16
+ },
17
+ actions: {
18
+ },
19
+ events: {
20
+ }
21
+ }
@@ -1,19 +0,0 @@
1
- 微服务软件包
2
- ===
3
-
4
- 可以使用微服务方式扩展化验魔方。
5
-
6
- ## 启动服务
7
-
8
- ```sh
9
- yarn start:services
10
- ```
11
-
12
- 启动服务之后,为华炎魔方服务扩展了以下API
13
-
14
- - hello, 获取当前登录用户: http://127.0.0.1:5000/service/api/example-service/hello/jack
15
- - me, 获取当前登录用户: http://127.0.0.1:5000/service/api/example-service/me
16
-
17
- ## 参考
18
-
19
- - [Moleculer Nodejs](https://moleculer.services/zh/)
@@ -1,8 +0,0 @@
1
- {
2
- "name": "my-steedos-service",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "package.service.js",
6
- "dependencies": {
7
- }
8
- }
@@ -1,88 +0,0 @@
1
- const project = require('./package.json');
2
- const packageLoader = require('@steedos/service-package-loader');
3
-
4
- module.exports = {
5
- name: "example-service",
6
-
7
- mixins: [packageLoader],
8
-
9
- metadata: {
10
- $package: {
11
- name: project.name,
12
- version: project.version,
13
- path: __dirname,
14
- isPackage: true
15
- }
16
- },
17
-
18
- actions: {
19
- hello: {
20
- // 使用微服务方式定义 API 接口。
21
- // 访问地址: GET /service/api/example-service/hello/:name
22
- rest: { method: 'GET', path: '/hello/:name' },
23
- handler(ctx) {
24
- return {
25
- data: 'Welcome ' + ctx.params.name
26
- }
27
- }
28
- },
29
- me: {
30
- rest: { method: 'GET', path: '/me' },
31
- // 在微服务中获取当前登录的用户信息
32
- async handler(ctx) {
33
- return ctx.meta.user
34
- }
35
- },
36
- // 在微服务中调用graphql查询数据库
37
- graphqlQuerySpaceUsers: {
38
- rest: { method: 'GET', path: '/graphql' },
39
- async handler(ctx) {
40
- return await this.broker.call('api.graphql', {
41
- query: `
42
- query {
43
- space_users(filters: ["user", "=", "${ctx.meta.user.userId}"]) {
44
- name
45
- organization__expand {
46
- name
47
- }
48
- }
49
- }
50
- `},
51
- // 如果查询 GraphQL 需要带上当前用户的权限,需要传入 user 属性。
52
- {
53
- meta: {
54
- user: ctx.meta.user
55
- }
56
- }
57
- )
58
- },
59
- },
60
- // 在微服务中调用objectql查询数据库, 需要 mixins: [require('@steedos/service-object-mixin')],
61
- objectqlQuerySpaceUsers: {
62
- rest: { method: 'GET', path: '/objectql' },
63
- async handler(ctx) {
64
- return await this.getObject('space_users').find(
65
- {
66
- filters: ['user', '=', ctx.meta.user.userId]
67
- },
68
- ctx.meta.user
69
- )
70
- }
71
- },
72
- // 使用微服务定义触发器
73
- spaceUsersBeforeUpdate: {
74
- trigger: { listenTo: 'space_users', when: ['beforeUpdate', 'beforeInsert']},
75
- async handler(ctx) {
76
- this.broker.logger.info('spaceUsersBeforeUpdate', ctx)
77
- }
78
- }
79
- },
80
- events: {
81
- "@space_users.updated": {
82
- handler(payload) {
83
- // 监听人员修改事件
84
- this.broker.logger.info(payload);
85
- }
86
- }
87
- }
88
- }