Compare commits
103 Commits
develop/cm
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
975a528b49 | ||
![]() |
749fef7e28 | ||
![]() |
cf34833d42 | ||
![]() |
7bb45316af | ||
![]() |
02771185af | ||
![]() |
cf70e2af21 | ||
![]() |
1a77c3a5e8 | ||
![]() |
af446aed59 | ||
![]() |
c7f1f544ec | ||
![]() |
99ee2f9fc3 | ||
![]() |
a4cdb4b1cc | ||
![]() |
b35b77557e | ||
![]() |
6842459499 | ||
![]() |
ba7682e7cb | ||
![]() |
1003fa699c | ||
![]() |
ec12ca3bdf | ||
![]() |
7ece1c814b | ||
![]() |
39a7d32fcd | ||
![]() |
85d1ecdc90 | ||
![]() |
b26e1ff167 | ||
![]() |
de415a37bc | ||
![]() |
01a8d2ca02 | ||
![]() |
e5b136b8b5 | ||
![]() |
031dbed6a9 | ||
![]() |
f20dfa00c2 | ||
![]() |
24c91cb6f0 | ||
![]() |
abca91c26a | ||
![]() |
3321eafffa | ||
![]() |
adc9275d3f | ||
![]() |
60eed00cb2 | ||
![]() |
c29ab4b920 | ||
![]() |
9d46de56c3 | ||
![]() |
3f9d88e733 | ||
![]() |
6e576919ab | ||
![]() |
9739583f43 | ||
![]() |
bc1ec72df1 | ||
![]() |
e62dc5f597 | ||
![]() |
b5e9c8ba34 | ||
![]() |
9a8fd1c073 | ||
![]() |
25c1d3c917 | ||
![]() |
f435300740 | ||
![]() |
299567dd7c | ||
![]() |
fe1740d76f | ||
![]() |
f840f02daf | ||
![]() |
5640d4d4f6 | ||
![]() |
7105bc85e3 | ||
![]() |
61c10821b6 | ||
![]() |
ea3f99654d | ||
![]() |
30f494fc35 | ||
![]() |
367e58a8cf | ||
![]() |
99274b9c73 | ||
![]() |
51935d203a | ||
![]() |
9d3e832081 | ||
![]() |
4c72861eda | ||
![]() |
d0ea7e5452 | ||
![]() |
7d70b5826b | ||
![]() |
a00d1ee7ce | ||
![]() |
7296a10ec1 | ||
![]() |
957df690f4 | ||
![]() |
45d5c23512 | ||
![]() |
caa224cbb6 | ||
![]() |
9be92b41d1 | ||
![]() |
6e8fea3bdd | ||
![]() |
df87cfb037 | ||
![]() |
d73e5f9c22 | ||
![]() |
6884f1466f | ||
![]() |
d308131a8a | ||
![]() |
b3ebe8309a | ||
![]() |
fa35ef2bef | ||
![]() |
0785fcd144 | ||
![]() |
2dcc765072 | ||
![]() |
b8e8968866 | ||
![]() |
92040c6efb | ||
![]() |
a3d2ee57f7 | ||
![]() |
90835a7fe3 | ||
![]() |
ca2a9c235b | ||
![]() |
29b074f6dd | ||
![]() |
2f8acbbcdf | ||
![]() |
41a35b487a | ||
![]() |
7a33549a79 | ||
![]() |
d81b3e9a9e | ||
![]() |
da08798b10 | ||
![]() |
41cc82d54d | ||
![]() |
c8d184465a | ||
![]() |
adc04a1a40 | ||
![]() |
62da367589 | ||
![]() |
04ac1a8881 | ||
![]() |
dfd6ecc744 | ||
![]() |
69cb0718be | ||
![]() |
7dc7716f18 | ||
![]() |
633a1d3a4c | ||
![]() |
64b5f89fdf | ||
![]() |
f87dd2c3b1 | ||
![]() |
8b3dfe69e4 | ||
![]() |
375b0a3593 | ||
![]() |
bd907b4dde | ||
![]() |
73a2b2dfb9 | ||
![]() |
2f28d71060 | ||
![]() |
01ce517629 | ||
![]() |
033ca95dfe | ||
![]() |
0fa277c50e | ||
![]() |
e8ded0cb30 | ||
![]() |
cc6e40c9d0 |
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* text=lf
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,8 +2,13 @@
|
|||||||
node_modules
|
node_modules
|
||||||
005_references/
|
005_references/
|
||||||
_archive/
|
_archive/
|
||||||
|
|
||||||
_del
|
_del
|
||||||
*.bak
|
*.bak
|
||||||
*.log
|
*.log
|
||||||
*.del
|
*.del
|
||||||
**/_del
|
**/_del
|
||||||
|
|
||||||
|
**/volumes/**
|
||||||
|
006_lab
|
||||||
|
**/*.draft
|
||||||
|
10
.prettierrc
Normal file
10
.prettierrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"printWidth": 120,
|
||||||
|
"quoteProps": "consistent",
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"plugins": []
|
||||||
|
}
|
12
.vscode/extensions.json
vendored
Normal file
12
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"aflalo.dbml-formatter",
|
||||||
|
"bierner.markdown-mermaid",
|
||||||
|
"christian-kohler.path-intellisense",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"humao.rest-client",
|
||||||
|
"matt-meyers.vscode-dbml",
|
||||||
|
"nicolas-liger.dbml-viewer",
|
||||||
|
"yzhang.markdown-all-in-one"
|
||||||
|
]
|
||||||
|
}
|
21
.vscode/settings.json
vendored
Normal file
21
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[javascriptreact]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[jsonc]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescriptreact]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"workbench.iconTheme": "material-icon-theme",
|
||||||
|
"workbench.colorTheme": "Default Dark Modern",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
|
}
|
25
000_AI_WORKSPACE/software-engineer/_examples/001_clone.md
Normal file
25
000_AI_WORKSPACE/software-engineer/_examples/001_clone.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
this `tsx` file is clone from elsewhere, please understand, modify and update the content of `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/app/dashboard/teachers/view/[id]/page.tsx.draft` to handle `Teacher` record thanks, modify comments/variables/paths/functions name please
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
please review and update all tsx files in folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Users` to make it handle `user` record thanks
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- read and understand @/_AI_WORKSPACE/greetings/001_greetings.md -->
|
||||||
|
## clone source code from one type to another
|
||||||
|
|
||||||
|
please understand, modify and update the content of `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/teacher/_GUIDELINES.md` to handle `Teacher` record thanks,
|
||||||
|
modify comments/variables/paths/functions name please
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
please help to update the tsx files inside folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/student` to handle the `student` record
|
||||||
|
|
||||||
|
## steps
|
||||||
|
|
||||||
|
- list all `tsx` files inside directory, remember the list
|
||||||
|
- clone the original `<original>.tsx` files to `<original>.tsx.draft`
|
||||||
|
- do all your modification within `<original>.tsx.draft` files, leave `original.tsx` unchange
|
||||||
|
|
||||||
|
---
|
@@ -0,0 +1,33 @@
|
|||||||
|
Hi, i need your help.
|
||||||
|
|
||||||
|
## task
|
||||||
|
|
||||||
|
i am working on a `dbml` file
|
||||||
|
i got a `schema.json` which is exported from pocketbase
|
||||||
|
and i want to update it to my current `dbml` file (one way process for documentation usage)
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
- the collection from `json` file started with `_` can be ignored. they are system collection and should not appear in `dbml`
|
||||||
|
- one collection from `json` file mapped with one table in `dbml` file
|
||||||
|
- the `presentable` field from `json` file should be ignored.
|
||||||
|
- the `id` of collection in `json` file should be jod down in the comment of `dbml` file as an reference.
|
||||||
|
- you can find the comments in `schema.dbml` contains `pb_xxx` and that is the reference to the table in `schema.json` file.
|
||||||
|
|
||||||
|
## steps
|
||||||
|
|
||||||
|
- list the collection
|
||||||
|
|
||||||
|
## information
|
||||||
|
|
||||||
|
json file: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.json`
|
||||||
|
dbml file: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
1. 对于json中有但dbml中没有的表,应该如何处理? 添加为新表
|
||||||
|
1. 是否需要保留dbml文件中现有的注释和关系定义? 完全保留
|
||||||
|
1. 字段类型映射是否有特殊规则? 沒有
|
||||||
|
1. please keep the existing comment
|
||||||
|
|
||||||
|
thanks
|
@@ -0,0 +1,11 @@
|
|||||||
|
# Greetings
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
Imaging you are a software engineer and i will send you the guideline.
|
||||||
|
plesae read it, prepare yourself and i will tell you the task afterwards
|
||||||
|
|
||||||
|
please read and understand the markdown files in directory
|
||||||
|
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/000_AI_WORKSPACE/software_engineer/greetings`,
|
||||||
|
it provides background information of project i want you to help.
|
||||||
|
|
||||||
|
thanks
|
@@ -0,0 +1,32 @@
|
|||||||
|
# guideline
|
||||||
|
|
||||||
|
## principles
|
||||||
|
|
||||||
|
- at any time, please keep your answer, solution, explaination simple and short (K.I.S.S. or 大道至簡)
|
||||||
|
- please divide the problem into small parts
|
||||||
|
- if you found youself cannot understand the problem, please stop and ask how to do
|
||||||
|
- if you found youself cannot solve the problem, plesae stop and ask how to do
|
||||||
|
- review the whole solution before you reply to user
|
||||||
|
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
||||||
|
- no need to explain the reason until you are told to do so
|
||||||
|
- no need to show me the code change, at the end just simple summary in point form is ok
|
||||||
|
|
||||||
|
## highlighted project directories and their meanings
|
||||||
|
|
||||||
|
- `_ignore_this_directory` please ignore this directory and any files inside it
|
||||||
|
|
||||||
|
- `001_documentation` documentation of this project
|
||||||
|
- `002_source` source code of this project
|
||||||
|
- `002_source/cms` home of Context management system of this project
|
||||||
|
- use singular form for `src/components/dashboard` (e.g. `src/components/dashboard/student`)
|
||||||
|
- use plural form for `src/app/dashboard` (e.g. `src/app/dashboard/students`)
|
||||||
|
- `002_source/ionic_mobile` home of mobile client of this project
|
||||||
|
- `002_source/pocketbase` home of pocketbase home directory this project
|
||||||
|
- `003_test` e2e test of this project (not yet implemented)
|
||||||
|
- `004_marketing` marketing page of this project (not yet implemented)
|
||||||
|
- `005_references` opensource refence of this project
|
||||||
|
- `006_lab` my test (POC) of this project
|
||||||
|
- `README.md` Readme of this project
|
||||||
|
- `TODO.md` todo list of this project
|
||||||
|
|
||||||
|
- if the directory contains `_GUIDELINES.md`, please read it before operation
|
@@ -0,0 +1,12 @@
|
|||||||
|
# Knowledgebase
|
||||||
|
|
||||||
|
you can answer the question with below knowledge:
|
||||||
|
|
||||||
|
## frameworks and stacks
|
||||||
|
|
||||||
|
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
||||||
|
- make use of MCP `Context7` when you troubleshoot the problem with below topics:
|
||||||
|
- [pocketbase javascript SDK](https://context7.com/pocketbase/js-sdk/llms.txt)
|
||||||
|
- [DBML](https://context7.com/holistics/dbml/llms.txt)
|
||||||
|
- [ionic framework](https://context7.com/ionic-team/ionic-framework/llms.txt)
|
||||||
|
- [nextjs 14 app router](https://context7.com/nextjsargentina/next.js-docs/llms.txt)
|
22
000_AI_WORKSPACE/software-engineer/greetings/010_FAQ.md
Normal file
22
000_AI_WORKSPACE/software-engineer/greetings/010_FAQ.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# FAQ
|
||||||
|
|
||||||
|
Q: where is `dbml` file ?
|
||||||
|
A: dbml file located in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
|
||||||
|
Q: when file not found, do i need to search it in `_ignore_this_directory` ?
|
||||||
|
A: No, you just stop there and voice out.
|
||||||
|
|
||||||
|
Q: Shall I assume the component is already exist ?
|
||||||
|
A: yes, you can assume that
|
||||||
|
|
||||||
|
Q: Is `COL_USER_METAS` the collection for User related (e.g. `Teacher`, `Student`) collections?
|
||||||
|
A: yes
|
||||||
|
|
||||||
|
Q: Shall I verify `import` or `types` when do modification job ?
|
||||||
|
A: No, you just replace the name of the function, variables etc is ok. no need to check for dependencies thanks.
|
||||||
|
|
||||||
|
Q: how to list files with `.tsx.draft` extensions in `src/db/UserMetas` folder?
|
||||||
|
A: using command like `find src/db/UserMetas -name "*.tsx.draft" -type f -ls` to list the files with `.tsx.draft` extendions only exist in `src/db/UserMetas`
|
||||||
|
|
||||||
|
Q: when user want to modify `.tsx.draft` file, do i need to take care the `.tsx` file as well?
|
||||||
|
A: No, no don't need to, user will handle the remaining modifications. please restrict your modification in the mentioned file or directory only.
|
39
000_AI_WORKSPACE/software-engineer/greetings/013_DB.md
Normal file
39
000_AI_WORKSPACE/software-engineer/greetings/013_DB.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# database and schemas
|
||||||
|
|
||||||
|
## getting started
|
||||||
|
|
||||||
|
Imagine there is a:
|
||||||
|
|
||||||
|
1. developer (provide the modification)
|
||||||
|
2. QA engineer (provide the feedback, and testing)
|
||||||
|
3. software engineer
|
||||||
|
4. technical writer
|
||||||
|
|
||||||
|
they will:
|
||||||
|
|
||||||
|
- conclude and integrate the ideas from developer and QA engineer
|
||||||
|
- make decision to modify the code accordingly.
|
||||||
|
|
||||||
|
## project background and initial setup
|
||||||
|
|
||||||
|
- **IMPORTANT**: No need to reply me what you are going on and your digest in this phase.
|
||||||
|
No need to show me your code plan
|
||||||
|
Just reply me "OK" when done
|
||||||
|
|
||||||
|
- base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
||||||
|
|
||||||
|
- `schema.dbml`
|
||||||
|
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
this is file in `dbml` format stating the main database structure
|
||||||
|
|
||||||
|
- `schema.json`
|
||||||
|
- read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||||
|
this is the file of current pocketbase schema
|
||||||
|
|
||||||
|
- look into the md files in folder `<base_dir>/002_source/ionic_mobile/_AI_WORKSPACE/001_guideline`
|
||||||
|
|
||||||
|
- if the directory user provided contins `_GUIDELINES.md`, please read the file
|
||||||
|
|
||||||
|
- read the files, remember and link up the ideas in file stated above, i will tell them the task afterwards
|
||||||
|
|
||||||
|
- please review at least 3 times after you modified the code
|
21
000_AI_WORKSPACE/testing-engineer/_examples/001_clone.md
Normal file
21
000_AI_WORKSPACE/testing-engineer/_examples/001_clone.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
please review and update all tsx files in folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Users` to make it handle `user` record thanks
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- read and understand @/_AI_WORKSPACE/greetings/001_greetings.md -->
|
||||||
|
## clone source code from one type to another
|
||||||
|
|
||||||
|
please understand, modify and update the content of `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/teacher/_GUIDELINES.md` to handle `Teacher` record thanks,
|
||||||
|
modify comments/variables/paths/functions name please
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
please help to update the tsx files inside folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/student` to handle the `student` record
|
||||||
|
|
||||||
|
## steps
|
||||||
|
|
||||||
|
- list all `tsx` files inside directory, remember the list
|
||||||
|
- clone the original `<original>.tsx` files to `<original>.tsx.draft`
|
||||||
|
- do all your modification within `<original>.tsx.draft` files, leave `original.tsx` unchange
|
||||||
|
|
||||||
|
---
|
@@ -0,0 +1,33 @@
|
|||||||
|
Hi, i need your help.
|
||||||
|
|
||||||
|
## task
|
||||||
|
|
||||||
|
i am working on a `dbml` file
|
||||||
|
i got a `schema.json` which is exported from pocketbase
|
||||||
|
and i want to update it to my current `dbml` file (one way process for documentation usage)
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
- the collection from `json` file started with `_` can be ignored. they are system collection and should not appear in `dbml`
|
||||||
|
- one collection from `json` file mapped with one table in `dbml` file
|
||||||
|
- the `presentable` field from `json` file should be ignored.
|
||||||
|
- the `id` of collection in `json` file should be jod down in the comment of `dbml` file as an reference.
|
||||||
|
- you can find the comments in `schema.dbml` contains `pb_xxx` and that is the reference to the table in `schema.json` file.
|
||||||
|
|
||||||
|
## steps
|
||||||
|
|
||||||
|
- list the collection
|
||||||
|
|
||||||
|
## information
|
||||||
|
|
||||||
|
json file: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.json`
|
||||||
|
dbml file: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
1. 对于json中有但dbml中没有的表,应该如何处理? 添加为新表
|
||||||
|
1. 是否需要保留dbml文件中现有的注释和关系定义? 完全保留
|
||||||
|
1. 字段类型映射是否有特殊规则? 沒有
|
||||||
|
1. please keep the existing comment
|
||||||
|
|
||||||
|
thanks
|
@@ -0,0 +1,8 @@
|
|||||||
|
Hi, i will send you the guideline,
|
||||||
|
plesae read it, prepare yourself and i will tell you the task afterwards
|
||||||
|
|
||||||
|
please read and understand the markdown files in directory
|
||||||
|
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/000_AI_WORKSPACE/_AI_WORKSPACE/greetings`,
|
||||||
|
it provides background information of project i want you to help.
|
||||||
|
|
||||||
|
thanks
|
28
000_AI_WORKSPACE/testing-engineer/greetings/002_guideline.md
Normal file
28
000_AI_WORKSPACE/testing-engineer/greetings/002_guideline.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# guideline
|
||||||
|
|
||||||
|
## principles
|
||||||
|
|
||||||
|
- at any time, please keep your answer, solution, explaination simple and short (K.I.S.S. or 大道至簡)
|
||||||
|
- please divide the problem into small parts
|
||||||
|
- if you found youself cannot understand the problem, please stop and ask how to do
|
||||||
|
- if you found youself cannot solve the problem, plesae stop and ask how to do
|
||||||
|
- review the whole solution before you reply to user
|
||||||
|
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
||||||
|
- no need to explain the reason until you are told to do so
|
||||||
|
- no need to show me the code change, at the end just simple summary in point form is ok
|
||||||
|
|
||||||
|
## highlighted project directories and their meanings
|
||||||
|
|
||||||
|
- `_ignore_this_directory` please ignore this directory and any files inside it
|
||||||
|
|
||||||
|
- `001_documentation` documentation of this project
|
||||||
|
- `002_source` source code of this project
|
||||||
|
- `002_source/cms` home of Context management system of this project
|
||||||
|
- `002_source/ionic_mobile` home of mobile client of this project
|
||||||
|
- `002_source/pocketbase` home of pocketbase home directory this project
|
||||||
|
- `003_test` e2e test of this project (not yet implemented)
|
||||||
|
- `004_marketing` marketing page of this project (not yet implemented)
|
||||||
|
- `005_references` opensource refence of this project
|
||||||
|
- `006_lab` my test (POC) of this project
|
||||||
|
- `README.md` Readme of this project
|
||||||
|
- `TODO.md` todo list of this project
|
@@ -0,0 +1,12 @@
|
|||||||
|
# Knowledgebase
|
||||||
|
|
||||||
|
you can answer the question with below knowledge:
|
||||||
|
|
||||||
|
## frameworks and stacks
|
||||||
|
|
||||||
|
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
||||||
|
- make use of MCP `Context7` when you troubleshoot the problem with below topics:
|
||||||
|
- [pocketbase javascript SDK](https://context7.com/pocketbase/js-sdk/llms.txt)
|
||||||
|
- [DBML](https://context7.com/holistics/dbml/llms.txt)
|
||||||
|
- [ionic framework](https://context7.com/ionic-team/ionic-framework/llms.txt)
|
||||||
|
- [nextjs 14 app router](https://context7.com/nextjsargentina/next.js-docs/llms.txt)
|
7
000_AI_WORKSPACE/testing-engineer/greetings/010_FAQ.md
Normal file
7
000_AI_WORKSPACE/testing-engineer/greetings/010_FAQ.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# FAQ
|
||||||
|
|
||||||
|
Q: where is `dbml` file ?
|
||||||
|
A: dbml file located in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
|
||||||
|
Q: when file not found, do i need to search it in `_ignore_this_directory` ?
|
||||||
|
A: No, you just stop there and voice out.
|
48
000_AI_WORKSPACE/testing-engineer/greetings/013_DB.md
Normal file
48
000_AI_WORKSPACE/testing-engineer/greetings/013_DB.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# database and schemas
|
||||||
|
|
||||||
|
## getting started
|
||||||
|
|
||||||
|
Imagine there is a:
|
||||||
|
|
||||||
|
1. developer (provide the modification)
|
||||||
|
2. QA engineer (provide the feedback, and testing)
|
||||||
|
3. software engineer
|
||||||
|
4. technical writer
|
||||||
|
|
||||||
|
they will:
|
||||||
|
|
||||||
|
- conclude and integrate the ideas from developer and QA engineer
|
||||||
|
- make decision to modify the code accordingly.
|
||||||
|
|
||||||
|
## project background and initial setup
|
||||||
|
|
||||||
|
- **IMPORTANT**: No need to reply me what you are going on and your digest in this phase.
|
||||||
|
No need to show me your code plan
|
||||||
|
Just reply me "OK" when done
|
||||||
|
|
||||||
|
- base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
||||||
|
|
||||||
|
- `schema.dbml`
|
||||||
|
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
this is file in `dbml` format stating the main database structure
|
||||||
|
|
||||||
|
- `schema.json`
|
||||||
|
- read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||||
|
this is the file of current pocketbase schema
|
||||||
|
|
||||||
|
- look into the md files in folder `<base_dir>/002_source/ionic_mobile/_AI_WORKSPACE/001_guideline`
|
||||||
|
|
||||||
|
- if the directory user provided contins `_GUIDELINES.md`, please read the file
|
||||||
|
|
||||||
|
- read the files, remember and link up the ideas in file stated above, i will tell them the task afterwards
|
||||||
|
|
||||||
|
- please review at least 3 times after you modified the code
|
||||||
|
|
||||||
|
## frameworks documentation and samples
|
||||||
|
|
||||||
|
- react
|
||||||
|
- ionic and capacitor
|
||||||
|
- pocketbase
|
||||||
|
- tanstack/react-query
|
||||||
|
- vite
|
||||||
|
- typescript
|
2
001_documentation/.vscode/extensions.json
vendored
2
001_documentation/.vscode/extensions.json
vendored
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"redhat.vscode-yaml",
|
|
||||||
"yzhang.markdown-all-in-one",
|
"yzhang.markdown-all-in-one",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"ms-python.python",
|
"ms-python.python",
|
||||||
@@ -8,7 +7,6 @@
|
|||||||
"ms-python.debugpy",
|
"ms-python.debugpy",
|
||||||
"ms-python.black-formatter",
|
"ms-python.black-formatter",
|
||||||
"ms-python.isort",
|
"ms-python.isort",
|
||||||
"ms-python.pylint",
|
|
||||||
"bierner.markdown-mermaid",
|
"bierner.markdown-mermaid",
|
||||||
"shd101wyy.markdown-preview-enhanced",
|
"shd101wyy.markdown-preview-enhanced",
|
||||||
"yzhang.markdown-all-in-one",
|
"yzhang.markdown-all-in-one",
|
||||||
|
@@ -24,5 +24,4 @@ mindmap
|
|||||||
Tools
|
Tools
|
||||||
Pen and paper
|
Pen and paper
|
||||||
Mermaid
|
Mermaid
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@@ -1,9 +1,27 @@
|
|||||||
---
|
---
|
||||||
tags: mobile, lesson
|
tags: time
|
||||||
---
|
---
|
||||||
|
|
||||||
# lesson page documentation
|
# time tracking
|
||||||
|
|
||||||
it should have a lesson page
|
T.B.A.
|
||||||
|
|
||||||

|
```mermaid
|
||||||
|
gantt
|
||||||
|
title A Gantt Diagram
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
section Section
|
||||||
|
A task :a1, 2014-01-01, 30d
|
||||||
|
Another task :after a1, 20d
|
||||||
|
section Another
|
||||||
|
Task in Another :2014-01-12, 12d
|
||||||
|
another task :24d
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## TODOs of the project
|
||||||
|
|
||||||
|
- [cms TODO](../../../002_source/cms/TODO.md)
|
||||||
|
- [ionic TODO](../../../002_source/ionic_mobile/TODO.md)
|
||||||
|
- [pocketbase TODO](../../../002_source/pocketbase/TODO.md)
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
# task
|
||||||
|
|
||||||
|
update `dbml` from `schema.json`, for collection `billingAddress`
|
||||||
|
|
||||||
|
## Background information
|
||||||
|
|
||||||
|
1. please ignore `presentable` properties from `schema.json`, this is for pocketbase internal usage
|
||||||
|
1. please ignore collections with `_` as its first character, this is for pocketbase internal usage
|
||||||
|
1. just return the collection with `billingAddress` is ok, please ignore other collections
|
||||||
|
|
||||||
|
## steps
|
||||||
|
|
||||||
|
1. read file `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/schema.json`. this is the export from `pocketbase`.
|
||||||
|
1. read file `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema.dbml`. this is file written in dbml format.
|
||||||
|
1. currently the collection in `schama.json` is mapped to table in `schema.dbml`
|
||||||
|
1. compare the `schema.json` and `schema.dbml`, remember the differences
|
||||||
|
1. you may found some comment already exist in `schema.dbml`, please keep them
|
||||||
|
1. while keeping `schema.json` content unchanged. write file to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006/schema_ai_draft.dbml` content based on `schema.json`.
|
||||||
|
|
||||||
|
thanks.
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# LessonCategories / LessonCategory
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listLessonCategories.ts to cover `LessonCategories`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistLessonCategories,`
|
|
||||||
- `getListByFilterLessonCategories,`
|
|
||||||
- `getFirstListItemLessonCategories,`
|
|
||||||
- `getOneLessonCategory,`
|
|
||||||
- `getListLessonCategoryById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# LessonTypes / LessonType
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listLessonTypes.ts to cover `LessonTypes`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistLessonTypes,`
|
|
||||||
- `getListByFilterLessonTypes,`
|
|
||||||
- `getFirstListItemLessonTypes,`
|
|
||||||
- `getOneLessonType,`
|
|
||||||
- `getListLessonTypeById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# QuizCategories / QuizCategory
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listQuizCategories.ts to cover `QuizCategories`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistQuizCategories,`
|
|
||||||
- `getListByFilterQuizCategories,`
|
|
||||||
- `getFirstListItemQuizCategories,`
|
|
||||||
- `getOneQuizCategory,`
|
|
||||||
- `getListQuizCategoryById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# QuizConnectives / QuizConnective
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listQuizConnectives.ts to cover `QuizConnectives`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistQuizConnectives,`
|
|
||||||
- `getListByFilterQuizConnectives,`
|
|
||||||
- `getFirstListItemQuizConnectives,`
|
|
||||||
- `getOneQuizConnective,`
|
|
||||||
- `getListQuizConnectiveById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# QuizConnectivesCategories / QuizConnectivesCategory
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listQuizConnectivesCategories.ts to cover `QuizConnectivesCategories`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistQuizConnectivesCategories,`
|
|
||||||
- `getListByFilterQuizConnectivesCategories,`
|
|
||||||
- `getFirstListItemQuizConnectivesCategories,`
|
|
||||||
- `getOneQuizConnectivesCategory,`
|
|
||||||
- `getListQuizConnectivesCategoryById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# QuizListenings / QuizListening
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listQuizListenings.ts to cover `QuizListenings`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistQuizListenings,`
|
|
||||||
- `getListByFilterQuizListenings,`
|
|
||||||
- `getFirstListItemQuizListenings,`
|
|
||||||
- `getOneQuizListening,`
|
|
||||||
- `getListQuizListeningById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# QuizMatchings / QuizMatching
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listQuizMatchings.ts to cover `QuizMatchings`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistQuizMatchings,`
|
|
||||||
- `getListByFilterQuizMatchings,`
|
|
||||||
- `getFirstListItemQuizMatchings,`
|
|
||||||
- `getOneQuizMatching,`
|
|
||||||
- `getListQuizMatchingById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# UserMetas / UserMeta
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listUserMetas.ts to cover `UserMetas`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistUserMetas,`
|
|
||||||
- `getListByFilterUserMetas,`
|
|
||||||
- `getFirstListItemUserMetas,`
|
|
||||||
- `getOneUserMeta,`
|
|
||||||
- `getListUserMetaById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# Users / User
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listUsers.ts to cover `Users`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistUsers,`
|
|
||||||
- `getListByFilterUsers,`
|
|
||||||
- `getFirstListItemUsers,`
|
|
||||||
- `getOneUser,`
|
|
||||||
- `getListUserById`
|
|
||||||
|
|
||||||
thanks
|
|
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
# Vocabularies / Vocabulary
|
|
||||||
|
|
||||||
Hi, using information from
|
|
||||||
|
|
||||||
- @schema.dbml for schemas, fields and table names,
|
|
||||||
- @listHelloworld.ts for skeleton for ts script
|
|
||||||
- @listVocabularies.ts, @listUserMetas.ts, @listQuizListening.ts, @listQuisMatching.ts, @listQuizConnectivesCategories for reference
|
|
||||||
|
|
||||||
extend @listVocabularies.ts to cover `Vocabularies`,
|
|
||||||
draft `ts` code
|
|
||||||
|
|
||||||
- `CRUD`
|
|
||||||
- `getFulllistVocabularies,`
|
|
||||||
- `getListByFilterVocabularies,`
|
|
||||||
- `getFirstListItemVocabularies,`
|
|
||||||
- `getOneVocabulary,`
|
|
||||||
- `getListVocabularyById`
|
|
||||||
|
|
||||||
thanks
|
|
6
001_documentation/Requirements/REQ0006/_GUIDELINE.md
Normal file
6
001_documentation/Requirements/REQ0006/_GUIDELINE.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# GUIDELINES
|
||||||
|
|
||||||
|
- `schema.dbml` means DB schema in `dbml` format
|
||||||
|
- `schema.json` contains the exported DB schema from pocketbase
|
||||||
|
- the `Collection ID: xxx` in `dbml` file contains the collection `id` mapping from `schema.json`
|
||||||
|
- the `presentable` field from `json` file should be ignored.
|
@@ -0,0 +1,45 @@
|
|||||||
|
# AI GUIDELINE
|
||||||
|
|
||||||
|
## getting started
|
||||||
|
|
||||||
|
Imagine there is a software developer and a QA engineer to solve the problems together
|
||||||
|
|
||||||
|
They will:
|
||||||
|
|
||||||
|
no need to reply me what you are going on and your digest in this phase.
|
||||||
|
just reply me "OK" when done
|
||||||
|
|
||||||
|
base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
||||||
|
|
||||||
|
- `schema.dbml`
|
||||||
|
|
||||||
|
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||||
|
this is file in dbml syntax state the main database
|
||||||
|
|
||||||
|
- `schema.json`
|
||||||
|
|
||||||
|
- read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||||
|
this is the file of live pocketbase schema output
|
||||||
|
|
||||||
|
- read `<base_dir>/002_source/cms/src/constants.ts`
|
||||||
|
this is the content of `@/constants`
|
||||||
|
|
||||||
|
- look into the md files in folder `<base_dir>/002_source/cms/_AI_WORKSPACE/001_guideline`
|
||||||
|
|
||||||
|
- read, remember and link up the ideas in file stated above,
|
||||||
|
i will tell them the task afterwards
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Hi, i have 2 files
|
||||||
|
`schema.json` is a export from pocketbase (e.g. collections and fields)
|
||||||
|
`schema.dbml` is schema file for presentation of the database (e.g. tables)
|
||||||
|
|
||||||
|
please take a look in `schema.dbml` and `schema.json`,
|
||||||
|
associate the existing `collection` from json file to the `table` in dbml file
|
||||||
|
|
||||||
|
keep `schema.json` remain unchanged and update `schema.dbml` to match it.
|
||||||
|
|
||||||
|
please modify the `schema.dbml` to align with `schema.json`
|
||||||
|
|
||||||
|
to the collection `QuizLPCategories` align the dbml file in the previous prompt
|
86
001_documentation/Requirements/REQ0006/convert.js
Normal file
86
001_documentation/Requirements/REQ0006/convert.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
//
|
||||||
|
// # REQ0015:
|
||||||
|
// ## PURPOSE:
|
||||||
|
//
|
||||||
|
// This is a script to convert `schema.json` exported from pocketbase to dbml formatted file `schema.dbml`
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
// Load schema.json
|
||||||
|
const schemaPath = path.join(process.cwd(), "schema.json");
|
||||||
|
const schema = JSON.parse(fs.readFileSync(schemaPath, "utf8"));
|
||||||
|
|
||||||
|
// Type mapping from PocketBase to DBML/SQL
|
||||||
|
const typeMapping = {
|
||||||
|
text: "text",
|
||||||
|
number: "integer",
|
||||||
|
bool: "boolean",
|
||||||
|
email: "text",
|
||||||
|
url: "varchar",
|
||||||
|
date: "datetime",
|
||||||
|
select: "varchar",
|
||||||
|
json: "text",
|
||||||
|
file: "file",
|
||||||
|
password: "varchar",
|
||||||
|
relation: "integer", // Assuming relations are stored as integer IDs
|
||||||
|
autodate: "datetime",
|
||||||
|
};
|
||||||
|
|
||||||
|
function convertToDBML(schema) {
|
||||||
|
let dbml = "";
|
||||||
|
dbml = "// Generated at: " + new Date().toISOString();
|
||||||
|
dbml = dbml + "\n\n\n";
|
||||||
|
|
||||||
|
let collectionIdToTableMapping = {};
|
||||||
|
for (const [idx, tableDef] of Object.entries(schema)) {
|
||||||
|
collectionIdToTableMapping[tableDef.id] = tableDef.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [idx, tableDef] of Object.entries(schema)) {
|
||||||
|
console.log({ idx });
|
||||||
|
dbml += `// \n`;
|
||||||
|
dbml += `// collection id: ${tableDef.id} \n`;
|
||||||
|
dbml += `// collection name: ${tableDef.name} \n`;
|
||||||
|
dbml += `// collection type: ${tableDef.type} \n`;
|
||||||
|
dbml += `Table ${tableDef.name} {\n`;
|
||||||
|
|
||||||
|
for (const field of tableDef.fields) {
|
||||||
|
// Get field type
|
||||||
|
let fieldType = typeMapping[field.type] || "text";
|
||||||
|
|
||||||
|
// Handle special cases
|
||||||
|
if (field.type === "number" && field.options?.max === 1) {
|
||||||
|
fieldType = "boolean";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build field definition
|
||||||
|
let line = ` ${field.name} ${fieldType}`;
|
||||||
|
|
||||||
|
// Add constraints
|
||||||
|
const constraints = [];
|
||||||
|
if (field.name === "id" || field.primary) constraints.push("pk");
|
||||||
|
if (field.required) constraints.push("not null");
|
||||||
|
if (constraints.length > 0) line += ` [${constraints.join(", ")}]`;
|
||||||
|
|
||||||
|
if (field.collectionId) {
|
||||||
|
line += ` [ref: > ${
|
||||||
|
collectionIdToTableMapping[field.collectionId]
|
||||||
|
}.id] // ${field.id}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbml += `${line}\n`;
|
||||||
|
console.log({ line });
|
||||||
|
}
|
||||||
|
|
||||||
|
dbml += "}\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dbml;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert and save
|
||||||
|
const dbmlOutput = convertToDBML(schema);
|
||||||
|
fs.writeFileSync("schema.dbml", dbmlOutput);
|
||||||
|
console.log("DBML file generated successfully!");
|
@@ -0,0 +1,31 @@
|
|||||||
|
import { faker } from "@faker-js/faker";
|
||||||
|
|
||||||
|
const getId = (id) => id.padStart(15, "0");
|
||||||
|
|
||||||
|
const row_array = Array.from({ length: 10 }, (_, i) => [
|
||||||
|
getId(String(i + 1)),
|
||||||
|
faker.person.firstName(),
|
||||||
|
"",
|
||||||
|
faker.internet.email(),
|
||||||
|
faker.phone.number(),
|
||||||
|
faker.company.name(),
|
||||||
|
{
|
||||||
|
country: faker.location.country(),
|
||||||
|
state: faker.location.state(),
|
||||||
|
city: faker.location.city(),
|
||||||
|
zipCode: faker.location.zipCode(),
|
||||||
|
line1: faker.location.streetAddress(),
|
||||||
|
line2: faker.location.secondaryAddress(),
|
||||||
|
},
|
||||||
|
Math.floor(Math.random() * (100 - 0 + 1)) + 0,
|
||||||
|
faker.location.timeZone(),
|
||||||
|
["en", "de", "es", "fr", "ja", "ko", "zh-CN"].sort(
|
||||||
|
() => Math.random() - 0.5
|
||||||
|
)[0],
|
||||||
|
faker.finance.currencyCode(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
import fs from "fs";
|
||||||
|
const filePath = "output.json";
|
||||||
|
fs.writeFileSync(filePath, JSON.stringify(row_array, null, 2));
|
||||||
|
console.log(`Wrote ${row_array.length} records to ${filePath}`);
|
202
001_documentation/Requirements/REQ0006/gen_customer/output.json
Normal file
202
001_documentation/Requirements/REQ0006/gen_customer/output.json
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
[
|
||||||
|
[
|
||||||
|
"000000000000001",
|
||||||
|
"May",
|
||||||
|
"",
|
||||||
|
"June_Wintheiser33@hotmail.com",
|
||||||
|
"281-378-5900 x822",
|
||||||
|
"Green, Rempel and Hoeger",
|
||||||
|
{
|
||||||
|
"country": "Central African Republic",
|
||||||
|
"state": "Arizona",
|
||||||
|
"city": "Winfieldburgh",
|
||||||
|
"zipCode": "92017-8004",
|
||||||
|
"line1": "1838 Willa Freeway",
|
||||||
|
"line2": "Suite 307"
|
||||||
|
},
|
||||||
|
98,
|
||||||
|
"Asia/Urumqi",
|
||||||
|
"de",
|
||||||
|
"MUR"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000002",
|
||||||
|
"Marilyne",
|
||||||
|
"",
|
||||||
|
"Carol_Blick@yahoo.com",
|
||||||
|
"(893) 919-2445 x193",
|
||||||
|
"White - Hessel",
|
||||||
|
{
|
||||||
|
"country": "Iraq",
|
||||||
|
"state": "Nevada",
|
||||||
|
"city": "Casa Grande",
|
||||||
|
"zipCode": "83831-3843",
|
||||||
|
"line1": "6984 Alberto Radial",
|
||||||
|
"line2": "Suite 154"
|
||||||
|
},
|
||||||
|
49,
|
||||||
|
"Africa/Tunis",
|
||||||
|
"zh-CN",
|
||||||
|
"CHF"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000003",
|
||||||
|
"Jacklyn",
|
||||||
|
"",
|
||||||
|
"Tamara_Lynch11@yahoo.com",
|
||||||
|
"597-593-0144 x168",
|
||||||
|
"Rolfson LLC",
|
||||||
|
{
|
||||||
|
"country": "Grenada",
|
||||||
|
"state": "Georgia",
|
||||||
|
"city": "New Brodyfort",
|
||||||
|
"zipCode": "18887-7075",
|
||||||
|
"line1": "493 Pfannerstill Meadow",
|
||||||
|
"line2": "Apt. 358"
|
||||||
|
},
|
||||||
|
44,
|
||||||
|
"Asia/Manila",
|
||||||
|
"zh-CN",
|
||||||
|
"CDF"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000004",
|
||||||
|
"Alana",
|
||||||
|
"",
|
||||||
|
"Ahmed_Willms@hotmail.com",
|
||||||
|
"401.212.0386 x31125",
|
||||||
|
"Friesen, Langworth and Thompson",
|
||||||
|
{
|
||||||
|
"country": "Australia",
|
||||||
|
"state": "North Carolina",
|
||||||
|
"city": "Fort Jerrell",
|
||||||
|
"zipCode": "14211",
|
||||||
|
"line1": "1763 West Street",
|
||||||
|
"line2": "Suite 699"
|
||||||
|
},
|
||||||
|
34,
|
||||||
|
"America/Boa_Vista",
|
||||||
|
"ja",
|
||||||
|
"KES"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000005",
|
||||||
|
"Rocky",
|
||||||
|
"",
|
||||||
|
"Angela_Kuhic@gmail.com",
|
||||||
|
"653.964.0412",
|
||||||
|
"Hayes - Morar",
|
||||||
|
{
|
||||||
|
"country": "Reunion",
|
||||||
|
"state": "New York",
|
||||||
|
"city": "Kayton",
|
||||||
|
"zipCode": "82048-0645",
|
||||||
|
"line1": "636 Angel Junction",
|
||||||
|
"line2": "Apt. 361"
|
||||||
|
},
|
||||||
|
70,
|
||||||
|
"America/Grand_Turk",
|
||||||
|
"fr",
|
||||||
|
"PGK"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000006",
|
||||||
|
"Carmela",
|
||||||
|
"",
|
||||||
|
"Larry94@hotmail.com",
|
||||||
|
"1-508-980-1889 x134",
|
||||||
|
"Goodwin - Brown",
|
||||||
|
{
|
||||||
|
"country": "Heard Island and McDonald Islands",
|
||||||
|
"state": "Wisconsin",
|
||||||
|
"city": "Jalenbury",
|
||||||
|
"zipCode": "75732-7013",
|
||||||
|
"line1": "669 Sven Trail",
|
||||||
|
"line2": "Suite 409"
|
||||||
|
},
|
||||||
|
48,
|
||||||
|
"Asia/Karachi",
|
||||||
|
"fr",
|
||||||
|
"AMD"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000007",
|
||||||
|
"Lucious",
|
||||||
|
"",
|
||||||
|
"Lera67@yahoo.com",
|
||||||
|
"(684) 748-3653 x8745",
|
||||||
|
"Harvey - Kilback",
|
||||||
|
{
|
||||||
|
"country": "Israel",
|
||||||
|
"state": "Maryland",
|
||||||
|
"city": "East Allenmouth",
|
||||||
|
"zipCode": "21779",
|
||||||
|
"line1": "6070 W Grand Avenue",
|
||||||
|
"line2": "Suite 448"
|
||||||
|
},
|
||||||
|
83,
|
||||||
|
"America/St_Barthelemy",
|
||||||
|
"en",
|
||||||
|
"SBD"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000008",
|
||||||
|
"Anika",
|
||||||
|
"",
|
||||||
|
"Shane.Moore@gmail.com",
|
||||||
|
"(996) 909-3575 x614",
|
||||||
|
"Donnelly, Larson and Stamm",
|
||||||
|
{
|
||||||
|
"country": "Canada",
|
||||||
|
"state": "Michigan",
|
||||||
|
"city": "Lafayette",
|
||||||
|
"zipCode": "90430-8775",
|
||||||
|
"line1": "430 Orland Place",
|
||||||
|
"line2": "Suite 891"
|
||||||
|
},
|
||||||
|
64,
|
||||||
|
"America/Toronto",
|
||||||
|
"fr",
|
||||||
|
"PKR"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000009",
|
||||||
|
"Otto",
|
||||||
|
"",
|
||||||
|
"Emery_Wisozk@yahoo.com",
|
||||||
|
"1-602-251-7035 x9461",
|
||||||
|
"Kreiger - Boehm",
|
||||||
|
{
|
||||||
|
"country": "South Georgia and the South Sandwich Islands",
|
||||||
|
"state": "Colorado",
|
||||||
|
"city": "Lake Isaias",
|
||||||
|
"zipCode": "26025-5909",
|
||||||
|
"line1": "143 Kautzer Unions",
|
||||||
|
"line2": "Apt. 752"
|
||||||
|
},
|
||||||
|
98,
|
||||||
|
"Africa/Ndjamena",
|
||||||
|
"fr",
|
||||||
|
"JOD"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"000000000000010",
|
||||||
|
"Cortez",
|
||||||
|
"",
|
||||||
|
"Jameson13@hotmail.com",
|
||||||
|
"1-660-472-1494",
|
||||||
|
"Parisian LLC",
|
||||||
|
{
|
||||||
|
"country": "Mali",
|
||||||
|
"state": "Illinois",
|
||||||
|
"city": "Stammburgh",
|
||||||
|
"zipCode": "92318",
|
||||||
|
"line1": "7669 Jude Drive",
|
||||||
|
"line2": "Apt. 594"
|
||||||
|
},
|
||||||
|
59,
|
||||||
|
"Africa/Lubumbashi",
|
||||||
|
"en",
|
||||||
|
"VND"
|
||||||
|
]
|
||||||
|
]
|
33
001_documentation/Requirements/REQ0006/gen_customer/package-lock.json
generated
Normal file
33
001_documentation/Requirements/REQ0006/gen_customer/package-lock.json
generated
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"name": "gen_customer",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "gen_customer",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"@faker-js/faker": "^9.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@faker-js/faker": {
|
||||||
|
"version": "9.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.7.0.tgz",
|
||||||
|
"integrity": "sha512-aozo5vqjCmDoXLNUJarFZx2IN/GgGaogY4TMJ6so/WLZOWpSV7fvj2dmrV6sEAnUm1O7aCrhTibjpzeDFgNqbg==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fakerjs"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18.0.0",
|
||||||
|
"npm": ">=9.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "gen_customer",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "gen_customer.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": "",
|
||||||
|
"devDependencies": {
|
||||||
|
"@faker-js/faker": "^9.7.0"
|
||||||
|
}
|
||||||
|
}
|
23
001_documentation/Requirements/REQ0006/gen_customer/pnpm-lock.yaml
generated
Normal file
23
001_documentation/Requirements/REQ0006/gen_customer/pnpm-lock.yaml
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
devDependencies:
|
||||||
|
'@faker-js/faker':
|
||||||
|
specifier: ^9.7.0
|
||||||
|
version: 9.7.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
'@faker-js/faker@9.7.0':
|
||||||
|
resolution: {integrity: sha512-aozo5vqjCmDoXLNUJarFZx2IN/GgGaogY4TMJ6so/WLZOWpSV7fvj2dmrV6sEAnUm1O7aCrhTibjpzeDFgNqbg==}
|
||||||
|
engines: {node: '>=18.0.0', npm: '>=9.0.0'}
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
|
||||||
|
'@faker-js/faker@9.7.0': {}
|
@@ -1,215 +1,467 @@
|
|||||||
// LessonTypes stores different types of lessons
|
// Generated at: 2025-05-11T08:58:29.867Z
|
||||||
// lesson_types, lesson_type
|
|
||||||
Table LessonTypes {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // unique identifier for the lesson type
|
|
||||||
created datetime [default: `now()`] // timestamp when the lesson type was created
|
|
||||||
updated datetime // timestamp when the lesson type was last updated
|
|
||||||
// value field
|
|
||||||
name varchar // name of the lesson type
|
|
||||||
type varchar // type category
|
|
||||||
}
|
|
||||||
|
|
||||||
// LessonCategories stores categories of lessons
|
|
||||||
// lesson_categories, lesson_category
|
|
||||||
Table LessonCategories {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // unique identifier for the lesson category
|
|
||||||
created datetime [default: `now()`] // timestamp when the category was created
|
|
||||||
updated datetime // timestamp when the category was last updated
|
|
||||||
// value field
|
|
||||||
cat_name varchar // image file name
|
|
||||||
cat_image varchar // image representing the category
|
|
||||||
lesson_type_id integer [ref: > LessonTypes.id] // foreign key referencing LessonTypes.id
|
|
||||||
}
|
|
||||||
|
|
||||||
Table Helloworlds {
|
//
|
||||||
// system field
|
// collection id: pbc_3142635823
|
||||||
id int [pk, increment] // id field, increment
|
// collection name: _superusers
|
||||||
created datetime [default: `now()`] // record create time
|
// collection type: auth
|
||||||
updated datetime // record update time
|
Table _superusers {
|
||||||
}
|
id text [pk, not null]
|
||||||
|
password varchar [not null]
|
||||||
Table Users {
|
tokenKey text [not null]
|
||||||
// system field
|
email text [not null]
|
||||||
id int [pk, increment]
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
|
||||||
|
|
||||||
// value field
|
|
||||||
email varchar
|
|
||||||
emailVisibility boolean
|
emailVisibility boolean
|
||||||
verified boolean
|
verified boolean
|
||||||
name varchar
|
created datetime
|
||||||
avatar blob
|
|
||||||
}
|
|
||||||
|
|
||||||
Table UserMetas {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment]
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
updated datetime
|
||||||
|
|
||||||
// value field
|
|
||||||
helloworld varchar
|
|
||||||
app_on_time_s integer
|
|
||||||
user_id integer [ref: > Users.id]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Table QuizCategories {
|
//
|
||||||
// system field
|
// collection id: _pb_users_auth_
|
||||||
id int [pk, increment]
|
// collection name: users
|
||||||
created datetime [default: `now()`]
|
// collection type: auth
|
||||||
|
Table users {
|
||||||
|
id text [pk, not null]
|
||||||
|
password varchar [not null]
|
||||||
|
tokenKey text [not null]
|
||||||
|
email text [not null]
|
||||||
|
emailVisibility boolean
|
||||||
|
verified boolean
|
||||||
|
name text
|
||||||
|
avatar file
|
||||||
|
created datetime
|
||||||
updated datetime
|
updated datetime
|
||||||
|
visible text
|
||||||
// value field
|
phone text
|
||||||
cat_name varchar // category name
|
|
||||||
cat_image varchar // category image
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// stores all questions of matching frenzy
|
//
|
||||||
Table QuizMatchings {
|
// collection id: pbc_1430376151
|
||||||
// system field
|
// collection name: Categories
|
||||||
id int [pk, increment] // id field, increment
|
// collection type: base
|
||||||
created datetime [default: `now()`] // record create time
|
Table Categories {
|
||||||
updated datetime // record update time
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
// value field
|
cat_image_url text
|
||||||
word varchar // modal answer
|
cat_image file
|
||||||
word_c varchar // question
|
|
||||||
cat_id integer [ref: > QuizCategories.id] // foreign key to QuizCategories.id
|
|
||||||
}
|
|
||||||
|
|
||||||
// QuizListening stores all listening quiz data
|
|
||||||
Table QuizListenings {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // id field, increment
|
|
||||||
created datetime [default: `now()`] // record create time
|
|
||||||
updated datetime // record update time
|
|
||||||
|
|
||||||
// value field
|
|
||||||
sound varchar // URL to the sound file
|
|
||||||
word varchar // The word in the quiz
|
|
||||||
cat_id integer [ref: > QuizCategories.id]
|
|
||||||
}
|
|
||||||
|
|
||||||
// stores all categories of connectives revision quiz
|
|
||||||
Table QuizConnectivesCategories {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // id field, increment
|
|
||||||
created datetime [default: `now()`] // record create time
|
|
||||||
updated datetime // record update time
|
|
||||||
|
|
||||||
// value field
|
|
||||||
cat_name varchar // category name
|
|
||||||
cat_image varchar // category image
|
|
||||||
}
|
|
||||||
|
|
||||||
// stores all questions of connectives revision quiz
|
|
||||||
Table QuizConnectives {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // id field, increment
|
|
||||||
created datetime [default: `now()`] // record create time
|
|
||||||
updated datetime // record update time
|
|
||||||
|
|
||||||
// value field
|
|
||||||
question_fh varchar // first half
|
|
||||||
question_sh varchar // second half
|
|
||||||
modal_ans varchar // modal ans
|
|
||||||
cat_id integer [ref: > QuizConnectivesCategories.id] // foreign key to QuizConnectivesCategories.id
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lessons stores all lessons in the database
|
|
||||||
Table Vocabularies {
|
|
||||||
// system field
|
|
||||||
id int [pk, increment] // unique identifier for the lesson
|
|
||||||
created datetime [default: `now()`] // timestamp when the lesson was created
|
|
||||||
updated datetime // timestamp when the lesson was last updated
|
|
||||||
|
|
||||||
// value field
|
|
||||||
image varchar // URL to the image associated with the lesson
|
|
||||||
sound varchar // URL to the sound file associated with the lesson
|
|
||||||
word varchar // The word in English
|
|
||||||
word_c varchar // The word in Chinese
|
|
||||||
sample_e varchar // Sample sentence in English using the word
|
|
||||||
sample_c varchar // Sample sentence in Chinese using the word
|
|
||||||
cat_id integer [ref: > LessonCategories.id] // foreign key referring to LessonCategories.id
|
|
||||||
category varchar // The category to which the lesson belongs
|
|
||||||
lesson_type_id integer [ref: > LessonTypes.id] // foreign key referring to LessonTypes.id
|
|
||||||
}
|
|
||||||
|
|
||||||
// Listening Practice Quiz Categories
|
|
||||||
// store listening practice category, (LpCategories, LpCategory)
|
|
||||||
Table QuizLPCategories {
|
|
||||||
// system fields
|
|
||||||
id text [pk] // changed from int to text to match PocketBase
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
|
||||||
|
|
||||||
// value fields
|
|
||||||
cat_name varchar [presentable: true] // added presentable flag
|
|
||||||
cat_image file // changed from blob to file type
|
|
||||||
pos number // changed from integer to number
|
|
||||||
init_answer json
|
|
||||||
}
|
|
||||||
|
|
||||||
// Listening Practice Quiz Questions
|
|
||||||
Table QuizLPQuestions {
|
|
||||||
id int [pk, increment]
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
|
||||||
word varchar
|
|
||||||
sound blob
|
|
||||||
cat_id integer [ref: > QuizLPCategories.id]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Matching Frenzy Quiz Categories
|
|
||||||
Table QuizMFCategories {
|
|
||||||
id int [pk, increment]
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
|
||||||
cat_name varchar
|
|
||||||
cat_image blob
|
|
||||||
pos integer
|
pos integer
|
||||||
init_answer json
|
lesson_id integer [ref: > LessonsTypes.id] // relation3455582614
|
||||||
}
|
remarks text
|
||||||
|
visible text
|
||||||
// Matching Frenzy Quiz Questions
|
created datetime
|
||||||
Table QuizMFQuestions {
|
|
||||||
id int [pk, increment]
|
|
||||||
created datetime [default: `now()`]
|
|
||||||
updated datetime
|
updated datetime
|
||||||
word varchar
|
|
||||||
word_c varchar
|
|
||||||
cat_id integer [ref: > QuizMFCategories.id]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connectives Revision Quiz Categories
|
//
|
||||||
|
// collection id: pbc_108570809
|
||||||
|
// collection name: Customers
|
||||||
|
// collection type: base
|
||||||
|
Table Customers {
|
||||||
|
id text [pk, not null]
|
||||||
|
name text
|
||||||
|
email text
|
||||||
|
phone text
|
||||||
|
quota integer
|
||||||
|
status text
|
||||||
|
avatar_file file
|
||||||
|
user_id integer [ref: > users.id] // relation2809058197
|
||||||
|
billingAddress text
|
||||||
|
timezone text
|
||||||
|
language text
|
||||||
|
currency text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1196309394
|
||||||
|
// collection name: LessonsCategories
|
||||||
|
// collection type: base
|
||||||
|
Table LessonsCategories {
|
||||||
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
|
cat_image_url text
|
||||||
|
cat_image file
|
||||||
|
pos integer
|
||||||
|
lesson_id integer [ref: > LessonsTypes.id] // relation3455582614
|
||||||
|
description text
|
||||||
|
remarks text
|
||||||
|
visible text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2328411368
|
||||||
|
// collection name: LessonsTypes
|
||||||
|
// collection type: base
|
||||||
|
Table LessonsTypes {
|
||||||
|
id text [pk, not null]
|
||||||
|
name text
|
||||||
|
type text
|
||||||
|
pos integer
|
||||||
|
visible text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
field datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_977978967
|
||||||
|
// collection name: Notifications
|
||||||
|
// collection type: base
|
||||||
|
Table Notifications {
|
||||||
|
id text [pk, not null]
|
||||||
|
read boolean
|
||||||
|
type text
|
||||||
|
author text
|
||||||
|
job text
|
||||||
|
description text
|
||||||
|
NOTI_ID text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
to_user_id integer [ref: > UserMetas.id] // relation704048736
|
||||||
|
from_user_id integer [ref: > UserMetas.id] // relation556806202
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_4061499106
|
||||||
|
// collection name: QuizCRCategories
|
||||||
|
// collection type: base
|
||||||
Table QuizCRCategories {
|
Table QuizCRCategories {
|
||||||
id int [pk, increment]
|
id text [pk, not null]
|
||||||
created datetime [default: `now()`]
|
cat_name text
|
||||||
updated datetime
|
cat_image file
|
||||||
cat_name varchar
|
|
||||||
cat_image blob
|
|
||||||
pos integer
|
pos integer
|
||||||
init_answer json
|
init_answer text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connectives Revision Quiz Questions
|
//
|
||||||
|
// collection id: pbc_3141885671
|
||||||
|
// collection name: QuizCRQuestions
|
||||||
|
// collection type: base
|
||||||
Table QuizCRQuestions {
|
Table QuizCRQuestions {
|
||||||
id int [pk, increment]
|
id text [pk, not null]
|
||||||
created datetime [default: `now()`]
|
question_fh text
|
||||||
|
question_sh text
|
||||||
|
modal_ans text
|
||||||
|
cat_id integer [ref: > QuizCRCategories.id] // relation1827623476
|
||||||
|
options text
|
||||||
|
created datetime
|
||||||
updated datetime
|
updated datetime
|
||||||
question_fh varchar
|
init_answer text
|
||||||
question_sh varchar
|
|
||||||
modal_ans varchar
|
|
||||||
cat_id integer [ref: > QuizCRCategories.id]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test table
|
//
|
||||||
Table t1 {
|
// collection id: pbc_3571292172
|
||||||
id int [pk, increment]
|
// collection name: QuizCategories
|
||||||
created datetime [default: `now()`]
|
// collection type: base
|
||||||
|
Table QuizCategories {
|
||||||
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
|
cat_image text
|
||||||
|
init_answer text
|
||||||
|
created datetime
|
||||||
updated datetime
|
updated datetime
|
||||||
name varchar
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_96745150
|
||||||
|
// collection name: QuizConnectives
|
||||||
|
// collection type: base
|
||||||
|
Table QuizConnectives {
|
||||||
|
id text [pk, not null]
|
||||||
|
question_fh text
|
||||||
|
question_sh text
|
||||||
|
modal_ans text
|
||||||
|
cat_id integer [ref: > QuizConnectivesCategories.id] // relation3870140739
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_342761728
|
||||||
|
// collection name: QuizConnectivesCategories
|
||||||
|
// collection type: base
|
||||||
|
Table QuizConnectivesCategories {
|
||||||
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
|
cat_image file
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_3639453778
|
||||||
|
// collection name: QuizLPCategories
|
||||||
|
// collection type: base
|
||||||
|
Table QuizLPCategories {
|
||||||
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
|
cat_image file
|
||||||
|
pos integer
|
||||||
|
init_answer text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
visible text
|
||||||
|
slug text
|
||||||
|
remarks text
|
||||||
|
description text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_742947356
|
||||||
|
// collection name: QuizLPQuestions
|
||||||
|
// collection type: base
|
||||||
|
Table QuizLPQuestions {
|
||||||
|
id text [pk, not null]
|
||||||
|
word text
|
||||||
|
sound file
|
||||||
|
cat_id integer [ref: > QuizLPCategories.id] // relation3870140739
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
cat_name text
|
||||||
|
cat_image file
|
||||||
|
pos integer
|
||||||
|
init_answer text
|
||||||
|
visible text
|
||||||
|
slug text
|
||||||
|
remarks text
|
||||||
|
description text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2511066072
|
||||||
|
// collection name: QuizListenings
|
||||||
|
// collection type: base
|
||||||
|
Table QuizListenings {
|
||||||
|
id text [pk, not null]
|
||||||
|
sound file
|
||||||
|
word text
|
||||||
|
cat_id integer [ref: > QuizCategories.id] // relation3870140739
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_84667061
|
||||||
|
// collection name: QuizMFCategories
|
||||||
|
// collection type: base
|
||||||
|
Table QuizMFCategories {
|
||||||
|
id text [pk, not null]
|
||||||
|
cat_name text
|
||||||
|
cat_image file
|
||||||
|
pos integer
|
||||||
|
init_answer text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
visible text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_3346420851
|
||||||
|
// collection name: QuizMFQuestions
|
||||||
|
// collection type: base
|
||||||
|
Table QuizMFQuestions {
|
||||||
|
id text [pk, not null]
|
||||||
|
word text
|
||||||
|
word_c text
|
||||||
|
cat_id integer [ref: > QuizMFCategories.id] // relation3870140739
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
visible text
|
||||||
|
sound file
|
||||||
|
cat_image file
|
||||||
|
init_answer text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2936646783
|
||||||
|
// collection name: QuizMatchings
|
||||||
|
// collection type: base
|
||||||
|
Table QuizMatchings {
|
||||||
|
id text [pk, not null]
|
||||||
|
word text
|
||||||
|
word_c text
|
||||||
|
cat_id integer [ref: > QuizCategories.id] // relation3870140739
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_491894781
|
||||||
|
// collection name: Students
|
||||||
|
// collection type: base
|
||||||
|
Table Students {
|
||||||
|
id text [pk, not null]
|
||||||
|
name text
|
||||||
|
email text
|
||||||
|
phone text
|
||||||
|
quota integer
|
||||||
|
status text
|
||||||
|
avatar_file file
|
||||||
|
user_id integer [ref: > users.id] // relation2809058197
|
||||||
|
billingAddress text
|
||||||
|
timezone text
|
||||||
|
language text
|
||||||
|
currency text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1413424569
|
||||||
|
// collection name: Teachers
|
||||||
|
// collection type: base
|
||||||
|
Table Teachers {
|
||||||
|
id text [pk, not null]
|
||||||
|
name text
|
||||||
|
email text
|
||||||
|
phone text
|
||||||
|
quota integer
|
||||||
|
status text
|
||||||
|
avatar_file file
|
||||||
|
user_id integer [ref: > users.id] // relation2809058197
|
||||||
|
billingAddress text
|
||||||
|
timezone text
|
||||||
|
language text
|
||||||
|
currency text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1305841361
|
||||||
|
// collection name: UserMetas
|
||||||
|
// collection type: base
|
||||||
|
Table UserMetas {
|
||||||
|
id text [pk, not null]
|
||||||
|
helloworld text
|
||||||
|
meta text
|
||||||
|
user_id integer [ref: > users.id] // relation2809058197
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
status text
|
||||||
|
avatar file
|
||||||
|
role text
|
||||||
|
name text
|
||||||
|
email text
|
||||||
|
phone text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1638686383
|
||||||
|
// collection name: Vocabularies
|
||||||
|
// collection type: base
|
||||||
|
Table Vocabularies {
|
||||||
|
id text [pk, not null]
|
||||||
|
image file
|
||||||
|
sound file
|
||||||
|
word text
|
||||||
|
word_c text
|
||||||
|
sample_e text
|
||||||
|
sample_c text
|
||||||
|
cat_id integer [ref: > Categories.id] // relation3870140739
|
||||||
|
category text
|
||||||
|
lesson_type_id integer [ref: > LessonsTypes.id] // relation808508980
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
visible text
|
||||||
|
type text
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_4275539003
|
||||||
|
// collection name: _authOrigins
|
||||||
|
// collection type: base
|
||||||
|
Table _authOrigins {
|
||||||
|
id text [pk, not null]
|
||||||
|
collectionRef text [not null]
|
||||||
|
recordRef text [not null]
|
||||||
|
fingerprint text [not null]
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2281828961
|
||||||
|
// collection name: _externalAuths
|
||||||
|
// collection type: base
|
||||||
|
Table _externalAuths {
|
||||||
|
id text [pk, not null]
|
||||||
|
collectionRef text [not null]
|
||||||
|
recordRef text [not null]
|
||||||
|
provider text [not null]
|
||||||
|
providerId text [not null]
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2279338944
|
||||||
|
// collection name: _mfas
|
||||||
|
// collection type: base
|
||||||
|
Table _mfas {
|
||||||
|
id text [pk, not null]
|
||||||
|
collectionRef text [not null]
|
||||||
|
recordRef text [not null]
|
||||||
|
method text [not null]
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1638494021
|
||||||
|
// collection name: _otps
|
||||||
|
// collection type: base
|
||||||
|
Table _otps {
|
||||||
|
id text [pk, not null]
|
||||||
|
collectionRef text [not null]
|
||||||
|
recordRef text [not null]
|
||||||
|
password varchar [not null]
|
||||||
|
sentTo text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_1509025625
|
||||||
|
// collection name: billingAddress
|
||||||
|
// collection type: base
|
||||||
|
Table billingAddress {
|
||||||
|
id text [pk, not null]
|
||||||
|
country text
|
||||||
|
state text
|
||||||
|
city text
|
||||||
|
zipCode text
|
||||||
|
line1 text
|
||||||
|
line2 text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_123408445
|
||||||
|
// collection name: helloworlds
|
||||||
|
// collection type: base
|
||||||
|
Table helloworlds {
|
||||||
|
id text [pk, not null]
|
||||||
|
hello text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_2109205374
|
||||||
|
// collection name: t1
|
||||||
|
// collection type: base
|
||||||
|
Table t1 {
|
||||||
|
id text [pk, not null]
|
||||||
|
hello text
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
test_file file
|
||||||
|
}
|
||||||
|
|
||||||
|
3840
001_documentation/Requirements/REQ0006/schema.json
Normal file
3840
001_documentation/Requirements/REQ0006/schema.json
Normal file
File diff suppressed because it is too large
Load Diff
11
001_documentation/Requirements/REQ0013/index.md
Normal file
11
001_documentation/Requirements/REQ0013/index.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
tags: cms
|
||||||
|
---
|
||||||
|
|
||||||
|
# cms dashboard
|
||||||
|
|
||||||
|
cms
|
||||||
|
|
||||||
|
## files
|
||||||
|
|
||||||
|
T.B.A.
|
11
001_documentation/Requirements/REQ0014/index.md
Normal file
11
001_documentation/Requirements/REQ0014/index.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
tags: mobile
|
||||||
|
---
|
||||||
|
|
||||||
|
# mobile client
|
||||||
|
|
||||||
|
mobile
|
||||||
|
|
||||||
|
## files
|
||||||
|
|
||||||
|
T.B.A.
|
86
001_documentation/Requirements/REQ0015/convert.js
Normal file
86
001_documentation/Requirements/REQ0015/convert.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
//
|
||||||
|
// # REQ0015:
|
||||||
|
// ## PURPOSE:
|
||||||
|
//
|
||||||
|
// This is a script to convert `schema.json` exported from pocketbase to dbml formatted file `schema.dbml`
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
// Load schema.json
|
||||||
|
const schemaPath = path.join(process.cwd(), "schema.json");
|
||||||
|
const schema = JSON.parse(fs.readFileSync(schemaPath, "utf8"));
|
||||||
|
|
||||||
|
// Type mapping from PocketBase to DBML/SQL
|
||||||
|
const typeMapping = {
|
||||||
|
text: "text",
|
||||||
|
number: "integer",
|
||||||
|
bool: "boolean",
|
||||||
|
email: "text",
|
||||||
|
url: "varchar",
|
||||||
|
date: "datetime",
|
||||||
|
select: "varchar",
|
||||||
|
json: "text",
|
||||||
|
file: "file",
|
||||||
|
password: "varchar",
|
||||||
|
relation: "integer", // Assuming relations are stored as integer IDs
|
||||||
|
autodate: "datetime",
|
||||||
|
};
|
||||||
|
|
||||||
|
function convertToDBML(schema) {
|
||||||
|
let dbml = "";
|
||||||
|
dbml = "// Generated at: " + new Date().toISOString();
|
||||||
|
dbml = dbml + "\n\n\n";
|
||||||
|
|
||||||
|
let collectionIdToTableMapping = {};
|
||||||
|
for (const [idx, tableDef] of Object.entries(schema)) {
|
||||||
|
collectionIdToTableMapping[tableDef.id] = tableDef.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [idx, tableDef] of Object.entries(schema)) {
|
||||||
|
console.log({ idx });
|
||||||
|
dbml += `// \n`;
|
||||||
|
dbml += `// collection id: ${tableDef.id} \n`;
|
||||||
|
dbml += `// collection name: ${tableDef.name} \n`;
|
||||||
|
dbml += `// collection type: ${tableDef.type} \n`;
|
||||||
|
dbml += `Table ${tableDef.name} {\n`;
|
||||||
|
|
||||||
|
for (const field of tableDef.fields) {
|
||||||
|
// Get field type
|
||||||
|
let fieldType = typeMapping[field.type] || "text";
|
||||||
|
|
||||||
|
// Handle special cases
|
||||||
|
if (field.type === "number" && field.options?.max === 1) {
|
||||||
|
fieldType = "boolean";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build field definition
|
||||||
|
let line = ` ${field.name} ${fieldType}`;
|
||||||
|
|
||||||
|
// Add constraints
|
||||||
|
const constraints = [];
|
||||||
|
if (field.name === "id" || field.primary) constraints.push("pk");
|
||||||
|
if (field.required) constraints.push("not null");
|
||||||
|
if (constraints.length > 0) line += ` [${constraints.join(", ")}]`;
|
||||||
|
|
||||||
|
if (field.collectionId) {
|
||||||
|
line += ` [ref: > ${
|
||||||
|
collectionIdToTableMapping[field.collectionId]
|
||||||
|
}.id] // ${field.id}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbml += `${line}\n`;
|
||||||
|
console.log({ line });
|
||||||
|
}
|
||||||
|
|
||||||
|
dbml += "}\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dbml;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert and save
|
||||||
|
const dbmlOutput = convertToDBML(schema);
|
||||||
|
fs.writeFileSync("schema.dbml", dbmlOutput);
|
||||||
|
console.log("DBML file generated successfully!");
|
9
001_documentation/Requirements/REQ0015/index.md
Normal file
9
001_documentation/Requirements/REQ0015/index.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
tags: mobile, cms, db, schema
|
||||||
|
---
|
||||||
|
|
||||||
|
# pocketbase json schema to dbml converter
|
||||||
|
|
||||||
|
## description
|
||||||
|
|
||||||
|
to generate a `schema.dbml` form `schema.json` exported from pocketbase
|
18
001_documentation/Requirements/REQ0015/schema.dbml
Normal file
18
001_documentation/Requirements/REQ0015/schema.dbml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// Generated at: 2025-05-06T06:24:44.009Z
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// collection id: pbc_3142635823
|
||||||
|
// collection name: helloworld
|
||||||
|
// collection type: auth
|
||||||
|
Table helloworld {
|
||||||
|
id text [pk, not null]
|
||||||
|
password varchar [not null]
|
||||||
|
tokenKey text [not null]
|
||||||
|
email text [not null]
|
||||||
|
emailVisibility boolean
|
||||||
|
verified boolean
|
||||||
|
created datetime
|
||||||
|
updated datetime
|
||||||
|
}
|
||||||
|
|
174
001_documentation/Requirements/REQ0015/schema.json
Normal file
174
001_documentation/Requirements/REQ0015/schema.json
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "pbc_3142635823",
|
||||||
|
"listRule": null,
|
||||||
|
"viewRule": null,
|
||||||
|
"createRule": null,
|
||||||
|
"updateRule": null,
|
||||||
|
"deleteRule": null,
|
||||||
|
"name": "helloworld",
|
||||||
|
"type": "auth",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"autogeneratePattern": "[a-z0-9]{15}",
|
||||||
|
"hidden": false,
|
||||||
|
"id": "text3208210256",
|
||||||
|
"max": 15,
|
||||||
|
"min": 15,
|
||||||
|
"name": "id",
|
||||||
|
"pattern": "^[a-z0-9]+$",
|
||||||
|
"presentable": false,
|
||||||
|
"primaryKey": true,
|
||||||
|
"required": true,
|
||||||
|
"system": true,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cost": 0,
|
||||||
|
"hidden": true,
|
||||||
|
"id": "password901924565",
|
||||||
|
"max": 0,
|
||||||
|
"min": 8,
|
||||||
|
"name": "password",
|
||||||
|
"pattern": "",
|
||||||
|
"presentable": false,
|
||||||
|
"required": true,
|
||||||
|
"system": true,
|
||||||
|
"type": "password"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"autogeneratePattern": "[a-zA-Z0-9]{50}",
|
||||||
|
"hidden": true,
|
||||||
|
"id": "text2504183744",
|
||||||
|
"max": 60,
|
||||||
|
"min": 30,
|
||||||
|
"name": "tokenKey",
|
||||||
|
"pattern": "",
|
||||||
|
"presentable": false,
|
||||||
|
"primaryKey": false,
|
||||||
|
"required": true,
|
||||||
|
"system": true,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"exceptDomains": null,
|
||||||
|
"hidden": false,
|
||||||
|
"id": "email3885137012",
|
||||||
|
"name": "email",
|
||||||
|
"onlyDomains": null,
|
||||||
|
"presentable": false,
|
||||||
|
"required": true,
|
||||||
|
"system": true,
|
||||||
|
"type": "email"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "bool1547992806",
|
||||||
|
"name": "emailVisibility",
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": true,
|
||||||
|
"type": "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "bool256245529",
|
||||||
|
"name": "verified",
|
||||||
|
"presentable": false,
|
||||||
|
"required": false,
|
||||||
|
"system": true,
|
||||||
|
"type": "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "autodate2990389176",
|
||||||
|
"name": "created",
|
||||||
|
"onCreate": true,
|
||||||
|
"onUpdate": false,
|
||||||
|
"presentable": false,
|
||||||
|
"system": true,
|
||||||
|
"type": "autodate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": false,
|
||||||
|
"id": "autodate3332085495",
|
||||||
|
"name": "updated",
|
||||||
|
"onCreate": true,
|
||||||
|
"onUpdate": true,
|
||||||
|
"presentable": false,
|
||||||
|
"system": true,
|
||||||
|
"type": "autodate"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
"CREATE UNIQUE INDEX `idx_tokenKey_pbc_3142635823` ON `_superusers` (`tokenKey`)",
|
||||||
|
"CREATE UNIQUE INDEX `idx_email_pbc_3142635823` ON `_superusers` (`email`) WHERE `email` != ''"
|
||||||
|
],
|
||||||
|
"system": true,
|
||||||
|
"authRule": "",
|
||||||
|
"manageRule": null,
|
||||||
|
"authAlert": {
|
||||||
|
"enabled": true,
|
||||||
|
"emailTemplate": {
|
||||||
|
"subject": "Login from a new location",
|
||||||
|
"body": "<p>Hello,</p>\n<p>We noticed a login to your {APP_NAME} account from a new location.</p>\n<p>If this was you, you may disregard this email.</p>\n<p><strong>If this wasn't you, you should immediately change your {APP_NAME} account password to revoke access from all other locations.</strong></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth2": {
|
||||||
|
"mappedFields": {
|
||||||
|
"id": "",
|
||||||
|
"name": "",
|
||||||
|
"username": "",
|
||||||
|
"avatarURL": ""
|
||||||
|
},
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"passwordAuth": {
|
||||||
|
"enabled": true,
|
||||||
|
"identityFields": [
|
||||||
|
"email"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mfa": {
|
||||||
|
"enabled": false,
|
||||||
|
"duration": 1800,
|
||||||
|
"rule": ""
|
||||||
|
},
|
||||||
|
"otp": {
|
||||||
|
"enabled": false,
|
||||||
|
"duration": 180,
|
||||||
|
"length": 8,
|
||||||
|
"emailTemplate": {
|
||||||
|
"subject": "OTP for {APP_NAME}",
|
||||||
|
"body": "<p>Hello,</p>\n<p>Your one-time password is: <strong>{OTP}</strong></p>\n<p><i>If you didn't ask for the one-time password, you can ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"authToken": {
|
||||||
|
"duration": 86400
|
||||||
|
},
|
||||||
|
"passwordResetToken": {
|
||||||
|
"duration": 1800
|
||||||
|
},
|
||||||
|
"emailChangeToken": {
|
||||||
|
"duration": 1800
|
||||||
|
},
|
||||||
|
"verificationToken": {
|
||||||
|
"duration": 259200
|
||||||
|
},
|
||||||
|
"fileToken": {
|
||||||
|
"duration": 180
|
||||||
|
},
|
||||||
|
"verificationTemplate": {
|
||||||
|
"subject": "Verify your {APP_NAME} email",
|
||||||
|
"body": "<p>Hello,</p>\n<p>Thank you for joining us at {APP_NAME}.</p>\n<p>Click on the button below to verify your email address.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-verification/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Verify</a>\n</p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>"
|
||||||
|
},
|
||||||
|
"resetPasswordTemplate": {
|
||||||
|
"subject": "Reset your {APP_NAME} password",
|
||||||
|
"body": "<p>Hello,</p>\n<p>Click on the button below to reset your password.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-password-reset/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Reset password</a>\n</p>\n<p><i>If you didn't ask to reset your password, you can ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>"
|
||||||
|
},
|
||||||
|
"confirmEmailChangeTemplate": {
|
||||||
|
"subject": "Confirm your {APP_NAME} new email address",
|
||||||
|
"body": "<p>Hello,</p>\n<p>Click on the button below to confirm your new email address.</p>\n<p>\n <a class=\"btn\" href=\"{APP_URL}/_/#/auth/confirm-email-change/{TOKEN}\" target=\"_blank\" rel=\"noopener\">Confirm new email</a>\n</p>\n<p><i>If you didn't ask to change your email address, you can ignore this email.</i></p>\n<p>\n Thanks,<br/>\n {APP_NAME} team\n</p>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
33
001_documentation/Requirements/REQ0016/index.md
Normal file
33
001_documentation/Requirements/REQ0016/index.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
tags: cms, login-flow
|
||||||
|
---
|
||||||
|
|
||||||
|
# login flow
|
||||||
|
|
||||||
|
## description
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD;
|
||||||
|
Start-->A;
|
||||||
|
A-->B;
|
||||||
|
B-->C;
|
||||||
|
B-->D;
|
||||||
|
D-->E;
|
||||||
|
E-->F;
|
||||||
|
C-->G;
|
||||||
|
G-->A
|
||||||
|
|
||||||
|
F-->End;
|
||||||
|
|
||||||
|
A[greeting, asking username and password]
|
||||||
|
B[check if username and password is valid]
|
||||||
|
C[pasword failed]
|
||||||
|
D[pasword ok]
|
||||||
|
E[login success]
|
||||||
|
F[redirect to '/dashboard']
|
||||||
|
|
||||||
|
G[prompt user wrong username and password]
|
||||||
|
|
||||||
|
Start((start));
|
||||||
|
End((end))
|
||||||
|
```
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
9
001_documentation/Requirements/REQ0017/index.md
Normal file
9
001_documentation/Requirements/REQ0017/index.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
tags: mobile, lesson
|
||||||
|
---
|
||||||
|
|
||||||
|
# lesson page documentation
|
||||||
|
|
||||||
|
it should have a lesson page
|
||||||
|
|
||||||
|

|
7
001_documentation/Requirements/REQ0018/index.md
Normal file
7
001_documentation/Requirements/REQ0018/index.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
tags: mobile, cms, db
|
||||||
|
---
|
||||||
|
|
||||||
|
# family photo of frameworks
|
||||||
|
|
||||||
|
it should have a family photo of used framework
|
@@ -1,50 +1,21 @@
|
|||||||
# Requirements Index
|
# Requirements Index
|
||||||
|
|
||||||
## REQ0001: project overview
|
- [REQ0001: project overview](./REQ0001/index.md)
|
||||||
|
- [REQ0002: time tracking](./REQ0002/index.md)
|
||||||
[View Requirement](./REQ0001/index.md)
|
- [REQ0003: quiz page documentation](./REQ0003/index.md)
|
||||||
|
- [REQ0004: record page documentation](./REQ0004/index.md)
|
||||||
## REQ0002: lesson page documentation
|
- [REQ0005: settings page documentation](./REQ0005/index.md)
|
||||||
|
- [REQ0006: task](./REQ0006/008_update_dbml_from_json.md)
|
||||||
[View Requirement](./REQ0002/index.md)
|
- [REQ0006: GUIDELINES](./REQ0006/_GUIDELINE.md)
|
||||||
|
- [REQ0006: db schema design](./REQ0006/index.md)
|
||||||
## REQ0003: quiz page documentation
|
- [REQ0007: testing of mobile app home](./REQ0007/index.md)
|
||||||
|
- [REQ0008: schema design](./REQ0008/index.md)
|
||||||
[View Requirement](./REQ0003/index.md)
|
- [REQ0009: loading screen](./REQ0009/index.md)
|
||||||
|
- [REQ0010: user friendly error messages](./REQ0010/index.md)
|
||||||
## REQ0004: record page documentation
|
- [REQ0011: developer friendly error messages](./REQ0011/index.md)
|
||||||
|
- [REQ0012: cms navigation system](./REQ0012/index.md)
|
||||||
[View Requirement](./REQ0004/index.md)
|
- [REQ0013: cms dashboard](./REQ0013/index.md)
|
||||||
|
- [REQ0014: mobile client](./REQ0014/index.md)
|
||||||
## REQ0005: settings page documentation
|
- [REQ0015: pocketbase json schema to dbml converter](./REQ0015/index.md)
|
||||||
|
- [REQ0016: login flow](./REQ0016/index.md)
|
||||||
[View Requirement](./REQ0005/index.md)
|
- [REQ0017: lesson page documentation](./REQ0017/index.md)
|
||||||
|
|
||||||
## REQ0006: db schema design
|
|
||||||
|
|
||||||
[View Requirement](./REQ0006/index.md)
|
|
||||||
|
|
||||||
## REQ0007: testing of mobile app home
|
|
||||||
|
|
||||||
[View Requirement](./REQ0007/index.md)
|
|
||||||
|
|
||||||
## REQ0008: schema design
|
|
||||||
|
|
||||||
[View Requirement](./REQ0008/index.md)
|
|
||||||
|
|
||||||
## REQ0009: loading screen
|
|
||||||
|
|
||||||
[View Requirement](./REQ0009/index.md)
|
|
||||||
|
|
||||||
## REQ0010: user friendly error messages
|
|
||||||
|
|
||||||
[View Requirement](./REQ0010/index.md)
|
|
||||||
|
|
||||||
## REQ0011: developer friendly error messages
|
|
||||||
|
|
||||||
[View Requirement](./REQ0011/index.md)
|
|
||||||
|
|
||||||
## REQ0012: cms navigation system
|
|
||||||
|
|
||||||
[View Requirement](./REQ0012/index.md)
|
|
||||||
|
|
||||||
|
5
001_documentation/Requirements/update.sh
Executable file
5
001_documentation/Requirements/update.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
npx nodemon --delay 0.1 --ext md,js --ignore ./index.md --exec "node ./update_req_index.js"
|
@@ -36,8 +36,8 @@ async function updateIndex() {
|
|||||||
const heading = extractH1(content);
|
const heading = extractH1(content);
|
||||||
|
|
||||||
if (heading) {
|
if (heading) {
|
||||||
indexContent += `## ${dir}: ${heading}\n\n`;
|
indexContent += `- [${dir}: ${heading}](./${dir}/${file})\n`;
|
||||||
indexContent += `[View Requirement](./${dir}/${file})\n\n`;
|
// indexContent += `[View Requirement](./${dir}/${file})\n\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
002_source/.env
Normal file
14
002_source/.env
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# THIS IS env file for use with docker-compose.yml
|
||||||
|
|
||||||
|
# cms
|
||||||
|
|
||||||
|
# doc
|
||||||
|
|
||||||
|
# ionic_mobile
|
||||||
|
|
||||||
|
# api_ts
|
||||||
|
|
||||||
|
# pocketbase
|
||||||
|
PB_HOSTNAME=pocketbase
|
||||||
|
PB_USERNAME=admin@123.com
|
||||||
|
PB_PASSWORD=Aa12345678
|
4
002_source/.gitignore
vendored
Normal file
4
002_source/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
**/*.del
|
||||||
|
**/*.log
|
||||||
|
**/_archive
|
||||||
|
**/_del
|
74
002_source/README.md
Normal file
74
002_source/README.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# README
|
||||||
|
|
||||||
|
## to start production
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# start docker before hand
|
||||||
|
$ ./dc_build.sh
|
||||||
|
|
||||||
|
$ ./dc_up.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## to start develop
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#
|
||||||
|
$ ./dc_build.sh
|
||||||
|
$ ./dc_dev.sh
|
||||||
|
$ docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d pocketbase api_ts --remove-orphans
|
||||||
|
$ docker compose logs -f pocketbase api_ts
|
||||||
|
```
|
||||||
|
|
||||||
|
## test api endpoint
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# browse to http://localhost:3000/helloworld
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# start docker before hand
|
||||||
|
|
||||||
|
$ cd 002_source
|
||||||
|
$ ./dev.sh
|
||||||
|
|
||||||
|
# docker containers up
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## deprecated
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# mobile
|
||||||
|
$ cd 002_source/mobile
|
||||||
|
$ pnpm run dev
|
||||||
|
|
||||||
|
# cms
|
||||||
|
$ cd 002_source/cms
|
||||||
|
$ npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
ideation
|
||||||
|
prototyping
|
||||||
|
testing
|
||||||
|
production deployment
|
||||||
|
evaluation
|
||||||
|
monitoring
|
||||||
|
|
||||||
|
## addresses
|
||||||
|
|
||||||
|
```
|
||||||
|
mobile:
|
||||||
|
http://localhost:5173
|
||||||
|
|
||||||
|
pocketbase:
|
||||||
|
http://localhost:8090/_
|
||||||
|
|
||||||
|
cms:
|
||||||
|
http://localhost:3000
|
||||||
|
|
||||||
|
documentation
|
||||||
|
http://localhost:3001
|
||||||
|
```
|
||||||
|
|
||||||
|
extend to vocabularies
|
@@ -1,7 +1,6 @@
|
|||||||
const { resolve } = require('node:path');
|
const { resolve } = require('node:path');
|
||||||
|
|
||||||
const project = resolve(__dirname, 'tsconfig.json');
|
const project = resolve(__dirname, 'tsconfig.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: [
|
extends: [
|
||||||
@@ -84,4 +83,13 @@ module.exports = {
|
|||||||
'react/jsx-sort-props': 'off',
|
'react/jsx-sort-props': 'off',
|
||||||
},
|
},
|
||||||
ignorePatterns: ['**/*del', '**/*bak', '**/*copy.*', '**/*copy*.*'],
|
ignorePatterns: ['**/*del', '**/*bak', '**/*copy.*', '**/*copy*.*'],
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
// override to ignore no-def for `describe`, `it`, and `expect`
|
||||||
|
files: ['*.test.ts', '*.test.tsx'],
|
||||||
|
rules: {
|
||||||
|
'no-undef': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
5
002_source/cms/.gitignore
vendored
5
002_source/cms/.gitignore
vendored
@@ -1,3 +1,8 @@
|
|||||||
|
**/*del
|
||||||
|
**/*bak
|
||||||
|
**/*log
|
||||||
|
**/*tmp
|
||||||
|
|
||||||
.env
|
.env
|
||||||
.env.production
|
.env.production
|
||||||
|
|
||||||
|
33
002_source/cms/.vscode/extensions.json
vendored
Normal file
33
002_source/cms/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"wmaurer.change-case",
|
||||||
|
"saoudrizwan.claude-dev",
|
||||||
|
"naumovs.color-highlight",
|
||||||
|
"bocovo.dbml-erd-visualizer",
|
||||||
|
"aflalo.dbml-formatter",
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"ms-vscode.vscode-typescript-next",
|
||||||
|
"tttpob.list-aligner",
|
||||||
|
"bierner.markdown-mermaid",
|
||||||
|
"onatm.open-in-new-window",
|
||||||
|
"christian-kohler.path-intellisense",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"humao.rest-client",
|
||||||
|
"ryu1kn.text-marker",
|
||||||
|
"gruntfuggly.todo-tree",
|
||||||
|
"bibhasdn.unique-lines",
|
||||||
|
"neptunedesign.vs-sequential-number",
|
||||||
|
"matt-meyers.vscode-dbml",
|
||||||
|
"codeium.codeium",
|
||||||
|
"tencent-cloud.coding-copilot",
|
||||||
|
"yzhang.markdown-all-in-one",
|
||||||
|
"stubedston.align-text",
|
||||||
|
"mads-hartmann.bash-ide-vscode",
|
||||||
|
"duynvu.dbml-language",
|
||||||
|
"mikestead.dotenv",
|
||||||
|
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
|
||||||
|
"davidanson.vscode-markdownlint",
|
||||||
|
"foxundermoon.shell-format"
|
||||||
|
]
|
||||||
|
}
|
@@ -1,9 +1,12 @@
|
|||||||
|
# TODO
|
||||||
|
|
||||||
need to fix local storage error
|
need to fix local storage error
|
||||||
|
|
||||||
page right (next page) button is not working
|
page right (next page) button is not working
|
||||||
in the middle of clone lesson type to lesson category
|
in the middle of clone lesson type to lesson category
|
||||||
- [ ] listing page
|
|
||||||
- [ ] delete button on each row
|
- [ ] listing page
|
||||||
- [ ] create page
|
- [ ] delete button on each row
|
||||||
- [ ] edit
|
- [ ] create page
|
||||||
- [ ] delete
|
- [ ] edit
|
||||||
|
- [ ] delete
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
# guideline
|
|
||||||
|
|
||||||
- please divide the problem into small parts
|
|
||||||
- if you found youself cannot understand the problem, please stop and ask how to do
|
|
||||||
- if you found youself cannot solve the problem, plesae stop and ask how to do
|
|
||||||
- review the whole solution before you reply to user
|
|
||||||
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
|
||||||
|
|
||||||
- example for page can be found in `./src/app/_helloworld/page.tsx`
|
|
||||||
- example for component can be found in `./src/components/_helloworld/index.tsx`
|
|
||||||
|
|
||||||
- no need to explain the reason until you are told to do so
|
|
||||||
- no need to show me the code change, at the end just simple summary in point form is ok
|
|
||||||
|
|
||||||
Thanks
|
|
@@ -1,15 +0,0 @@
|
|||||||
# guideline
|
|
||||||
|
|
||||||
- please divide the problem into small parts
|
|
||||||
- if you found youself cannot understand the problem, please stop and ask how to do
|
|
||||||
- if you found youself cannot solve the problem, plesae stop and ask how to do
|
|
||||||
- review the whole solution before you reply to user
|
|
||||||
- if code syntax is already there, do follow (e.g. naming convention, syntax) the existing code
|
|
||||||
|
|
||||||
- example for page can be found in `./src/app/_helloworld/page.tsx`
|
|
||||||
- example for component can be found in `./src/components/_helloworld/index.tsx`
|
|
||||||
|
|
||||||
- no need to explain the reason until you are told to do so
|
|
||||||
- no need to show me the code change, at the end just simple summary in point form is ok
|
|
||||||
|
|
||||||
Thanks
|
|
@@ -1,99 +0,0 @@
|
|||||||
# AI GUIDELINE
|
|
||||||
|
|
||||||
## getting started
|
|
||||||
|
|
||||||
Imagine there is a software developer and a QA engineer to solve the problems together
|
|
||||||
|
|
||||||
They will:
|
|
||||||
|
|
||||||
no need to reply me what you are going on and your digest in this phase.
|
|
||||||
just reply me "OK" when done
|
|
||||||
|
|
||||||
base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
|
||||||
|
|
||||||
- `schema.dbml`
|
|
||||||
|
|
||||||
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
|
||||||
this is file in dbml syntax state the main database
|
|
||||||
|
|
||||||
- `schema.json`
|
|
||||||
|
|
||||||
- read `<base_dir>/002_source/cms/src/db/schema.json`
|
|
||||||
this is the file of live pocketbase schema output
|
|
||||||
|
|
||||||
- read `<base_dir>/002_source/cms/src/constants.ts`
|
|
||||||
this is the content of `@/constants`
|
|
||||||
|
|
||||||
- look into the md files in folder `<base_dir>/002_source/cms/_AI_WORKSPACE/001_guideline`
|
|
||||||
|
|
||||||
- read, remember and link up the ideas in file stated above,
|
|
||||||
i will tell them the task afterwards
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
The software engineer will provide solutions,
|
|
||||||
while QA engineer will feedback the opinion.
|
|
||||||
|
|
||||||
this is now not in debug phase,
|
|
||||||
so, no need to reply me what they are going on or their insight throught the prompt.
|
|
||||||
just reply me "OK" when done
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
clone `GetVisibleCount.tsx` and `GetHiddenCount.tsx` from `LessonTypes` to `LessonCategories` and update it
|
|
||||||
|
|
||||||
please draft `GetHiddenCount.tsx` for COL_LESSON_TYPES and `status = hidden`
|
|
||||||
|
|
||||||
well done !, please proceed to another request
|
|
||||||
|
|
||||||
working directory: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db`
|
|
||||||
|
|
||||||
according information from `schema.json`, get the collection of `Students`
|
|
||||||
|
|
||||||
pleaes clone the `tsx` files from `LessonTypes` and `LessonCategories` to `Students` and update the content
|
|
||||||
|
|
||||||
when you draft coding, review file and append with `.tsx.draft`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
- this is part of react typescript project, with pocketbase
|
|
||||||
- `schema.dbml`, describe the collections(tables)
|
|
||||||
- folder `LessonCategories`, the correct references
|
|
||||||
- folder `LessonTypes`, the correct references
|
|
||||||
- you can find the `schema.dbml` and schema information from `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/001_documentation/Requirements/REQ0006`
|
|
||||||
- do not read root directory, assume it is a fresh copy of nextjs project is ok
|
|
||||||
|
|
||||||
## instruction
|
|
||||||
|
|
||||||
- break the questions into smaller parts
|
|
||||||
- review file append with `.draft`, see if the content aligned with the correct references
|
|
||||||
- read and understand `dbml` file
|
|
||||||
- lookup the every folder
|
|
||||||
|
|
||||||
## tasks
|
|
||||||
|
|
||||||
Thanks
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
please revise
|
|
||||||
|
|
||||||
please revise
|
|
||||||
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/types/LpCategory.tsx` `interface LpCategory`
|
|
||||||
|
|
||||||
to the collection `QuizLPCategories` align the dbml file in the previous prompt
|
|
||||||
|
|
||||||
please modify `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp_categories/_constants.tsx`
|
|
||||||
|
|
||||||
to follow the type definition in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/types/LpCategory.tsx`, the constant `defaultLpCategory`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
the constants file (`@/constants`) was `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/constants.ts`
|
|
||||||
|
|
||||||
please help to fix the `tsx` files in folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizMFCategories`,
|
|
||||||
the `COL` constants is wrongly used, it should refer to `COL_QUIZ_MF_CATEGORIES`. thanks
|
|
||||||
|
|
||||||
please update the `COL_XXXX` TO COL_MF_CATEGORIES
|
|
@@ -1,10 +0,0 @@
|
|||||||
Hi, i need your help.
|
|
||||||
|
|
||||||
i am working on a react typescript project
|
|
||||||
i will show you part of the code and it is located in folder `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/app/dashboard/mf`
|
|
||||||
|
|
||||||
it is copied from `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/app/dashboard/lp`, i want you to help modifing from `lp` to `mf`, the corrosponding word is `lp -> listening practice` and `mf -> matching frenzy`,
|
|
||||||
|
|
||||||
please help to update the `imports`, variables/constants, functions, classes
|
|
||||||
|
|
||||||
thank you
|
|
0
002_source/cms/autogen_config.py
Normal file
0
002_source/cms/autogen_config.py
Normal file
14
002_source/cms/default.code-workspace
Normal file
14
002_source/cms/default.code-workspace
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./../../001_documentation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../000_AI_WORKSPACE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
@@ -4,7 +4,7 @@
|
|||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": "==22"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
"test": "jest --watch",
|
"test": "jest --watch",
|
||||||
"update_doc": "cd 001_documentation/Requirements && node update_req_index.js",
|
"update_doc": "cd 001_documentation/Requirements && node update_req_index.js",
|
||||||
"update_doc:w": "pnpx nodemon --ext md --exec \"pnpm run update_doc\"",
|
"update_doc:w": "pnpx nodemon --ext md --exec \"pnpm run update_doc\"",
|
||||||
"update_repomix": "npx repomix",
|
"update_repomix": "node ./scripts/update_repomix.js",
|
||||||
"update_repomix:w": "pnpx nodemon --delay 3 --exec \"pnpx repomix\"",
|
"update_repomix:w": "pnpx nodemon --delay 3 --exec \"npm run update_repomix\"",
|
||||||
"clean": "rm -rf node_modules && rm -rf .next"
|
"clean": "rm -rf node_modules && rm -rf .next"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -91,6 +91,7 @@
|
|||||||
"zod": "3.22.4"
|
"zod": "3.22.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@faker-js/faker": "^9.7.0",
|
||||||
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
|
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
|
||||||
"@testing-library/jest-dom": "6.4.2",
|
"@testing-library/jest-dom": "6.4.2",
|
||||||
"@testing-library/react": "14.2.1",
|
"@testing-library/react": "14.2.1",
|
||||||
|
9
002_source/cms/pnpm-lock.yaml
generated
9
002_source/cms/pnpm-lock.yaml
generated
@@ -195,6 +195,9 @@ importers:
|
|||||||
specifier: 3.22.4
|
specifier: 3.22.4
|
||||||
version: 3.22.4
|
version: 3.22.4
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@faker-js/faker':
|
||||||
|
specifier: ^9.7.0
|
||||||
|
version: 9.7.0
|
||||||
'@ianvs/prettier-plugin-sort-imports':
|
'@ianvs/prettier-plugin-sort-imports':
|
||||||
specifier: 4.1.1
|
specifier: 4.1.1
|
||||||
version: 4.1.1(prettier@3.2.5)
|
version: 4.1.1(prettier@3.2.5)
|
||||||
@@ -725,6 +728,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==}
|
resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
|
|
||||||
|
'@faker-js/faker@9.7.0':
|
||||||
|
resolution: {integrity: sha512-aozo5vqjCmDoXLNUJarFZx2IN/GgGaogY4TMJ6so/WLZOWpSV7fvj2dmrV6sEAnUm1O7aCrhTibjpzeDFgNqbg==}
|
||||||
|
engines: {node: '>=18.0.0', npm: '>=9.0.0'}
|
||||||
|
|
||||||
'@fastify/busboy@2.1.0':
|
'@fastify/busboy@2.1.0':
|
||||||
resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==}
|
resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
@@ -6303,6 +6310,8 @@ snapshots:
|
|||||||
|
|
||||||
'@eslint/js@8.57.0': {}
|
'@eslint/js@8.57.0': {}
|
||||||
|
|
||||||
|
'@faker-js/faker@9.7.0': {}
|
||||||
|
|
||||||
'@fastify/busboy@2.1.0': {}
|
'@fastify/busboy@2.1.0': {}
|
||||||
|
|
||||||
'@firebase/analytics-compat@0.2.7(@firebase/app-compat@0.2.27)(@firebase/app@0.9.27)':
|
'@firebase/analytics-compat@0.2.7(@firebase/app-compat@0.2.27)(@firebase/app@0.9.27)':
|
||||||
|
3
002_source/cms/public/locales/de/teachers.json
Normal file
3
002_source/cms/public/locales/de/teachers.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"back-to-list": "Teachers"
|
||||||
|
}
|
@@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"languageChanged": "Sprache geändert"
|
"languageChanged": "Sprache geändert",
|
||||||
|
"teachers": {
|
||||||
|
"back-to-list": "Lehrer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,39 +0,0 @@
|
|||||||
# PROMPT
|
|
||||||
|
|
||||||
please update `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/public/locales/dev/translation.json`
|
|
||||||
to add below translations, thanks.
|
|
||||||
|
|
||||||
```
|
|
||||||
dashboard.lessonCategories.edit.title
|
|
||||||
dashboard.lessonCategories.edit.avatar
|
|
||||||
dashboard.lessonCategories.edit.avatarRequirements
|
|
||||||
dashboard.lessonCategories.edit.name
|
|
||||||
dashboard.lessonCategories.edit.type
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
please read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lesson_category/lesson-category-edit-form.tsx`
|
|
||||||
and update `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/public/locales/dev/translation.json` the missing translations, thanks.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
please refactor `common.json` to smaller translation files, thanks
|
|
||||||
e.g. `lessonTypes` -> `lesson_type`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Hi, i want you to help merge two translation files.
|
|
||||||
|
|
||||||
base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/public/locales/dev`
|
|
||||||
|
|
||||||
I want you to merge the content
|
|
||||||
|
|
||||||
from `<base_dir>/lesson_type.json` (source file)
|
|
||||||
to `<base_dir>/listening_practice.json` (dest file)
|
|
||||||
|
|
||||||
please extract , link up and remember the document properties
|
|
||||||
(e.g. types, functions, variables, constants, etc)
|
|
||||||
|
|
||||||
update the variables and properties of dest file to reflect `listening practice categories`/`lp_categories`
|
|
@@ -1,135 +1,4 @@
|
|||||||
{
|
{
|
||||||
"languageChanged": "語言已更改",
|
"hello": "world",
|
||||||
"type": "類型",
|
"teachers": "teachers"
|
||||||
"helloworld": "你好,世界",
|
}
|
||||||
"Add": "新增項目",
|
|
||||||
"visible": "可視",
|
|
||||||
"hidden": "屏閉",
|
|
||||||
"Hidden": "屏閉",
|
|
||||||
"Newest": "最新",
|
|
||||||
"Oldest": "最舊",
|
|
||||||
"Lesson position": "位置",
|
|
||||||
"Lesson type": "種類",
|
|
||||||
"Type": "種類",
|
|
||||||
"Name": "名稱",
|
|
||||||
"Filter by name": "依名稱過濾",
|
|
||||||
"Filter by type": "依類型過濾",
|
|
||||||
"Actions": "動作",
|
|
||||||
"Created at": "建立時間",
|
|
||||||
"Updated at": "更新時間",
|
|
||||||
"Position": "位置",
|
|
||||||
"Visible": "顯示",
|
|
||||||
"Apply": "套用",
|
|
||||||
"Overview": "概觀",
|
|
||||||
"Dashboard": "儀表板",
|
|
||||||
"Tickets": "票券",
|
|
||||||
"Sign ups": "註冊",
|
|
||||||
"Open issues": "開啟問題",
|
|
||||||
"Closed issues": "關閉問題",
|
|
||||||
"increase": "增加",
|
|
||||||
"decrease": "減少",
|
|
||||||
"common.loading": "載入中",
|
|
||||||
"vs last month": "與上個月相比",
|
|
||||||
"Dashboards": "儀表板",
|
|
||||||
"App usage": "應用程式使用情況",
|
|
||||||
"Find your dream job": "找到你的夢想工作",
|
|
||||||
"Need help figuring things out?": "需要幫助嗎?",
|
|
||||||
"Search for jobs that match your skills and apply to them directly": "搜索符合你技能的工作,直接申請",
|
|
||||||
"Find answers to your questions and get in touch with our team.": "找到你的問題並與我們的團隊聯繫",
|
|
||||||
"Explore documentation": "探索文件",
|
|
||||||
"Learn how to get started with our product and make the most of it.": "學習如何開始使用我們的產品並充分利用它",
|
|
||||||
"Search Jobs": "搜索工作",
|
|
||||||
"Help Center": "幫助中心",
|
|
||||||
"Documentation": "文件",
|
|
||||||
"increase_in_app_usage_with": "使用者量增加",
|
|
||||||
"new_products_purchased": "新產品購買",
|
|
||||||
"Our subscriptions": "我們的訂閱",
|
|
||||||
"this_year": "今年",
|
|
||||||
"is_forecasted_to_increase_in_your_traffic_by_the_end_of_the_current_month": "今年預計增加你的流量",
|
|
||||||
"Jan": "一月",
|
|
||||||
"Feb": "二月",
|
|
||||||
"Mar": "三月",
|
|
||||||
"Apr": "四月",
|
|
||||||
"May": "五月",
|
|
||||||
"Jun": "六月",
|
|
||||||
"Jul": "七月",
|
|
||||||
"Aug": "八月",
|
|
||||||
"Sep": "九月",
|
|
||||||
"Oct": "十月",
|
|
||||||
"Nov": "十一月",
|
|
||||||
"Dec": "十二月",
|
|
||||||
"See all subscriptions": "查看所有訂閱",
|
|
||||||
"app_chat": "應用程式聊天",
|
|
||||||
"Upcoming events": "即將發生的事件",
|
|
||||||
"Based on the linked bank accounts": "基於連結的銀行帳戶",
|
|
||||||
"App limits": "應用程式限制",
|
|
||||||
"You have used {percentage} of your available spots.": "您已使用 {percentage} 的可用座位。升級計劃以建立更多專案",
|
|
||||||
"userMessagesUnread": "hello userMessagesUnread",
|
|
||||||
"Upgrade plan to create more projects": "升級計劃以建立更多專案",
|
|
||||||
"You have almost reached your limit": "您已接近您的限制",
|
|
||||||
"Upgrade plan": "升級計劃",
|
|
||||||
"Help center": "幫助中心",
|
|
||||||
"Jobs": "工作",
|
|
||||||
"go_to_chat": "前往聊天",
|
|
||||||
"See all events": "查看所有事件",
|
|
||||||
"You have used": "您已使用",
|
|
||||||
"of your available spots": "的可用座位",
|
|
||||||
"Paid": "已付款",
|
|
||||||
"Canceled": "已取消",
|
|
||||||
"Pending": "待付款",
|
|
||||||
"Expiring": "已過期",
|
|
||||||
"Refunded": "已退款",
|
|
||||||
"Total": "總計",
|
|
||||||
"Total paid": "已付款",
|
|
||||||
"Total cancelled": "已取消",
|
|
||||||
"Total pending": "待付款",
|
|
||||||
"year": "年",
|
|
||||||
"month": "月",
|
|
||||||
"week": "週",
|
|
||||||
"day": "日",
|
|
||||||
"hour": "小時",
|
|
||||||
"minute": "分鐘",
|
|
||||||
"second": "秒",
|
|
||||||
"ago": "前",
|
|
||||||
"remaining": "剩下",
|
|
||||||
"days": "天",
|
|
||||||
"hours": "小時",
|
|
||||||
"minutes": "分鐘",
|
|
||||||
"seconds": "秒",
|
|
||||||
"Clear filters": "清除篩選",
|
|
||||||
"Type information": "輸入資訊",
|
|
||||||
"Cancel": "取消",
|
|
||||||
"Delete": "刪除",
|
|
||||||
"All": "全部",
|
|
||||||
"categories": "課程分類",
|
|
||||||
"loading": "載入中",
|
|
||||||
"Notifications": "通知",
|
|
||||||
"Mark all as read": "標記所有為已讀",
|
|
||||||
"There are no notifications": "沒有通知",
|
|
||||||
"listenings": "聽講 (Listenings)",
|
|
||||||
"question_category": "問題分類",
|
|
||||||
"question_list": "問題",
|
|
||||||
"matching_frenzy": "配對 (Matching Frenzy)",
|
|
||||||
"connective_revision": "連接詞 (Connective Revision)",
|
|
||||||
"settings": "設定",
|
|
||||||
"students": "學生",
|
|
||||||
"dashboard.lessonCategories.title": "課程分類",
|
|
||||||
"dashboard.lessonCategorys.edit.name": "課程分類名稱",
|
|
||||||
"dashboard.lessonCategorys.edit.position": "課程分類順序",
|
|
||||||
"dashboard.lessonCategorys.edit.title": "編輯課程分類",
|
|
||||||
"dashboard.lessonCategorys.edit.visibleToUser": "顯示給使用者",
|
|
||||||
"dashboard.lessonCategorys.edit.visible": "顯示",
|
|
||||||
"dashboard.lessonCategorys.edit.hidden": "隱藏",
|
|
||||||
"dashboard.lessonCategorys.edit.cancelButton": "取消",
|
|
||||||
"dashboard.lessonCategorys.edit.updateButton": "更新",
|
|
||||||
"dashboard.lessonCategorys.list.title": "課堂種類",
|
|
||||||
"word-count": "字數",
|
|
||||||
"unable-to-process-request": "無法處理請求",
|
|
||||||
"detailed-error-information": "詳細錯誤資訊",
|
|
||||||
"error": {
|
|
||||||
"unable-to-process-request": "無法處理您的請求",
|
|
||||||
"detailed-error-information": "詳細錯誤資訊"
|
|
||||||
},
|
|
||||||
"name-is-required": "名稱為必填",
|
|
||||||
"listening-practice": "聽講練習"
|
|
||||||
}
|
|
||||||
|
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"add": "新增課程分類",
|
|
||||||
"title": "課程分類",
|
|
||||||
"basic_info": "基本資訊",
|
|
||||||
"error": {
|
|
||||||
"unable-to-process-request": "無法處理您的請求",
|
|
||||||
"detailed-error-information": "詳細錯誤資訊"
|
|
||||||
},
|
|
||||||
"create": {
|
|
||||||
"title": "建立課程類型",
|
|
||||||
"createButton": "建立",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"message": "請輸入課程類型名稱",
|
|
||||||
"success": "課程類型建立成功",
|
|
||||||
"error": "課程類型建立失敗",
|
|
||||||
"typeInformation": "輸入課程類型資訊",
|
|
||||||
"avatar": "上傳課程類型圖片",
|
|
||||||
"avatar_select": "選擇圖片",
|
|
||||||
"avatarRequirements": "最小 400x400 像素,PNG 或 JPEG",
|
|
||||||
"select": "請選擇",
|
|
||||||
"name": "課程類型名稱",
|
|
||||||
"position": "課程類型順序",
|
|
||||||
"visibleToUser": "顯示給使用者",
|
|
||||||
"detail-information": "詳細資訊",
|
|
||||||
"description": "課程類型描述",
|
|
||||||
"remarks": "備註"
|
|
||||||
},
|
|
||||||
"edit": {
|
|
||||||
"avatar": "上傳圖片",
|
|
||||||
"avatarRequirements": "最小 400x400 像素,PNG 或 JPEG",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"error": "課程類型更新失敗",
|
|
||||||
"hidden": "隱藏",
|
|
||||||
"name": "課程分類名稱",
|
|
||||||
"position": "課程分類順序",
|
|
||||||
"select": "請選擇",
|
|
||||||
"success": "課程類型更新成功",
|
|
||||||
"title": "編輯課程分類",
|
|
||||||
"basic-info": "基本資訊",
|
|
||||||
"type": "類型",
|
|
||||||
"updateButton": "更新",
|
|
||||||
"visible": "顯示",
|
|
||||||
"visibleToUser": "顯示給使用者",
|
|
||||||
"write-something": "輸入一些內容"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"title": "刪除課程類型",
|
|
||||||
"message": "確定要刪除課程類型嗎?",
|
|
||||||
"success": "課程類型刪除成功",
|
|
||||||
"error": "課程類型刪除失敗",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"deleteButton": "刪除"
|
|
||||||
},
|
|
||||||
"list": {
|
|
||||||
"title": "課堂種類",
|
|
||||||
"message": "請選擇課程類型",
|
|
||||||
"empty": {
|
|
||||||
"title": "目前沒有課程類型",
|
|
||||||
"message": "請建立課程類型",
|
|
||||||
"create": "建立課程類型"
|
|
||||||
},
|
|
||||||
"error": "課程類型載入失敗",
|
|
||||||
"add": "新增課程分類"
|
|
||||||
},
|
|
||||||
"view": {
|
|
||||||
"basic-details": "基本資訊"
|
|
||||||
},
|
|
||||||
"Delete Lesson Type ?": "刪除課程類型?",
|
|
||||||
"Are you sure you want to delete lesson type ?": "確定要刪除課程類型嗎?"
|
|
||||||
}
|
|
@@ -1,65 +0,0 @@
|
|||||||
{
|
|
||||||
"add": "新增課程類型",
|
|
||||||
"title": "課程類型",
|
|
||||||
"type": "類型",
|
|
||||||
"error": {
|
|
||||||
"unable-to-process-request": "無法處理您的請求",
|
|
||||||
"detailed-error-information": "詳細錯誤資訊"
|
|
||||||
},
|
|
||||||
"create": {
|
|
||||||
"title": "建立課程類型",
|
|
||||||
"createButton": "建立",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"message": "請輸入課程類型名稱",
|
|
||||||
"success": "課程類型建立成功",
|
|
||||||
"error": "課程類型建立失敗",
|
|
||||||
"typeInformation": "輸入課程類型資訊",
|
|
||||||
"avatar": "上傳課程類型圖片",
|
|
||||||
"avatarRequirements": "上傳課程類型圖片",
|
|
||||||
"select": "請選擇",
|
|
||||||
"name": "課程類型名稱",
|
|
||||||
"position": "課程類型順序",
|
|
||||||
"visibleToUser": "顯示給使用者"
|
|
||||||
},
|
|
||||||
"edit": {
|
|
||||||
"avatar": "上傳課程類型圖片",
|
|
||||||
"avatarRequirements": "上傳課程類型圖片",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"error": "課程類型更新失敗",
|
|
||||||
"hidden": "隱藏",
|
|
||||||
"name": "課程類型名稱",
|
|
||||||
"position": "課程類型順序",
|
|
||||||
"select": "請選擇",
|
|
||||||
"success": "課程類型更新成功",
|
|
||||||
"title": "編輯課程類型",
|
|
||||||
"typeInformation": "輸入課程類型資訊",
|
|
||||||
"updateButton": "更新",
|
|
||||||
"visible": "顯示",
|
|
||||||
"visibleToUser": "顯示給使用者"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"title": "刪除課程類型",
|
|
||||||
"message": "確定要刪除課程類型嗎?",
|
|
||||||
"success": "課程類型刪除成功",
|
|
||||||
"error": "課程類型刪除失敗",
|
|
||||||
"cancelButton": "取消",
|
|
||||||
"deleteButton": "刪除"
|
|
||||||
},
|
|
||||||
"list": {
|
|
||||||
"title": "課程類型列表",
|
|
||||||
"message": "請選擇課程類型",
|
|
||||||
"empty": {
|
|
||||||
"title": "目前沒有課程類型",
|
|
||||||
"message": "請建立課程類型",
|
|
||||||
"create": "建立課程類型"
|
|
||||||
},
|
|
||||||
"error": "課程類型載入失敗"
|
|
||||||
},
|
|
||||||
"view": {
|
|
||||||
"basic-details": "基本資訊"
|
|
||||||
},
|
|
||||||
"Lesson Type": "課程類型",
|
|
||||||
"Lesson Types": "課程類型",
|
|
||||||
"Delete Lesson Type ?": "刪除課程類型?",
|
|
||||||
"Are you sure you want to delete lesson type ?": "確定要刪除課程類型嗎?"
|
|
||||||
}
|
|
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"add": "新增",
|
|
||||||
"listening-practice": "聽力練習",
|
|
||||||
"list": {
|
|
||||||
"title": "聽力練習分類列表",
|
|
||||||
"empty": "沒有找到聽力練習分類",
|
|
||||||
"action": "動作?",
|
|
||||||
"basic-details": "基本資料"
|
|
||||||
},
|
|
||||||
"helloworld": "listening_practice",
|
|
||||||
"title": "聽力練習分類",
|
|
||||||
"type": "聽力練習分類",
|
|
||||||
"error": {
|
|
||||||
"invalid": "無效的聽力練習分類",
|
|
||||||
"not_found": "未找到聽力練習分類"
|
|
||||||
},
|
|
||||||
"create": {
|
|
||||||
"title": "創建聽力練習分類",
|
|
||||||
"success": "聽力練習分類創建成功",
|
|
||||||
"error": "創建聽力練習分類時出錯"
|
|
||||||
},
|
|
||||||
"edit": {
|
|
||||||
"title": "編輯聽力練習分類",
|
|
||||||
"success": "聽力練習分類更新成功",
|
|
||||||
"error": "更新聽力練習分類時出錯"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"title": "刪除聽力練習分類",
|
|
||||||
"confirm": "確定要刪除聽力練習分類嗎?",
|
|
||||||
"success": "聽力練習分類刪除成功",
|
|
||||||
"error": "刪除聽力練習分類時出錯"
|
|
||||||
},
|
|
||||||
"view": {
|
|
||||||
"title": "查看聽力練習分類詳情"
|
|
||||||
}
|
|
||||||
}
|
|
3
002_source/cms/public/locales/dev/teachers.json
Normal file
3
002_source/cms/public/locales/dev/teachers.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"back-to-list": "Teachers"
|
||||||
|
}
|
@@ -1,200 +0,0 @@
|
|||||||
{
|
|
||||||
"languageChanged": "語言已更改",
|
|
||||||
"type": "類型",
|
|
||||||
"helloworld": "你好,世界",
|
|
||||||
"Add": "新增項目",
|
|
||||||
"visible": "可視",
|
|
||||||
"hidden": "屏閉",
|
|
||||||
"Hidden": "屏閉",
|
|
||||||
"Newest": "最新",
|
|
||||||
"Oldest": "最舊",
|
|
||||||
"Lesson position": "位置",
|
|
||||||
"Lesson type": "種類",
|
|
||||||
"Type": "種類",
|
|
||||||
"Name": "名稱",
|
|
||||||
"Filter by name": "依名稱過濾",
|
|
||||||
"Filter by type": "依類型過濾",
|
|
||||||
"dashboard.lessonTypes.add": "新增課程類型",
|
|
||||||
"dashboard.lessonTypes.title": "課程類型",
|
|
||||||
"dashboard.lessonTypes.type": "類型",
|
|
||||||
"dashboard.lessonTypes.create.title": "建立課程類型",
|
|
||||||
"dashboard.lessonTypes.create.createButton": "建立",
|
|
||||||
"dashboard.lessonTypes.create.cancelButton": "取消",
|
|
||||||
"dashboard.lessonTypes.edit.title": "編輯課程類型",
|
|
||||||
"Actions": "動作",
|
|
||||||
"Created at": "建立時間",
|
|
||||||
"Updated at": "更新時間",
|
|
||||||
"dashboard.lessonTypes.edit": "編輯課程類型",
|
|
||||||
"dashboard.lessonTypes.delete": "刪除課程類型",
|
|
||||||
"dashboard.lessonTypes.delete.title": "刪除課程類型",
|
|
||||||
"dashboard.lessonTypes.delete.message": "確定要刪除課程類型嗎?",
|
|
||||||
"Lesson Type": "課程類型",
|
|
||||||
"dashboard.lessonTypes.create": "建立課程類型",
|
|
||||||
"dashboard.lessonTypes.create.message": "請輸入課程類型名稱",
|
|
||||||
"dashboard.lessonTypes.create.success": "課程類型建立成功",
|
|
||||||
"dashboard.lessonTypes.create.error": "課程類型建立失敗",
|
|
||||||
"dashboard.lessonTypes.edit.success": "課程類型更新成功",
|
|
||||||
"dashboard.lessonTypes.edit.error": "課程類型更新失敗",
|
|
||||||
"dashboard.lessonTypes.delete.success": "課程類型刪除成功",
|
|
||||||
"dashboard.lessonTypes.delete.error": "課程類型刪除失敗",
|
|
||||||
"dashboard.lessonTypes.list": "課程類型列表",
|
|
||||||
"dashboard.lessonTypes.list.title": "課程類型列表",
|
|
||||||
"dashboard.lessonTypes.list.message": "請選擇課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty": "目前沒有課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.title": "目前沒有課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.message": "請建立課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create": "建立課程類型",
|
|
||||||
"Lesson Name": "課程名稱",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.title": "建立課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.message": "請輸入課程名稱",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.success": "課程建立成功",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.error": "課程建立失敗",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.name": "課程名稱",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type": "課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.placeholder": "請選擇課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.title": "課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.message": "請選擇課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.empty": "目前沒有課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.empty.title": "目前沒有課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.empty.message": "請建立課程類型",
|
|
||||||
"dashboard.lessonTypes.list.empty.create.type.empty.create": "建立課程類型",
|
|
||||||
"Position": "位置",
|
|
||||||
"Visible": "顯示",
|
|
||||||
"Lesson Types": "課程類型",
|
|
||||||
"Apply": "套用",
|
|
||||||
"Overview": "概觀",
|
|
||||||
"Dashboard": "儀表板",
|
|
||||||
"Tickets": "票券",
|
|
||||||
"Sign ups": "註冊",
|
|
||||||
"Open issues": "開啟問題",
|
|
||||||
"Closed issues": "關閉問題",
|
|
||||||
"increase": "增加",
|
|
||||||
"decrease": "減少",
|
|
||||||
"common.loading": "載入中",
|
|
||||||
"vs last month": "與上個月相比",
|
|
||||||
"Dashboards": "儀表板",
|
|
||||||
"App usage": "應用程式使用情況",
|
|
||||||
"Find your dream job": "找到你的夢想工作",
|
|
||||||
"Need help figuring things out?": "需要幫助嗎?",
|
|
||||||
"Search for jobs that match your skills and apply to them directly": "搜索符合你技能的工作,直接申請",
|
|
||||||
"Find answers to your questions and get in touch with our team.": "找到你的問題並與我們的團隊聯繫",
|
|
||||||
"Explore documentation": "探索文件",
|
|
||||||
"Learn how to get started with our product and make the most of it.": "學習如何開始使用我們的產品並充分利用它",
|
|
||||||
"Search Jobs": "搜索工作",
|
|
||||||
"Help Center": "幫助中心",
|
|
||||||
"Documentation": "文件",
|
|
||||||
"increase_in_app_usage_with": "使用者量增加",
|
|
||||||
"new_products_purchased": "新產品購買",
|
|
||||||
"Our subscriptions": "我們的訂閱",
|
|
||||||
"this_year": "今年",
|
|
||||||
"is_forecasted_to_increase_in_your_traffic_by_the_end_of_the_current_month": "今年預計增加你的流量",
|
|
||||||
"Jan": "一月",
|
|
||||||
"Feb": "二月",
|
|
||||||
"Mar": "三月",
|
|
||||||
"Apr": "四月",
|
|
||||||
"May": "五月",
|
|
||||||
"Jun": "六月",
|
|
||||||
"Jul": "七月",
|
|
||||||
"Aug": "八月",
|
|
||||||
"Sep": "九月",
|
|
||||||
"Oct": "十月",
|
|
||||||
"Nov": "十一月",
|
|
||||||
"Dec": "十二月",
|
|
||||||
"See all subscriptions": "查看所有訂閱",
|
|
||||||
"app_chat": "應用程式聊天",
|
|
||||||
"Upcoming events": "即將發生的事件",
|
|
||||||
"Based on the linked bank accounts": "基於連結的銀行帳戶",
|
|
||||||
"App limits": "應用程式限制",
|
|
||||||
"You have used {percentage} of your available spots.": "您已使用 {percentage} 的可用座位。升級計劃以建立更多專案",
|
|
||||||
"userMessagesUnread": "hello userMessagesUnread",
|
|
||||||
"Upgrade plan to create more projects": "升級計劃以建立更多專案",
|
|
||||||
"You have almost reached your limit": "您已接近您的限制",
|
|
||||||
"Upgrade plan": "升級計劃",
|
|
||||||
"Help center": "幫助中心",
|
|
||||||
"Jobs": "工作",
|
|
||||||
"go_to_chat": "前往聊天",
|
|
||||||
"See all events": "查看所有事件",
|
|
||||||
"You have used": "您已使用",
|
|
||||||
"of your available spots": "的可用座位",
|
|
||||||
"Paid": "已付款",
|
|
||||||
"Canceled": "已取消",
|
|
||||||
"Pending": "待付款",
|
|
||||||
"Expiring": "已過期",
|
|
||||||
"Refunded": "已退款",
|
|
||||||
"Total": "總計",
|
|
||||||
"Total paid": "已付款",
|
|
||||||
"Total cancelled": "已取消",
|
|
||||||
"Total pending": "待付款",
|
|
||||||
"year": "年",
|
|
||||||
"month": "月",
|
|
||||||
"week": "週",
|
|
||||||
"day": "日",
|
|
||||||
"hour": "小時",
|
|
||||||
"minute": "分鐘",
|
|
||||||
"second": "秒",
|
|
||||||
"ago": "前",
|
|
||||||
"remaining": "剩下",
|
|
||||||
"days": "天",
|
|
||||||
"hours": "小時",
|
|
||||||
"minutes": "分鐘",
|
|
||||||
"seconds": "秒",
|
|
||||||
"Clear filters": "清除篩選",
|
|
||||||
"Type information": "輸入資訊",
|
|
||||||
"dashboard.lessonTypes.create.typeInformation": "輸入課程類型資訊",
|
|
||||||
"dashboard.lessonTypes.create.avatar": "上傳課程類型圖片",
|
|
||||||
"dashboard.lessonTypes.create.avatarRequirements": "上傳課程類型圖片",
|
|
||||||
"dashboard.lessonTypes.create.select": "請選擇",
|
|
||||||
"dashboard.lessonTypes.create.name": "課程類型名稱",
|
|
||||||
"dashboard.lessonTypes.create.type": "課程類型",
|
|
||||||
"dashboard.lessonTypes.create.position": "課程類型順序",
|
|
||||||
"dashboard.lessonTypes.create.visibleToUser": "顯示給使用者",
|
|
||||||
"dashboard.lessonTypes.edit.typeInformation": "輸入課程類型資訊",
|
|
||||||
"dashboard.lessonTypes.edit.avatar": "上傳課程類型圖片",
|
|
||||||
"dashboard.lessonTypes.edit.avatarRequirements": "上傳課程類型圖片",
|
|
||||||
"dashboard.lessonTypes.edit.select": "請選擇",
|
|
||||||
"dashboard.lessonTypes.edit.name": "課程類型名稱",
|
|
||||||
"dashboard.lessonTypes.edit.type": "課程類型",
|
|
||||||
"dashboard.lessonTypes.edit.position": "課程類型順序",
|
|
||||||
"dashboard.lessonTypes.edit.visibleToUser": "顯示給使用者",
|
|
||||||
"dashboard.lessonTypes.edit.visible": "顯示",
|
|
||||||
"dashboard.lessonTypes.edit.hidden": "隱藏",
|
|
||||||
"dashboard.lessonTypes.edit.cancelButton": "取消",
|
|
||||||
"dashboard.lessonTypes.edit.updateButton": "更新",
|
|
||||||
"Delete Lesson Type ?": "刪除課程類型?",
|
|
||||||
"Are you sure you want to delete lesson type ?": "確定要刪除課程類型嗎?",
|
|
||||||
"Cancel": "取消",
|
|
||||||
"Delete": "刪除",
|
|
||||||
"All": "全部",
|
|
||||||
"categories": "問題分類",
|
|
||||||
"listening-practice": "聽講練習 (LP)",
|
|
||||||
"matching-frenzy": "配對練習 (MF)",
|
|
||||||
"connective-revision": "連接詞練習 (CR)",
|
|
||||||
"teachers": "導師",
|
|
||||||
"questions": "題目",
|
|
||||||
"loading": "載入中",
|
|
||||||
"Notifications": "通知",
|
|
||||||
"Mark all as read": "標記所有為已讀",
|
|
||||||
"There are no notifications": "沒有通知",
|
|
||||||
"listenings": "聽講 (Listenings)",
|
|
||||||
"question_category": "問題分類",
|
|
||||||
"question_list": "問題",
|
|
||||||
"matching_frenzy": "配對 (Matching Frenzy)",
|
|
||||||
"connective_revision": "連接詞 (Connective Revision)",
|
|
||||||
"settings": "設定",
|
|
||||||
"students": "學生",
|
|
||||||
"dashboard.lessonCategories.add": "新增課程分類",
|
|
||||||
"dashboard.lessonCategories.title": "課程分類",
|
|
||||||
"dashboard.lessonCategorys.edit.name": "課程分類名稱",
|
|
||||||
"dashboard.lessonCategorys.edit.position": "課程分類順序",
|
|
||||||
"dashboard.lessonCategorys.edit.title": "編輯課程分類",
|
|
||||||
"dashboard.lessonCategorys.edit.visibleToUser": "顯示給使用者",
|
|
||||||
"dashboard.lessonCategorys.edit.visible": "顯示",
|
|
||||||
"dashboard.lessonCategorys.edit.hidden": "隱藏",
|
|
||||||
"dashboard.lessonCategorys.edit.cancelButton": "取消",
|
|
||||||
"dashboard.lessonCategorys.edit.updateButton": "更新",
|
|
||||||
"dashboard.lessonCategorys.list.title": "課堂種類",
|
|
||||||
"word-count": "字數",
|
|
||||||
"dashboard.lessonTypes.list.error": "課程類型載入失敗",
|
|
||||||
"unable-to-process-request": "無法處理請求",
|
|
||||||
"detailed-error-information": "詳細錯誤資訊"
|
|
||||||
}
|
|
3
002_source/cms/public/locales/en/teachers.json
Normal file
3
002_source/cms/public/locales/en/teachers.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"back-to-list": "Teachers"
|
||||||
|
}
|
@@ -1,3 +1,7 @@
|
|||||||
{
|
{
|
||||||
"languageChanged": "Language changed"
|
"languageChanged": "Language changed",
|
||||||
|
"teachers": {
|
||||||
|
"nav-title": "teachers",
|
||||||
|
"back-to-list": "Teachers"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
3
002_source/cms/public/locales/es/teachers.json
Normal file
3
002_source/cms/public/locales/es/teachers.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"back-to-list": "Teachers"
|
||||||
|
}
|
@@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"languageChanged": "Idioma cambiado"
|
"languageChanged": "Idioma cambiado",
|
||||||
|
"teachers": {
|
||||||
|
"back-to-list": "Profesores"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,5 +2,4 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
rm -rf .next
|
|
||||||
pnpm run dev
|
pnpm run dev
|
||||||
|
7
002_source/cms/scripts/005_update_repomix.sh
Executable file
7
002_source/cms/scripts/005_update_repomix.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
node ./scripts/update_repomix.js
|
||||||
|
|
||||||
|
echo "done"
|
7
002_source/cms/scripts/006_test.sh
Executable file
7
002_source/cms/scripts/006_test.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
node ./scripts/update_repomix.js
|
||||||
|
|
||||||
|
echo "done"
|
8
002_source/cms/scripts/999_express_commit.sh
Executable file
8
002_source/cms/scripts/999_express_commit.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
git add src
|
||||||
|
git commit -m'update,'
|
||||||
|
|
||||||
|
echo "done"
|
@@ -1,19 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ex
|
set -x
|
||||||
|
|
||||||
# ls **/.next
|
# ls **/.next
|
||||||
# ls **/.pnpm
|
# ls **/.pnpm
|
||||||
# ls **/node_modules
|
# ls **/node_modules
|
||||||
|
ls **/*.bak
|
||||||
|
ls **/*draft
|
||||||
|
ls **/*.del
|
||||||
|
ls **/*.plan
|
||||||
ls **/*Zone*
|
ls **/*Zone*
|
||||||
|
|
||||||
set -e
|
# set -e
|
||||||
|
|
||||||
read -p "Press [Enter] key to clean directories..."
|
# read -p "Press [Enter] key to clean directories..."
|
||||||
|
|
||||||
# rm -rf **/.next
|
# # rm -rf **/.next
|
||||||
# rm -rf **/.pnpm
|
# # rm -rf **/.pnpm
|
||||||
# rm -rf **/node_modules
|
# # rm -rf **/node_modules
|
||||||
rm -rf **/*Zone*
|
# rm -rf **/*Zone*
|
||||||
|
|
||||||
echo "clean done"
|
echo "clean done"
|
||||||
|
39
002_source/cms/scripts/update_repomix.js
Normal file
39
002_source/cms/scripts/update_repomix.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
const exec = require('child_process').exec;
|
||||||
|
|
||||||
|
let directories = [
|
||||||
|
//
|
||||||
|
// './src/db',
|
||||||
|
// './src/app/dashboard/lp',
|
||||||
|
// './src/app/dashboard/mf',
|
||||||
|
// './src/app/dashboard/cr',
|
||||||
|
// './src/components/dashboard/lp',
|
||||||
|
// './src/components/dashboard/mf',
|
||||||
|
// './src/components/dashboard/cr',
|
||||||
|
// './src/app/dashboard/Sample',
|
||||||
|
'./src/components/dashboard/customer',
|
||||||
|
].map((directory) => {
|
||||||
|
return `cd ${directory} && pnpx repomix -c /home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/repomix.config.json`;
|
||||||
|
});
|
||||||
|
|
||||||
|
Promise.all(
|
||||||
|
directories.map(
|
||||||
|
(directory) =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
exec(directory, (error, stdout, stderr) => {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
console.log(stdout);
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
console.log('done');
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
// process.exit(1);
|
||||||
|
});
|
35
002_source/cms/src/__tests__/__snapshots__/snapshot.js.snap
Normal file
35
002_source/cms/src/__tests__/__snapshots__/snapshot.js.snap
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`renders homepage unchanged 1`] = `
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="MuiBox-root css-0"
|
||||||
|
>
|
||||||
|
hello world!
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="MuiBox-root css-0"
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
class="MuiTypography-root MuiTypography-body1 css-1kivl2a-MuiTypography-root"
|
||||||
|
>
|
||||||
|
inner component
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
class="MuiListItemIcon-root css-cveggr-MuiListItemIcon-root"
|
||||||
|
/>
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
height="1em"
|
||||||
|
viewBox="0 0 256 256"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
21
002_source/cms/src/__tests__/app/_helloworld/page.test.tsx
Normal file
21
002_source/cms/src/__tests__/app/_helloworld/page.test.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/// <reference types="jest" />
|
||||||
|
import '@testing-library/jest-dom';
|
||||||
|
import { render, screen } from '@testing-library/react';
|
||||||
|
import Page from '@/app/_helloworld/page';
|
||||||
|
|
||||||
|
// Mock the translation hook
|
||||||
|
jest.mock('react-i18next', () => ({
|
||||||
|
useTranslation: () => ({
|
||||||
|
t: (key: string) => key,
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Page', () => {
|
||||||
|
it('renders a heading', () => {
|
||||||
|
render(<Page hello={'world'} />);
|
||||||
|
|
||||||
|
const heading = screen.getByRole('heading', { level: 1 });
|
||||||
|
|
||||||
|
expect(heading).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
9
002_source/cms/src/__tests__/snapshot.js
Normal file
9
002_source/cms/src/__tests__/snapshot.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { render } from '@testing-library/react';
|
||||||
|
|
||||||
|
// CUT = Component Under Test
|
||||||
|
import CUT from '../components/_helloworld';
|
||||||
|
|
||||||
|
it('renders homepage unchanged', () => {
|
||||||
|
const { container } = render(<CUT />);
|
||||||
|
expect(container).toMatchSnapshot();
|
||||||
|
});
|
@@ -12,9 +12,9 @@ import { Plus as PlusIcon } from '@phosphor-icons/react/dist/ssr/Plus';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import type { Address } from '@/types/Address';
|
import type { Address } from '@/types/Address';
|
||||||
import { ShippingAddress } from '@/components/dashboard/lp_categories/shipping-address';
|
import { ShippingAddress } from '@/components/dashboard/lp/categories/shipping-address';
|
||||||
|
|
||||||
import { SampleAddresses } from '../SampleAddresses';
|
import { SampleAddresses } from './SampleAddresses';
|
||||||
|
|
||||||
export default function SampleAddressCard(): React.JSX.Element {
|
export default function SampleAddressCard(): React.JSX.Element {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -22,7 +22,10 @@ export default function SampleAddressCard(): React.JSX.Element {
|
|||||||
<Card>
|
<Card>
|
||||||
<CardHeader
|
<CardHeader
|
||||||
action={
|
action={
|
||||||
<Button color="secondary" startIcon={<PlusIcon />}>
|
<Button
|
||||||
|
color="secondary"
|
||||||
|
startIcon={<PlusIcon />}
|
||||||
|
>
|
||||||
{t('list.add')}
|
{t('list.add')}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
@@ -34,9 +37,16 @@ export default function SampleAddressCard(): React.JSX.Element {
|
|||||||
title={t('list.shipping-addresses')}
|
title={t('list.shipping-addresses')}
|
||||||
/>
|
/>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Grid container spacing={3}>
|
<Grid
|
||||||
|
container
|
||||||
|
spacing={3}
|
||||||
|
>
|
||||||
{(SampleAddresses satisfies Address[]).map((address) => (
|
{(SampleAddresses satisfies Address[]).map((address) => (
|
||||||
<Grid key={address.id} md={6} xs={12}>
|
<Grid
|
||||||
|
key={address.id}
|
||||||
|
md={6}
|
||||||
|
xs={12}
|
||||||
|
>
|
||||||
<ShippingAddress address={address} />
|
<ShippingAddress address={address} />
|
||||||
</Grid>
|
</Grid>
|
||||||
))}
|
))}
|
||||||
|
@@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
import { PropertyItem } from '@/components/core/property-item';
|
import { PropertyItem } from '@/components/core/property-item';
|
||||||
import { PropertyList } from '@/components/core/property-list';
|
import { PropertyList } from '@/components/core/property-list';
|
||||||
import { Payments } from '@/components/dashboard/lp_categories/payments';
|
import { Payments } from '@/components/dashboard/lp/categories/payments';
|
||||||
|
|
||||||
import { SamplePayments } from './SamplePayments';
|
import { SamplePayments } from './SamplePayments';
|
||||||
|
|
||||||
@@ -21,11 +21,19 @@ export default function SamplePaymentCard(): React.JSX.Element {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Payments ordersValue={2069.48} payments={SamplePayments} refundsValue={324.5} totalOrders={5} />
|
<Payments
|
||||||
|
ordersValue={2069.48}
|
||||||
|
payments={SamplePayments}
|
||||||
|
refundsValue={324.5}
|
||||||
|
totalOrders={5}
|
||||||
|
/>
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader
|
<CardHeader
|
||||||
action={
|
action={
|
||||||
<Button color="secondary" startIcon={<PencilSimpleIcon />}>
|
<Button
|
||||||
|
color="secondary"
|
||||||
|
startIcon={<PencilSimpleIcon />}
|
||||||
|
>
|
||||||
{t('list.edit')}
|
{t('list.edit')}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
@@ -37,8 +45,14 @@ export default function SamplePaymentCard(): React.JSX.Element {
|
|||||||
title={t('list.billing-details')}
|
title={t('list.billing-details')}
|
||||||
/>
|
/>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Card sx={{ borderRadius: 1 }} variant="outlined">
|
<Card
|
||||||
<PropertyList divider={<Divider />} sx={{ '--PropertyItem-padding': '16px' }}>
|
sx={{ borderRadius: 1 }}
|
||||||
|
variant="outlined"
|
||||||
|
>
|
||||||
|
<PropertyList
|
||||||
|
divider={<Divider />}
|
||||||
|
sx={{ '--PropertyItem-padding': '16px' }}
|
||||||
|
>
|
||||||
{(
|
{(
|
||||||
[
|
[
|
||||||
{ key: t('Credit card'), value: '**** 4142' },
|
{ key: t('Credit card'), value: '**** 4142' },
|
||||||
@@ -50,7 +64,11 @@ export default function SamplePaymentCard(): React.JSX.Element {
|
|||||||
] satisfies { key: string; value: React.ReactNode }[]
|
] satisfies { key: string; value: React.ReactNode }[]
|
||||||
).map(
|
).map(
|
||||||
(item): React.JSX.Element => (
|
(item): React.JSX.Element => (
|
||||||
<PropertyItem key={item.key} name={item.key} value={item.value} />
|
<PropertyItem
|
||||||
|
key={item.key}
|
||||||
|
name={item.key}
|
||||||
|
value={item.value}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</PropertyList>
|
</PropertyList>
|
@@ -27,11 +27,17 @@ export default function SampleSecurityCard(): React.JSX.Element {
|
|||||||
<CardContent>
|
<CardContent>
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
<div>
|
<div>
|
||||||
<Button color="error" variant="contained">
|
<Button
|
||||||
|
color="error"
|
||||||
|
variant="contained"
|
||||||
|
>
|
||||||
{t('Delete account')}
|
{t('Delete account')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<Typography color="text.secondary" variant="body2">
|
<Typography
|
||||||
|
color="text.secondary"
|
||||||
|
variant="body2"
|
||||||
|
>
|
||||||
{t('a-deleted-customer-cannot-be-restored-all-data-will-be-permanently-removed')}
|
{t('a-deleted-customer-cannot-be-restored-all-data-will-be-permanently-removed')}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user