Compare commits

...

164 Commits

Author SHA1 Message Date
louiscklaw
3f13cc41bf ```update Enh 2025-05-24 08:51:32 +08:00
cb8643b405 ``update Add Docker build and deployment workflow for CMS and Ionic Mobile, update docker-compose.yml with new service images, and enhance documentation with strategy diagram and endpoint table`` 2025-05-24 08:21:33 +08:00
1157bf0fda ``update Update service address table formatting and placeholders for REQ0021`` 2025-05-24 08:15:44 +08:00
louiscklaw
2375c144a8 ``update Add build status message and server restart log in CMS entrypoint script`` 2025-05-24 06:11:33 +08:00
louiscklaw
24c62d940c ``update Migrate from custom Node image to official Node 22 image, install pnpm, update Dockerfile and entrypoint script`` 2025-05-24 06:02:46 +08:00
louiscklaw
e38e775fee ``update Simplify ENTRYPOINT syntax in PocketBase Dockerfile`` 2025-05-24 06:02:35 +08:00
louiscklaw
db9d3fbffd ``update Update port mappings for PocketBase, CMS, and Ionic Mobile services as per REQ0021`` 2025-05-24 05:48:45 +08:00
louiscklaw
368af36acd ``update Fix CPU resource limits format in docker-compose.db.yml and clean up dc.sh`` 2025-05-24 05:48:45 +08:00
d283b8274f update ticket, 2025-05-24 05:43:53 +08:00
7a8bd60185 update docker config, 2025-05-24 05:41:35 +08:00
a94ead44ba build cms ok, 2025-05-23 17:16:47 +08:00
50fc385c2b ``update Add todo-tree filter exclusions for node_modules, bundles, Next.js build folders, and distribution artifacts`` 2025-05-17 18:12:32 +08:00
91b3f53abe ``add Add database guidelines document outlining db driver structure and collection mappings`` 2025-05-17 18:12:19 +08:00
cf0ec8bd64 ``update Change logout behavior back to route navigation after sign-out instead of full page reload `` 2025-05-17 10:02:35 +00:00
59cdf7257b ```
update Implement standardized documentation for all database modules, including purpose, rules, and requirements for each CRUD operation; refactor existing comments to follow new documentation standard
```
2025-05-17 10:02:05 +00:00
b8309596be update example for ai, 2025-05-17 11:20:33 +08:00
688e102f2c ``delete Remove database schema definitions and hidden field count retrieval functionality`` 2025-05-17 09:41:36 +08:00
4d57d0a5f3 ``update Change logout behavior from route navigation to full page reload after sign-out `` 2025-05-16 23:41:22 +08:00
720838f137 Merge branch 'develop/ionic_mobile/i18n/trunk' into develop/ionic_mobile/login-flow/trunk 2025-05-16 23:38:56 +08:00
c92ac33ade ```
replace setting tab button with conditional rendering based on user authentication status, showing avatar if available
```
2025-05-16 23:37:39 +08:00
72e478937d ``update Add QR code generation feature with dynamic sizing and styling, implement screen-width-based conditional rendering, update i18n translations, and adjust context providers structure`` 2025-05-16 22:51:33 +08:00
62d8519da5 ``delete Remove i18n configuration file and English translation resources; likely replaced by a JSON-based or externalized translation management approach`` 2025-05-16 22:50:24 +08:00
8d746f3aa9 ``update Refactor navigation URLs by replacing hardcoded LESSON_LINK with Paths.LESSON_LINK across App, RouteConfig, and multiple components; remove redundant LESSON_LINK from constants`` 2025-05-16 22:00:04 +08:00
69b2ef59e5 ``update Upgrade dependencies including i18next, react-i18next, eslint, and testing-library; adjust peer dependencies and add new ESLint plugins`` 2025-05-16 21:59:52 +08:00
f9c0deb2e9 ``add Add CMS project code-workspace file to define multi-root workspace including documentation and AI workspace directories`` 2025-05-16 21:57:52 +08:00
47760fa7b2 ``add Add code-workspace files for documentation, ionic_mobile, and test projects to define multi-root workspace configurations`` 2025-05-16 21:57:41 +08:00
83bd86cc9b ``update Add .env.example file with PocketBase URL configuration for development environment `` 2025-05-16 17:47:33 +08:00
49189a532e ```
update Add development environment configuration, I18n support, route adjustments, and various hooks refactoring
```
2025-05-16 17:47:05 +08:00
6b917c9fb9 ``update Add error constant for empty PocketBase URL and validate it during app initialization `` 2025-05-16 15:56:56 +08:00
aa834a43c9 ``update Add platform-specific back button for Android, replace header layout, use LoadingSpinner, and refactor imports in Lesson page component`` 2025-05-16 15:56:46 +08:00
1775d8c5a3 ``update Remove unused components, imports, and refactor file URL generation in WordPage component`` 2025-05-16 15:56:24 +08:00
779062e247 ``update Replace getStudentAvatar with getStudentAvatarUrl for avatar URL generation in student profile`` 2025-05-16 15:56:19 +08:00
60df47fb8d ``update Extract PocketBase URL to constant and refactor related functions to use it for dynamic file URL generation`` 2025-05-16 15:55:47 +08:00
c87357ff24 ``update Remove unused import path suffix and comment out unused useRequireAuth hook`` 2025-05-16 15:55:30 +08:00
34a7ff7ac9 ``refactor Rename LoadingScreen component to LoadingSpinner and refactor structure for better reusability`` 2025-05-16 15:55:07 +08:00
3556e77a7c ```
add Implement custom sign-out functionality with loading state and error handling
```
2025-05-16 13:26:17 +08:00
57e25ef65f update fix eslint, 2025-05-16 12:51:32 +08:00
af5040ac6c update to use, 2025-05-16 12:07:58 +08:00
7264d643d0 remove unused code, 2025-05-16 11:51:11 +08:00
de47ceea0b ``update Add test section and GIF image to REQ0016 and REQ0020 documentation files`` 2025-05-16 11:16:29 +08:00
7295b46c06 ```
init Add default VS Code workspace configuration with current and test folders
```
2025-05-16 11:16:21 +08:00
471175d08d ``refactor Update tsconfig.json to include trailing comments in compilerOptions paths and exclude patterns `` 2025-05-16 11:16:10 +08:00
dae97f52ae ``refactor Update PocketBase URL in development environment to use local network IP address `` 2025-05-16 11:14:45 +08:00
6e16b2e87d ```
refactor Add sign-in form component with OAuth integration, Zod validation, i18n support, and password visibility toggle following REQ0016 requirements
```
2025-05-16 11:14:38 +08:00
2371e40ad2 init 003_test, 2025-05-16 11:13:50 +08:00
3e3e23aa68 ``refactor Update docker-compose configurations, adjust PocketBase Dockerfile, modify seed scripts to use 'state' instead of 'status', and fix paths in development scripts `` 2025-05-16 11:13:14 +08:00
a8b0a63648 ```refactor Add reset password form component with Zod validation, email input handling, and internationalization support for custom auth flow
```
2025-05-16 11:07:13 +08:00
bf059147c7 ``refactor Implement custom sign-up form component with Zod validation, OAuth integration, and i18n support following REQ0016 requirements`` 2025-05-16 11:03:58 +08:00
4b750b8146 ``refactor Add explicit type annotation to isDevelopment variable in check-is-development utility function`` 2025-05-16 11:03:05 +08:00
11b1d21472 ``refactor Update CMS site name from 'Devias Kit Pro' to 'demo cms' in configuration`` 2025-05-16 11:02:54 +08:00
3d38af8100 ``refactor Enhance error logging in UserProvider by including full error details in development environment for debugging purposes`` 2025-05-16 11:02:45 +08:00
c5eb7100ea ``refactor Standardize status/state naming across students, teachers, and user metas pages, update filters and tabs to use 'state' parameter consistently `` 2025-05-16 11:02:27 +08:00
louiscklaw
f44539bf63 ``refactor Update .gitignore to exclude files with 'old' suffix in any directory`` 2025-05-15 11:35:47 +08:00
louiscklaw
407f622f24 ``refactor Prettier config to add comment placeholder for potential future plugin additions `` 2025-05-15 11:35:40 +08:00
louiscklaw
7e2844dd74 ```
refactor Student and Teacher create/edit forms to implement i18n support, update UI components, and standardize API calls
```
2025-05-15 11:35:29 +08:00
louiscklaw
097918340c ```
refactor Teachers list page to remove outdated implementation, simplifying component structure and improving maintainability
```
2025-05-15 11:31:03 +08:00
louiscklaw
3620837a6a ``refactor UserMeta creation and authentication client to improve documentation and type consistency`` 2025-05-15 11:27:02 +08:00
louiscklaw
c83e8c1b6e ```
refactor Student and UserMeta type definitions to deprecate obsolete fields, standardize structure, and update billing address format
```
2025-05-15 11:13:15 +08:00
louiscklaw
af15a6bce0 ```
refactor Student type definitions to deprecate obsolete fields, standardize structure, and update billing address format
```
2025-05-15 11:12:56 +08:00
louiscklaw
d0215cf23f ```
refactor GetById APIs for Students, Teachers, and UserMetas to use consistent type definitions and expand parameters
```
2025-05-15 11:12:29 +08:00
louiscklaw
e523f80123 ```
refactor UserMeta type definitions to deprecate obsolete fields and standardize structure
```
2025-05-15 11:10:40 +08:00
louiscklaw
7f8f8824a7 ```
refactor getImageUrlFromFile to use Pocketbase records and correct path in teachers routes
```
2025-05-15 11:10:12 +08:00
louiscklaw
2aa96eec62 ```
refactor student and teacher APIs to use COL_USER_METAS collection, standardize role assignment, and update type definitions
```
2025-05-15 09:27:38 +08:00
louiscklaw
ecab41abbf `` fix GetUserById API to include requestKey option for Pocketbase compatibility `` 2025-05-15 09:27:20 +08:00
louiscklaw
5a1832ca89 ```
remove obsolete GetAllCount API and related guidelines from Users.old module
```
2025-05-15 09:27:08 +08:00
louiscklaw
160c93b83d `` refactor GetUserById function and add Create/UpdateUser APIs with type definitions `` 2025-05-15 09:26:36 +08:00
louiscklaw
d4fcc1dd8f ```
add UserActivationEditForm component for user activation management
```
2025-05-15 09:24:41 +08:00
louiscklaw
8e3d463f78 ```
use dynamic route parameter for user ID in UserActivationEditForm
```
2025-05-15 09:24:27 +08:00
louiscklaw
fbf79b040f `` remove placeholder _PROMPT.md file and reference to external draft for UserMeta editing page `` 2025-05-15 09:24:21 +08:00
louiscklaw
e34782844e ```
add user profile navigation logic and update button in SettingContainer
```
2025-05-15 09:19:59 +08:00
louiscklaw
ba8e9cca69 fix translation, 2025-05-15 08:35:33 +08:00
louiscklaw
cc9fe057c1 ```
add abbreviations section and clarify guideline reading requirement
```
2025-05-14 18:45:23 +08:00
louiscklaw
cdd95faa89 ```
add new student menu route and component, update login default values and redirect logic
```
2025-05-14 18:31:04 +08:00
louiscklaw
030fc1a808 update login requirement for mobile, 2025-05-14 18:13:15 +08:00
louiscklaw
05c69481b5 update check session working, 2025-05-14 18:10:22 +08:00
louiscklaw
0fcc194860 in the middle, working for login and logout test, 2025-05-14 17:19:48 +08:00
louiscklaw
56f0f30ffb ```
replace inline loading text with LoadingScreen component in multiple pages
```
2025-05-14 16:27:30 +08:00
louiscklaw
0aefbfaeae fix typo, 2025-05-14 16:25:57 +08:00
louiscklaw
628c72190b fix typo, 2025-05-14 16:18:39 +08:00
louiscklaw
886a314df7 update settings pages in the middle, 2025-05-14 16:18:04 +08:00
louiscklaw
efc2d31f7c ```
add new student info route and related components, update auth guard implementation and signup success redirect
```
2025-05-14 15:40:59 +08:00
louiscklaw
1938e95948 ```
use async/await for authClient.signInWithPassword to ensure proper execution order
```
2025-05-14 15:20:02 +08:00
louiscklaw
8d37fba393 update login flow, in the middle, 2025-05-14 15:17:04 +08:00
louiscklaw
af160edd42 ```
update .gitignore to add api_ts and dist directories to exclusion list
```
2025-05-14 15:16:21 +08:00
louiscklaw
d880420a28 ``add configuration files for CrossNote, VSCode extensions, and documentation for system architecture and design requirements`` 2025-05-14 15:15:45 +08:00
louiscklaw
5bebc1f40e ```
add COL_BILLING_ADDRESS constant and update exports
```
2025-05-13 13:28:21 +08:00
louiscklaw
f4e5f94e17 ``update .gitignore to modify exclusion pattern for _del files from '**/_del' to '**/*del'`` 2025-05-13 13:28:13 +08:00
louiscklaw
2d022cb613 ```
remove Docker Compose configuration files for CMS, Doc, Ionic Mobile, API_TS, and PocketBase services
```
2025-05-13 13:27:56 +08:00
louiscklaw
3560ea79fc "``update teacher and student seed scripts to dynamically loop through row_array and um_row_array instead of fixed iterations``" 2025-05-13 13:27:48 +08:00
louiscklaw
a441e3e52d ```
refactor teacher and user meta management UI by updating form components, replacing COL_TEACHERS with COL_USER_METAS where applicable, adding development environment checks, improving type definitions for user meta including billing address, and fixing parameter naming inconsistencies in form handlers
```
2025-05-13 13:27:41 +08:00
louiscklaw
09ded06dd2 ``update student database operations to use COL_USER_METAS instead of COL_STUDENTS, refactor getStudentById to include expanded billing address data, and add/update related types and functions for student and user meta management`` 2025-05-13 13:27:27 +08:00
louiscklaw
7ecacd0692 ```
refactor student management UI by updating create form component name and adding new edit page with translation support and form integration
```
2025-05-13 13:27:17 +08:00
louiscklaw
8a094afdd2 "``refactor student create and edit forms with translation support, update schema validation, and use new database operations for student management``" 2025-05-13 13:26:58 +08:00
louiscklaw
64ca29cf60 ``add new database operations for billing address module including create, delete, get, update functions and related type definitions`` 2025-05-13 13:26:41 +08:00
louiscklaw
1aa0502edc ``fix inconsistent quotes in code and update schema with additional fields and rules`` 2025-05-13 13:26:22 +08:00
louiscklaw
3e1f2e1057 ```
add billing address seed data and update user seed scripts with teacher and student roles
```
2025-05-13 12:35:05 +08:00
louiscklaw
9be33f641f ```
add 'visible', 'state', 'company', 'taxId', 'timezone', 'language', 'currency' fields and update 'billingAddress' and 't1' collection rules in PocketBase seed schema
```
2025-05-13 12:34:51 +08:00
louiscklaw
30e4c69343 ```
add Docker Compose configuration files for CMS, Doc, Ionic Mobile, API_TS, and PocketBase services, along with .env file for environment variables and related scripts
```
2025-05-13 06:58:49 +08:00
louiscklaw
04634b5c65 ``update backup script to change archive directory name and add script to recursively remove node_modules directories`` 2025-05-12 19:25:19 +08:00
louiscklaw
f659020d89 ``add TODO list file for Ionic mobile project`` 2025-05-12 19:24:45 +08:00
louiscklaw
184aaa1b0a ``fix HTML doctype declaration in index.html for Ionic mobile project`` 2025-05-12 19:24:39 +08:00
louiscklaw
a6170778cd ```
add new hooks for fetching QuizCRQuestions and categories, update related components to use the new hooks, and refactor SelectCategory page to use the new API
```
2025-05-12 19:24:25 +08:00
louiscklaw
650127821b ```
update nodemon config to fix watch path syntax and upgrade dependencies including sass, parcel watcher, and chokidar
```
2025-05-12 19:23:44 +08:00
louiscklaw
5440f8ea14 ``add .env to .gitignore and update ignore patterns for log, temp, and backup files`` 2025-05-12 19:23:22 +08:00
louiscklaw
f4c9dbcc34 ``add Helloworld component in Ionic mobile project`` 2025-05-12 19:23:00 +08:00
louiscklaw
f756fb8527 ``` "update tsconfig.json: adjust lib array format, simplify include syntax, and refine exclude patterns """ 2025-05-12 19:22:46 +08:00
louiscklaw
3f10a0728c ```
add authentication routes, components, and pages including AuthHome, Login, and SignUp, and implement form fields utility functions
```
2025-05-12 19:22:00 +08:00
louiscklaw
ee0aa0353b ``add development and backup scripts for Ionic mobile project, including dev script, rsync backup script, and express commit script`` 2025-05-12 19:19:39 +08:00
louiscklaw
2c7316786c ``update dc_dev.sh to remove commented logs command and adjust startup sequence for pocketbase and api_ts`` 2025-05-12 14:03:52 +08:00
louiscklaw
89f91ec2a0 ``update Notifications table schema by removing 'author' text field, adding 'author' relation, 'content', 'company', and 'link' fields, and sync changes in schema.dbml, schema.json, and pb_hooks/seed/schema.json`` 2025-05-12 14:03:35 +08:00
louiscklaw
1441863dcd ``remove obsolete UserMetas migrations and related user collection modifications`` 2025-05-12 14:01:52 +08:00
louiscklaw
1835caee68 ``update prettier config with printWidth and quoteProps, add new routes for connective revision, and update guidelines for hooks and types`` 2025-05-12 13:49:11 +08:00
louiscklaw
bac8c70d4b ``fix typos and update base URL quotes in code files`` 2025-05-12 13:48:32 +08:00
louiscklaw
975a528b49 `` update prettier config to enforce LF line endings and ES5 trailing commas `` 2025-05-12 13:29:40 +08:00
louiscklaw
749fef7e28 `` update prettier config for Ionic mobile with new endOfLine and trailingComma settings `` 2025-05-12 13:26:39 +08:00
louiscklaw
cf34833d42 init project-wise prettier config, 2025-05-12 13:22:43 +08:00
louiscklaw
7bb45316af update dependencies, 2025-05-12 13:21:28 +08:00
louiscklaw
02771185af ```
add ionic mobile workspace configuration with linked folders and git/port settings
```
2025-05-12 13:20:37 +08:00
louiscklaw
cf70e2af21 ```
refactor notifications popover to include unread count, mark all as read button, and loading state
```
2025-05-12 13:10:19 +08:00
louiscklaw
1a77c3a5e8 update helloworld template for component, 2025-05-12 11:34:06 +08:00
louiscklaw
af446aed59 update seed file, 2025-05-12 11:33:13 +08:00
louiscklaw
c7f1f544ec ```
refactor notifications popover to use new hooks and improve functionality
```
2025-05-12 11:32:53 +08:00
louiscklaw
99ee2f9fc3 ```
add admin user ID to seed config and update notification relations
```
2025-05-11 17:29:19 +08:00
louiscklaw
a4cdb4b1cc ```
add phone field to User model and update notification relations
```
2025-05-11 16:59:02 +08:00
louiscklaw
b35b77557e ```
enable prettier-plugin-sort-imports for consistent import ordering
```
2025-05-11 16:32:27 +08:00
louiscklaw
6842459499 ```
remove deprecated repomix.md file used for AI analysis
```
2025-05-11 16:32:01 +08:00
louiscklaw
ba7682e7cb "update tsconfig.json exclusion patterns for build optimization" 2025-05-11 16:31:50 +08:00
louiscklaw
1003fa699c "refactor settings pages, add translation support and implement side navigation component" 2025-05-11 16:31:32 +08:00
louiscklaw
ec12ca3bdf "make avatar mandatory and add collectionId to User interface" 2025-05-11 16:30:50 +08:00
louiscklaw
7ece1c814b update order of import, 2025-05-11 16:07:06 +08:00
louiscklaw
39a7d32fcd update, 2025-05-11 15:47:49 +08:00
louiscklaw
85d1ecdc90 update, 2025-05-11 15:44:18 +08:00
louiscklaw
b26e1ff167 update user-button, 2025-05-11 13:47:14 +08:00
louiscklaw
de415a37bc update main-nav and side-nav, 2025-05-11 13:39:33 +08:00
louiscklaw
01a8d2ca02 update main-nav, 2025-05-11 13:24:52 +08:00
louiscklaw
e5b136b8b5 update main-nav refactoring, working, 2025-05-11 13:06:58 +08:00
louiscklaw
031dbed6a9 "implement responsive main navigation bar with dropdown menus and mobile view support" 2025-05-11 13:00:30 +08:00
louiscklaw
f20dfa00c2 "add CMS workspace configuration with linked documentation and AI workspace folders" 2025-05-11 13:00:05 +08:00
louiscklaw
24c91cb6f0 "update gitignore to exclude temporary and backup files" 2025-05-11 10:48:45 +08:00
louiscklaw
abca91c26a "introduce horizontal main navigation component with dynamic styling and interactive elements" 2025-05-11 10:39:09 +08:00
louiscklaw
3321eafffa "update gitignore to exclude draft files" 2025-05-11 10:36:46 +08:00
louiscklaw
adc9275d3f "update prettier config, add TODO list, and create workspace configuration" 2025-05-11 10:35:04 +08:00
louiscklaw
60eed00cb2 "add admin user seed script and refactor common seed utilities" 2025-05-11 10:34:48 +08:00
louiscklaw
c29ab4b920 update project, 2025-05-11 08:02:50 +08:00
louiscklaw
9d46de56c3 update util scripts, 2025-05-11 08:02:07 +08:00
louiscklaw
3f9d88e733 init req0018, family photo of frameworks, 2025-05-11 08:00:31 +08:00
louiscklaw
6e576919ab init docker cofig, 2025-05-11 07:59:35 +08:00
louiscklaw
9739583f43 update ide config, remove yaml and python, 2025-05-11 07:59:11 +08:00
louiscklaw
bc1ec72df1 Update multiple markdown files with project guidelines, tasks, and database handling instructions 2025-05-11 07:57:34 +08:00
louiscklaw
e62dc5f597 "fix QuestionProgress component missing key props in button arrays," 2025-05-11 07:55:37 +08:00
louiscklaw
b5e9c8ba34 "update user popover with dynamic user metadata loading and improved UI consistency," 2025-05-11 07:55:16 +08:00
louiscklaw
9a8fd1c073 update auth guard and sign-in forms, add guidelines for custom auth to handle login and logout, 2025-05-11 07:54:23 +08:00
louiscklaw
25c1d3c917 update remove migration files in pocketbase, 2025-05-11 07:52:04 +08:00
louiscklaw
f435300740 update requirements, 2025-05-09 14:14:25 +08:00
louiscklaw
299567dd7c update requirements, 2025-05-09 14:14:00 +08:00
louiscklaw
fe1740d76f update user-meta, 2025-05-08 19:44:07 +08:00
louiscklaw
f840f02daf init draft from teacher collections, 2025-05-08 17:30:49 +08:00
louiscklaw
5640d4d4f6 update, 2025-05-08 17:19:43 +08:00
louiscklaw
7105bc85e3 update, 2025-05-08 14:38:34 +08:00
louiscklaw
61c10821b6 update, 2025-05-08 14:38:30 +08:00
louiscklaw
ea3f99654d update users, 2025-05-08 14:38:18 +08:00
louiscklaw
30f494fc35 update teachers, 2025-05-08 14:37:48 +08:00
louiscklaw
367e58a8cf update working on cms users page, 2025-05-06 17:45:25 +08:00
louiscklaw
99274b9c73 update fix typo, 2025-05-06 08:43:57 +08:00
775 changed files with 22321 additions and 42578 deletions

15
.crossnote/config.js Normal file
View File

@@ -0,0 +1,15 @@
({
katexConfig: {
"macros": {}
},
mathjaxConfig: {
"tex": {},
"options": {},
"loader": {}
},
mermaidConfig: {
"startOnLoad": false
},
})

19
.crossnote/head.html Normal file
View File

@@ -0,0 +1,19 @@
<!-- The content below will be included at the end of the <head> element. -->
<script type="text/javascript">
const configureMermaidIconPacks = () => {
window['mermaid'].registerIconPacks([
{
name: 'logos',
loader: () => fetch('https://unpkg.com/@iconify-json/logos/icons.json').then((res) => res.json()),
},
]);
};
if (document.readyState !== 'loading') {
configureMermaidIconPacks();
} else {
document.addEventListener('DOMContentLoaded', () => {
configureMermaidIconPacks();
});
}
</script>

12
.crossnote/parser.js Normal file
View File

@@ -0,0 +1,12 @@
({
// Please visit the URL below for more information:
// https://shd101wyy.github.io/markdown-preview-enhanced/#/extend-parser
onWillParseMarkdown: async function(markdown) {
return markdown;
},
onDidParseMarkdown: async function(html) {
return html;
},
})

8
.crossnote/style.less Normal file
View File

@@ -0,0 +1,8 @@
/* Please visit the URL below for more information: */
/* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
.markdown-preview.markdown-preview {
// modify your style here
// eg: background-color: blue;
}

9
.editorconfig Normal file
View 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
View File

@@ -0,0 +1 @@
* text=lf

11
.gitignore vendored
View File

@@ -1,9 +1,18 @@
# api_ts
dist
.next
node_modules
005_references/
_archive/
_del
*.bak
*.log
*.del
**/_del
**/*del
**/*old
**/volumes/**
006_lab
**/*.draft

10
.prettierrc Normal file
View File

@@ -0,0 +1,10 @@
{
"endOfLine": "lf",
"printWidth": 120,
"quoteProps": "consistent",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"plugins": []
}

15
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"recommendations": [
"christian-kohler.path-intellisense",
"esbenp.prettier-vscode",
"humao.rest-client",
//
"matt-meyers.vscode-dbml",
"aflalo.dbml-formatter",
"nicolas-liger.dbml-viewer",
//
"bierner.markdown-mermaid",
"yzhang.markdown-all-in-one",
"shd101wyy.markdown-preview-enhanced"
]
}

23
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,23 @@
{
"[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": "Mermaid Dark",
"editor.formatOnSave": true,
"git.ignoreLimitWarning": true,
//
"markdown.styles": ["https://use.fontawesome.com/releases/v5.7.1/css/all.css"]
}

View 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
---

View File

@@ -12,10 +12,15 @@ and i want to update it to my current `dbml` file (one way process for documenta
- 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/002_source/cms/src/db/schema.json`
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
@@ -23,5 +28,6 @@ dbml file: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/letter
1. 对于json中有但dbml中没有的表应该如何处理 添加为新表
1. 是否需要保留dbml文件中现有的注释和关系定义 完全保留
1. 字段类型映射是否有特殊规则? 沒有
1. please keep the existing comment
thanks

View File

@@ -0,0 +1,14 @@
```markdown
# Greetings
Hi,
Imagine 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
```

View File

@@ -0,0 +1,37 @@
# 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
- `001_documentation/Requirements/REQ0019/index.md` describes updated system architecture
- if the directory contains `_GUIDELINES.md`, please read it before operation
## Abbreviations
T.B.A.

View File

@@ -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)

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

View File

@@ -1,4 +1,4 @@
# AI GUIDELINE
# database and schemas
## getting started
@@ -16,29 +16,24 @@ they will:
## project background and initial setup
- No need to reply me what you are going on and your digest in this phase.
- **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
- 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`
- directory may contain `repomix-output.xml` file, that is a simple summary of all files inside the directory
- 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
- 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

View 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
---

View File

@@ -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

View File

@@ -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

View 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

View File

@@ -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)

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

View File

@@ -1,4 +1,4 @@
# AI GUIDELINE
# database and schemas
## getting started
@@ -23,19 +23,14 @@ they will:
- 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
- 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`
- 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
@@ -45,5 +40,9 @@ they will:
## frameworks documentation and samples
- `MUI`
- `<base_dir>/002_source/cms/src/components/widgets/forms` contains sample forms,
- react
- ionic and capacitor
- pocketbase
- tanstack/react-query
- vite
- typescript

View File

@@ -1,6 +1,5 @@
{
"recommendations": [
"redhat.vscode-yaml",
"yzhang.markdown-all-in-one",
"esbenp.prettier-vscode",
"ms-python.python",
@@ -8,7 +7,6 @@
"ms-python.debugpy",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.pylint",
"bierner.markdown-mermaid",
"shd101wyy.markdown-preview-enhanced",
"yzhang.markdown-all-in-one",

View File

@@ -24,5 +24,4 @@ mindmap
Tools
Pen and paper
Mermaid
```

View File

@@ -1,9 +1,27 @@
---
tags: mobile, lesson
tags: time
---
# lesson page documentation
# time tracking
it should have a lesson page
T.B.A.
![alt text](image.png)
```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)

View File

@@ -1,10 +1,12 @@
# task
update `dbml` from `schema.json`
update `dbml` from `schema.json`, for collection `billingAddress`
## things to note
## Background information
1. please skip `presentable` properties from `schema.json`
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
@@ -13,6 +15,6 @@ update `dbml` from `schema.json`
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.dbml` content based on `schema.json`.
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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

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

View 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!");

View File

@@ -0,0 +1,29 @@
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}`);

View 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"
]
]

View 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"
}
}
}
}

View File

@@ -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"
}
}

View 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': {}

View File

@@ -1,266 +1,476 @@
// Users table with auth fields
Table Users {
// system field
id text [pk]
tokenKey text [not null]
created datetime [default: `now()`]
updated datetime
password text [not null]
// Generated at: 2025-05-13T05:24:33.962Z
// value field
//
// collection id: pbc_3142635823
// collection name: _superusers
// collection type: auth
Table _superusers {
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
}
//
// collection id: _pb_users_auth_
// collection name: users
// 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
visible text
phone text
}
// LessonTypes stores different types of lessons
// lesson_types, lesson_type
Table LessonTypes {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // timestamp when the lesson type was created
updated datetime // timestamp when the lesson type was last updated
// value field
name text // changed from varchar to text
type text // changed from varchar to text
//
// collection id: pbc_1430376151
// collection name: Categories
// collection type: base
Table Categories {
id text [pk, not null]
cat_name text
cat_image_url text
cat_image file
pos integer
lesson_id integer [ref: > LessonsTypes.id] // relation3455582614
remarks text
visible text
created datetime
updated datetime
}
//
// 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
field date
}
// LessonCategories stores categories of lessons
// lesson_categories, lesson_category
Table LessonCategories {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // timestamp when the category was created
updated datetime // timestamp when the category was last updated
// value field
cat_name text // changed from varchar to text
cat_image_url text // new field
cat_image file // changed from varchar to file
pos integer
lesson_id integer [ref: > LessonTypes.id] // foreign key referencing LessonTypes.id
description text // new field
remarks text // changed from varchar to text
visible text // new field
}
Table Helloworlds {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // record create time
updated datetime // record update time
hello text // new field
}
Table UserMetas {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`]
created datetime
updated datetime
// value field
helloworld text // changed from varchar to text
meta json // new field
user_id text [ref: > Users.id] // changed type and reference
state text // new field
avatar file // changed from blob to file
role text // new field
field datetime
}
Table QuizCategories {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`]
//
// collection id: pbc_977978967
// collection name: Notifications
// collection type: base
Table Notifications {
id text [pk, not null]
read boolean
type text
job text
description text
NOTI_ID text
created datetime
updated datetime
// value field
cat_name text // changed from varchar to text
cat_image text // changed from varchar to text
init_answer json // new field
to_user_id integer [ref: > UserMetas.id] // relation704048736
from_user_id integer [ref: > UserMetas.id] // relation556806202
author integer [ref: > UserMetas.id] // relation3182418120
content text
company text
link varchar
}
// stores all questions of matching frenzy
Table QuizMatchings {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // record create time
updated datetime // record update time
// value field
word text // changed from varchar to text
word_c text // changed from varchar to text
cat_id text [ref: > QuizCategories.id] // changed type and reference
}
// QuizListening stores all listening quiz data
Table QuizListenings {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // record create time
updated datetime // record update time
// value field
sound file // changed from varchar to file
word text // changed from varchar to text
cat_id text [ref: > QuizCategories.id] // changed type and reference
}
// stores all categories of connectives revision quiz
Table QuizConnectivesCategories {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // record create time
updated datetime // record update time
// value field
cat_name text // changed from varchar to text
cat_image file // changed from varchar to file
}
// stores all questions of connectives revision quiz
Table QuizConnectives {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // record create time
updated datetime // record update time
// value field
question_fh text // changed from varchar to text
question_sh text // changed from varchar to text
modal_ans text // changed from varchar to text
cat_id text [ref: > QuizConnectivesCategories.id] // changed type and reference
}
// Lessons stores all lessons in the database
Table Vocabularies {
// system field
id text [pk] // changed from int to text
created datetime [default: `now()`] // timestamp when the lesson was created
updated datetime // timestamp when the lesson was last updated
// value field
image file // changed from varchar to file
sound file // changed from varchar to file
word text // changed from varchar to text
word_c text // changed from varchar to text
sample_e text // changed from varchar to text
sample_c text // changed from varchar to text
cat_id text [ref: > LessonCategories.id] // changed type and reference
category text // changed from varchar to text
lesson_type_id text [ref: > LessonTypes.id] // changed type and reference
}
// Listening Practice Quiz Categories
// store listening practice category, (LpCategories, LpCategory)
Table QuizLPCategories {
// system fields
id text [pk]
created datetime [default: `now()`]
updated datetime
// value fields
//
// collection id: pbc_4061499106
// collection name: QuizCRCategories
// collection type: base
Table QuizCRCategories {
id text [pk, not null]
cat_name text
cat_image file
pos number
init_answer json
pos integer
init_answer text
created datetime
updated datetime
}
//
// collection id: pbc_3141885671
// collection name: QuizCRQuestions
// collection type: base
Table QuizCRQuestions {
id text [pk, not null]
question_fh text
question_sh text
modal_ans text
cat_id integer [ref: > QuizCRCategories.id] // relation1827623476
options text
created datetime
updated datetime
init_answer text
}
//
// collection id: pbc_3571292172
// collection name: QuizCategories
// collection type: base
Table QuizCategories {
id text [pk, not null]
cat_name text
cat_image text
init_answer text
created datetime
updated datetime
}
//
// 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
visible text
created datetime
updated datetime
slug text
remarks text
description text
}
// Listening Practice Quiz Questions
//
// collection id: pbc_742947356
// collection name: QuizLPQuestions
// collection type: base
Table QuizLPQuestions {
id text [pk] // changed from int to text
created datetime [default: `now()`]
updated datetime
word text // changed from varchar to text
sound file // changed from blob to file
cat_id text [ref: > QuizLPCategories.id] // changed type and reference
cat_name text // new field
cat_image file // new field
pos number // new field
init_answer json // new field
visible text // new field
slug text // new field
remarks text // new field
description text // new field
}
// Matching Frenzy Quiz Categories
Table QuizMFCategories {
id text [pk] // changed from int to text
created datetime [default: `now()`]
updated datetime
cat_name text // changed from varchar to text
cat_image file // changed from blob to file
pos number // changed from integer to number
init_answer json
visible text // new field
}
// Matching Frenzy Quiz Questions
Table QuizMFQuestions {
id text [pk] // changed from int to text
created datetime [default: `now()`]
updated datetime
word text // changed from varchar to text
word_c text // changed from varchar to text
cat_id text [ref: > QuizMFCategories.id] // changed type and reference
visible text // new field
sound file // new field
cat_image file // new field
}
// Connectives Revision Quiz Categories
Table QuizCRCategories {
id text [pk] // changed from int to text
created datetime [default: `now()`]
updated datetime
cat_name text // changed from varchar to text
cat_image file // changed from blob to file
id text [pk, not null]
word text
sound file
cat_id integer [ref: > QuizLPCategories.id] // relation3870140739
cat_name text
cat_image file
pos integer
init_answer json
init_answer text
visible text
slug text
remarks text
description text
created datetime
updated datetime
}
// Connectives Revision Quiz Questions
Table QuizCRQuestions {
id text [pk] // changed from int to text
created datetime [default: `now()`]
//
// 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
question_fh text // changed from varchar to text
question_sh text // changed from varchar to text
modal_ans text // changed from varchar to text
cat_id text [ref: > QuizCRCategories.id] // changed type and reference
options json // new field
}
// Test table
Table t1 {
id text [pk] // changed from int to text
created datetime [default: `now()`]
//
// 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
visible text
created datetime
updated datetime
hello text // changed from name to hello
test_file file // new field
}
// Customers table
Table Customers {
id text [pk] // new table
created datetime [default: `now()`]
//
// 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 number
quota integer
status text
avatar_file file
cat_id text [ref: > QuizMFCategories.id] // refer to a single user in `Users` table
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]
address text
meta text
user_id integer [ref: > users.id] // relation2809058197
state text
created datetime
updated datetime
avatar file
role text
name text
email text
phone text
company text
taxId text
timezone text
language text
currency text
billingAddress integer [ref: > billingAddress.id] // relation2115670734
}
//
// 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
}

View File

@@ -1,215 +0,0 @@
// LessonTypes stores different types of lessons
// 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
id int [pk, increment] // id field, increment
created datetime [default: `now()`] // record create time
updated datetime // record update time
}
Table Users {
// system field
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
// value field
email varchar
emailVisibility boolean
verified boolean
name varchar
avatar blob
}
Table UserMetas {
// system field
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
// value field
helloworld varchar
app_on_time_s integer
user_id integer [ref: > Users.id]
}
Table QuizCategories {
// system field
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
// value field
cat_name varchar // category name
cat_image varchar // category image
}
// stores all questions of matching frenzy
Table QuizMatchings {
// system field
id int [pk, increment] // id field, increment
created datetime [default: `now()`] // record create time
updated datetime // record update time
// value field
word varchar // modal answer
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
init_answer json
}
// Matching Frenzy Quiz Questions
Table QuizMFQuestions {
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
word varchar
word_c varchar
cat_id integer [ref: > QuizMFCategories.id]
}
// Connectives Revision Quiz Categories
Table QuizCRCategories {
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
cat_name varchar
cat_image blob
pos integer
init_answer json
}
// Connectives Revision Quiz Questions
Table QuizCRQuestions {
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
question_fh varchar
question_sh varchar
modal_ans varchar
cat_id integer [ref: > QuizCRCategories.id]
}
// Test table
Table t1 {
id int [pk, increment]
created datetime [default: `now()`]
updated datetime
name varchar
}

View File

@@ -304,6 +304,34 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1146066909",
"max": 0,
"min": 0,
"name": "phone",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}
],
"indexes": [
@@ -1029,16 +1057,6 @@
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "json3182418120",
"maxSize": 0,
"name": "author",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json4225294584",
@@ -1096,6 +1114,77 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1305841361",
"hidden": false,
"id": "relation704048736",
"maxSelect": 1,
"minSelect": 0,
"name": "to_user_id",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1305841361",
"hidden": false,
"id": "relation556806202",
"maxSelect": 1,
"minSelect": 0,
"name": "from_user_id",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1305841361",
"hidden": false,
"id": "relation3182418120",
"maxSelect": 1,
"minSelect": 0,
"name": "author",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"convertURLs": false,
"hidden": false,
"id": "editor4274335913",
"maxSize": 0,
"name": "content",
"presentable": false,
"required": false,
"system": false,
"type": "editor"
},
{
"hidden": false,
"id": "json1337919823",
"maxSize": 0,
"name": "company",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"exceptDomains": null,
"hidden": false,
"id": "url917281265",
"name": "link",
"onlyDomains": null,
"presentable": false,
"required": false,
"system": false,
"type": "url"
}
],
"indexes": [],
@@ -1307,6 +1396,16 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "json227240121",
"maxSize": 0,
"name": "init_answer",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
@@ -1651,6 +1750,20 @@
"system": false,
"type": "json"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
@@ -1671,20 +1784,6 @@
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
@@ -1793,26 +1892,6 @@
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
@@ -1915,6 +1994,26 @@
"required": false,
"system": false,
"type": "editor"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [],
@@ -2083,6 +2182,20 @@
"system": false,
"type": "json"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
@@ -2102,20 +2215,6 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}
],
"indexes": [],
@@ -2247,6 +2346,16 @@
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "json3915970527",
"maxSize": 0,
"name": "init_answer",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
@@ -2761,7 +2870,7 @@
"id": "text4192936109",
"max": 0,
"min": 0,
"name": "helloworld",
"name": "address",
"pattern": "",
"presentable": false,
"primaryKey": false,
@@ -2792,6 +2901,20 @@
"system": false,
"type": "relation"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2744374011",
"max": 0,
"min": 0,
"name": "state",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
@@ -2812,20 +2935,6 @@
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2744374011",
"max": 0,
"min": 0,
"name": "state",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file376926767",
@@ -2853,6 +2962,128 @@
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"exceptDomains": null,
"hidden": false,
"id": "email3885137012",
"name": "email",
"onlyDomains": null,
"presentable": false,
"required": false,
"system": false,
"type": "email"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1146066909",
"max": 0,
"min": 0,
"name": "phone",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1337919823",
"max": 0,
"min": 0,
"name": "company",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2020362641",
"max": 0,
"min": 0,
"name": "taxId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text922858135",
"max": 0,
"min": 0,
"name": "timezone",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3571151285",
"max": 0,
"min": 0,
"name": "language",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1767278655",
"max": 0,
"min": 0,
"name": "currency",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1509025625",
"hidden": false,
"id": "relation2115670734",
"maxSelect": 999,
"minSelect": 0,
"name": "billingAddress",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}
],
"indexes": [],
@@ -3025,6 +3256,34 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2363381545",
"max": 0,
"min": 0,
"name": "type",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}
],
"indexes": [],
@@ -3428,11 +3687,11 @@
},
{
"id": "pbc_1509025625",
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "billingAddress",
"type": "base",
"fields": [
@@ -3622,11 +3881,11 @@
},
{
"id": "pbc_2109205374",
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "t1",
"type": "base",
"fields": [

View File

@@ -0,0 +1,11 @@
---
tags: cms
---
# cms dashboard
cms
## files
T.B.A.

View File

@@ -0,0 +1,11 @@
---
tags: mobile
---
# mobile client
mobile
## files
T.B.A.

View 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!");

View 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

View 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
}

View 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>"
}
}
]

View File

@@ -0,0 +1,39 @@
---
tags: cms, login-flow
---
# CMS 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))
```
## test
![alt text](test.gif)
## relation

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

@@ -0,0 +1,9 @@
---
tags: mobile, lesson
---
# lesson page documentation
it should have a lesson page
![alt text](image.png)

View File

@@ -0,0 +1,7 @@
---
tags: mobile, cms, db
---
# family photo of frameworks
it should have a family photo of used framework

View File

@@ -0,0 +1,43 @@
---
tags: architecture,mobile, cms, db
---
# System architecture
## Description
it should have a family photo of used framework
## Diagram
```mermaid {align="center"}
architecture-beta
group running_config(logos:aws-opsworks)[running_config]
service db(database)[pocketbase] in running_config
service tra1(internet)[incoming traffic 3000] in running_config
service cms(logos:nextjs)[next app] in running_config
service tra2(internet)[incoming traffic 5173] in running_config
service ionic(logos:ionic)[ionic app] in running_config
tra1:R --> L:cms
cms:R --> L:db
tra2:R --> L:ionic
ionic:R --> B:db
%% group planning(logos:aws-lambda)[planning]
%% service api_ts(logos:aws-lambda)[api_ts] in planning
%% service pg_db(logos:postgresql)[pg_db] in planning
%% ui:R --> L:api_ts
%% ionic:R --> L:api_ts
%% api_ts:B --> T:pg_db
%% service task_server(logos:aws-lambda)[task_server] in planning
%% api_ts:R --> L:task_server
%% service marketing(logos:wordpress-icon)[marketing] in planning
```

View File

@@ -0,0 +1,41 @@
---
tags: mobile, login-flow
---
# Mobile 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))
```
## test
![alt text](test.gif)
### relations
[REQ0016](../REQ0016/index.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,44 @@
---
tags: docker
---
# description
docker and public endpoint
## strategy
```mermaid
graph LR
A["next build"]
B["docker build"]
A --> B --> deploy --> run
```
1. build on develop machine
1. docker build on develop machine (include source code)
1. push image to production machine
1. run image to production machine
## endpoint table
| function | address | | status |
| -------- | ---------------------------------------------------------------------------- | ---- | ---------------------------------------------------- |
| DB | [https://demo_ls_db.louislabs.com](https://demo_ls_db.louislabs.com) | 3013 | ![](https://status.iamon99.com/api/badge/108/uptime) |
| cms | [https://demo_ls_cms.louislabs.com](https://demo_ls_cms.louislabs.com) | 3011 | ![](https://status.iamon99.com/api/badge/109/uptime) |
| mobile | [https://demo_ls_mobile.louislabs.com](https://demo_ls_mobile.louislabs.com) | 3012 | ![](https://status.iamon99.com/api/badge/110/uptime) |
| T.B.A. | T.B.A. | 3014 | |
| T.B.A. | T.B.A. | 3015 | |
| T.B.A. | T.B.A. | 3016 | |
| T.B.A. | T.B.A. | 3017 | |
| T.B.A. | T.B.A. | 3018 | |
| T.B.A. | T.B.A. | 3019 | |
| T.B.A. | T.B.A. | 3010 | |
## status panel
[https://status.iamon99.com/status/demo-ls](https://status.iamon99.com/status/demo-ls)
## TODO
pending separated ssl certificate, currently using shared affine.louislabs.com

View File

@@ -1,50 +1,25 @@
# Requirements Index
## REQ0001: project overview
[View Requirement](./REQ0001/index.md)
## REQ0002: lesson page documentation
[View Requirement](./REQ0002/index.md)
## REQ0003: quiz page documentation
[View Requirement](./REQ0003/index.md)
## REQ0004: record page documentation
[View Requirement](./REQ0004/index.md)
## REQ0005: settings page documentation
[View Requirement](./REQ0005/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)
- [REQ0001: project overview](./REQ0001/index.md)
- [REQ0002: time tracking](./REQ0002/index.md)
- [REQ0003: quiz page documentation](./REQ0003/index.md)
- [REQ0004: record page documentation](./REQ0004/index.md)
- [REQ0005: settings page documentation](./REQ0005/index.md)
- [REQ0006: task](./REQ0006/008_update_dbml_from_json.md)
- [REQ0006: GUIDELINES](./REQ0006/_GUIDELINE.md)
- [REQ0006: db schema design](./REQ0006/index.md)
- [REQ0007: testing of mobile app home](./REQ0007/index.md)
- [REQ0008: schema design](./REQ0008/index.md)
- [REQ0009: loading screen](./REQ0009/index.md)
- [REQ0010: user friendly error messages](./REQ0010/index.md)
- [REQ0011: developer friendly error messages](./REQ0011/index.md)
- [REQ0012: cms navigation system](./REQ0012/index.md)
- [REQ0013: cms dashboard](./REQ0013/index.md)
- [REQ0014: mobile client](./REQ0014/index.md)
- [REQ0015: pocketbase json schema to dbml converter](./REQ0015/index.md)
- [REQ0016: CMS login flow](./REQ0016/index.md)
- [REQ0017: lesson page documentation](./REQ0017/index.md)
- [REQ0018: family photo of frameworks](./REQ0018/index.md)
- [REQ0019: System architecture](./REQ0019/index.md)
- [REQ0020: Mobile login flow](./REQ0020/index.md)
- [REQ0021: description](./REQ0021/index.md)

View 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"

View File

@@ -36,8 +36,8 @@ async function updateIndex() {
const heading = extractH1(content);
if (heading) {
indexContent += `## ${dir}: ${heading}\n\n`;
indexContent += `[View Requirement](./${dir}/${file})\n\n`;
indexContent += `- [${dir}: ${heading}](./${dir}/${file})\n`;
// indexContent += `[View Requirement](./${dir}/${file})\n\n`;
}
}
}

View File

@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "."
},
{
"path": "../003_test"
}
],
"settings": {}
}

14
002_source/.env Normal file
View 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

6
002_source/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
**/*.del
**/*.log
**/_archive
**/_del
**/*copy*

74
002_source/README.md Normal file
View 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

View File

@@ -0,0 +1,40 @@
# Ignore all files and directories by default
-
# Except for the following:
!.dockerignore
!.gitignore
!.env.example
!.git/
!.env
!.vscode/
!.idea/
# Node.js specific
node_modules/
# Build artifacts
dist/
build/
# Logs
logs/
\*.log
# Environment files
.env\*
# Cache files
\*.cache
# OS generated files
.DS_Store
Thumbs.db

View File

@@ -58,4 +58,4 @@ NEXT_PUBLIC_MAPBOX_API_KEY=
# Google Tag Manager
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=
NEXT_PUBLIC_POCKETBASE_URL=http://localhost:8090
NEXT_PUBLIC_POCKETBASE_URL=http://192.168.222.199:8090

View File

@@ -82,7 +82,14 @@ module.exports = {
'eslintreact/jsx-sort-props': 'off',
'react/jsx-sort-props': 'off',
},
ignorePatterns: ['**/*del', '**/*bak', '**/*copy.*', '**/*copy*.*'],
ignorePatterns: [
'**/*.del',
'**/*.bak',
'**/*copy.*',
'**/*copy*.*',
'**/*draft*/**',
//
],
overrides: [
{
// override to ignore no-def for `describe`, `it`, and `expect`

View File

@@ -1,3 +1,10 @@
**/*del
**/*bak
**/*log
**/*tmp
.pnpm-store
.env
.env.production

17
002_source/cms/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
# Use official Node 18 base image
FROM node:22-slim
# Install pnpm globally
RUN npm install -g pnpm
# Copy your application code (optional, comment out if not needed)
COPY . /app
RUN cd /app && pnpm i
RUN cd /app && pnpm run build
# Set working directory
WORKDIR /app
# Default command (optional)
CMD ["./scripts/docker/entrypoint.sh"]

View File

@@ -1,9 +1,12 @@
# TODO
need to fix local storage error
page right (next page) button is not working
in the middle of clone lesson type to lesson category
- [ ] listing page
- [ ] delete button on each row
- [ ] create page
- [ ] edit
- [ ] delete
- [ ] listing page
- [ ] delete button on each row
- [ ] create page
- [ ] edit
- [ ] delete

View File

@@ -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

View File

@@ -1,52 +0,0 @@
---
description: Next.js with TypeScript and Tailwind UI best practices
globs: **/*.tsx, **/*.ts, src/**/*.ts, src/**/*.tsx
---
# Next.js Best Practices
## Project Structure
- Use the App Router directory structure
- Place components in `app` directory for route-specific components
- Place shared components in `components` directory
- Place utilities and helpers in `lib` directory
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`)
## Components
- Use Server Components by default
- Mark client components explicitly with 'use client'
- Wrap client components in Suspense with fallback
- Use dynamic loading for non-critical components
- Implement proper error boundaries
- Place static content and interfaces at file end
## Performance
- Optimize images: Use WebP format, size data, lazy loading
- Minimize use of 'useEffect' and 'setState'
- Favor Server Components (RSC) where possible
- Use dynamic loading for non-critical components
- Implement proper caching strategies
## Data Fetching
- Use Server Components for data fetching when possible
- Implement proper error handling for data fetching
- Use appropriate caching strategies
- Handle loading and error states appropriately
## Routing
- Use the App Router conventions
- Implement proper loading and error states for routes
- Use dynamic routes appropriately
- Handle parallel routes when needed
## Forms and Validation
- Use Zod for form validation
- Implement proper server-side validation
- Handle form errors appropriately
- Show loading states during form submission
## State Management
- Minimize client-side state
- Use React Context sparingly
- Prefer server state when possible
- Implement proper loading states

View File

@@ -1,20 +0,0 @@
# task
update app page to cover `vocabulary`
## steps
1. read `tsx` from folder: `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/app/dashboard/vocabularies.draft`
1. fix the paths, variable, function names, class etc from `lesson-categories` to `vocabularies`.
thanks
## FAQ
1.`constants.ts` 中是否已定义 `COL_VOCABULARIES` 常量?没有,需要先定义它。
2. Vocabulary 相关的类型定义在哪里?是在现有文件中还是需要新建? 需要新建
3. 是否需要保留原始 `lessonCategories` 驱动文件? 不需要
- `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/app/dashboard/vocabularies.draft`
- `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/vocabulary.draft`

View File

@@ -1,57 +0,0 @@
---
description: TypeScript coding standards and best practices for modern web development
globs: **/*.ts, **/*.tsx, **/*.d.ts
---
# TypeScript Best Practices
## Type System
- Prefer interfaces over types for object definitions
- Use type for unions, intersections, and mapped types
- Avoid using `any`, prefer `unknown` for unknown types
- Use strict TypeScript configuration
- Leverage TypeScript's built-in utility types
- Use generics for reusable type patterns
## Naming Conventions
- Use PascalCase for type names and interfaces
- Use camelCase for variables and functions
- Use UPPER_CASE for constants
- Use descriptive names with auxiliary verbs (e.g., isLoading, hasError)
- Prefix interfaces for React props with 'Props' (e.g., ButtonProps)
## Code Organization
- Keep type definitions close to where they're used
- Export types and interfaces from dedicated type files when shared
- Use barrel exports (index.ts) for organizing exports
- Place shared types in a `types` directory
- Co-locate component props with their components
## Functions
- Use explicit return types for public functions
- Use arrow functions for callbacks and methods
- Implement proper error handling with custom error types
- Use function overloads for complex type scenarios
- Prefer async/await over Promises
## Best Practices
- Enable strict mode in tsconfig.json
- Use readonly for immutable properties
- Leverage discriminated unions for type safety
- Use type guards for runtime type checking
- Implement proper null checking
- Avoid type assertions unless necessary
## Error Handling
- Create custom error types for domain-specific errors
- Use Result types for operations that can fail
- Implement proper error boundaries
- Use try-catch blocks with typed catch clauses
- Handle Promise rejections properly
## Patterns
- Use the Builder pattern for complex object creation
- Implement the Repository pattern for data access
- Use the Factory pattern for object creation
- Leverage dependency injection
- Use the Module pattern for encapsulation

View File

@@ -1,13 +0,0 @@
---
tags: update-constants-file
---
# task
update constants file
## steps
- have a look to `_constants.ts` files in slibing directory
- get the convention
- update `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/vocabulary/_constants.ts` according to dbml thanks

View File

@@ -1,13 +0,0 @@
---
tags: review-function-names
---
# task
review function names
## steps
- have a look to `tsx` files in slibing directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Vocabularies`
- get the convention
- update the function name of `tsx` file in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Vocabularies`

View File

@@ -1,22 +0,0 @@
Hi, i need your help.
i am working on a nextjs react typescript project
please read the code in directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizLPQuestions` (denoted `QuizLPQuestions`)
i want you to:
- list files from directory `QuizLPQuestions` and use them as template
- understand the relations (e.g. `lp` -> `lp_categories`, `lp` -> `COL_QUIZ_LP_CATEGORIES`)
- review if any remaining `lp` or `mf` exist in `cr` directory and please help to do replace it to `cr`. (e.g. `COL_QUIZ_LP_CATEGORIES` -> `COL_QUIZ_CR_CATEGORIES` )
- please create if you find any missing files/codes/constants
- using template, create the similar code for `cr` named `QuizCRCategories`
thank you
---
- I proofed the code is working already, what you need to do is refactoring of the `variables`, `functions`, `classes`, `constants` (`lp` -> `cr`)
- compare the difference between `lp` and `mf`,
- remember the differences and
- draft the new type `cr` (e.g. modify the `import` locations, variables, functions, classes, constants name etc.)

View File

@@ -1,22 +0,0 @@
Hi, i need your help.
i am working on a nextjs react typescript project
please read the code in directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizLPCategories` (denoted `QuizLPCategories`)
i want you to:
- list files from directory `QuizLPCategories` and use them as template
- understand the relations (e.g. `lp` -> `lp_categories`, `lp` -> `COL_QUIZ_LP_CATEGORIES`)
- review if any remaining `lp` or `mf` exist in `cr` directory and please help to do replace it to `cr`. (e.g. `COL_QUIZ_LP_CATEGORIES` -> `COL_QUIZ_CR_CATEGORIES` )
- please create if you find any missing files/codes/constants
- using template, create the similar code for `cr` named `QuizCRCategories`
thank you
---
- I proofed the code is working already, what you need to do is refactoring of the `variables`, `functions`, `classes`, `constants` (`lp` -> `cr`)
- compare the difference between `lp` and `mf`,
- remember the differences and
- draft the new type `cr` (e.g. modify the `import` locations, variables, functions, classes, constants name etc.)

View File

@@ -1,22 +0,0 @@
Hi, i need your help.
i am working on a nextjs react typescript project
please read the code in directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizLPQuestions` (denoted `QuizLPQuestions`)
i want you to:
- list files from directory `QuizLPQuestions` and use them as template
- understand the relations (e.g. `lp` -> `lp_Questions`, `lp` -> `COL_QUIZ_LP_QUESTIONS`)
- review if any remaining `lp` or `mf` exist in `cr` directory and please help to do replace it to `cr`. (e.g. `COL_QUIZ_LP_QUESTIONS` -> `COL_QUIZ_CR_Questions` )
- please create if you find any missing files/codes/constants
- using template, create the similar code for `customer` named `Customers`
thank you
---
- I proofed the code is working already, what you need to do is refactoring of the `variables`, `functions`, `classes`, `constants` (`lp` -> `cr`)
- compare the difference between `lp` and `mf`,
- remember the differences and
- draft the new type `cr` (e.g. modify the `import` locations, variables, functions, classes, constants name etc.)

View File

@@ -1,37 +0,0 @@
---
tags: db, driver
---
# clone db driver
please understand the tsx files in folder
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/vocabularies.draft`
change all occurrence of `lessonCategories` to `vocabularies` thanks.
## FAQ
1.`constants.ts` 中是否已定义 `COL_VOCABULARIES` 常量?没有,需要先定义它。
2. Vocabulary 相关的类型定义在哪里?是在现有文件中还是需要新建? 需要新建
3. 是否需要保留原始 `lessonCategories` 驱动文件? 不需要
请确认这些信息,以便我制定完整的修改方案。
当前已确认需要修改的内容包括:
函数名中的customer → notification
COL_CUSTOMERS → COL_NOTIFICATIONS
相关类型引用
注释中的customer → notification
---
<!-- updat type.d -->
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Notifications/type.d.ts` the fields is currently wrong, please help to update thanks.
update the `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Notifications/EmptyNotification.ts` as well thanks.
---
please draft `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Notifications/GetNotificationByUserId.tsx` by reference `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Notifications/GetById.tsx`

View File

@@ -1,10 +0,0 @@
# task
extend function by clone and updating exist code
## steps
please read file
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizListenings/GetAllCount.tsx`
duplicate it to cover `GetActiveCount`, `GetPendingCount` and `GetBlockedCount`. create them in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Customers` directory thanks.

View File

@@ -1,108 +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`
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
this is file in dbml syntax state the main database
- read `<base_dir>/002_source/cms/src/db/schema.json`
this is the file of live pocketbase schema output
- read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/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_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 take a look in `schema.dbml` and `schema.json`,
associate the collection from json file to the table in dbml file
please modify the `schema.dbml` to align with `schema.json`
to the collection `QuizLPCategories` align the dbml file in the previous prompt
---
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

View File

@@ -1,66 +0,0 @@
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

View File

@@ -1,38 +0,0 @@
# AI GUIDELINE
## getting started
Imagine there is a
1. software developer and a
2. QA engineer
3. technical writer
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` 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
- 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`
- directory may contain `repomix-output.xml` file, that is a simple summary of all files inside the directory
- read, remember and link up the ideas in file stated above,
i will tell them the task afterwards

View File

@@ -1,15 +0,0 @@
Hi, i need your help.
## background
i am working on a nextjs react typescript project
## task
i want you to summarize the code, write it to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/categories/_PROMPT.md`
## steps
1. list all `tsx` files from directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/categories`
2. take a look to the `tsx` file listed. try to understand what's going on (e.g. it is a component for `cr-categories`, it is a table)
3. write your result to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/categories/_PROMPT.md`

View File

@@ -1,17 +0,0 @@
Hi, i need your help.
## background
i am working on a nextjs react typescript project
## task
i want you to summarize the code, write it to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/questions/_SUMMARY.md`
## steps
1. list all `tsx` files from directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/questions`
2. read every `tsx` files listed. try to understand what's going on (e.g. it is a component for `cr-questions`, it is a table)
3. read file `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/questions/_SUMMARY.md`.
4. make use of `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/questions/_SUMMARY.md` as template, update the content and create a new summary
5. write your new summary to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/questions/_SUMMARY.md`

View File

@@ -1,17 +0,0 @@
Hi, i need your help.
## background
i am working on a nextjs react typescript project
## task
i want you to summarize the code, write it to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/categories/_SUMMARY.md`
## steps
1. list all `tsx` files from directory `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/categories`
2. read every `tsx` files listed. try to understand what's going on (e.g. it is a component for `cr-categories`, it is a table)
3. read file `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/categories/_SUMMARY.md`.
4. make use of `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/cr/categories/_SUMMARY.md` as template, update the content and create a new summary
5. write your new summary to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/components/dashboard/lp/categories/_SUMMARY.md`

View File

@@ -1,66 +0,0 @@
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

View File

@@ -1 +0,0 @@
please read, understand and remember `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/_AI_WORKSPACE/code`

View File

@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "."
},
{
"path": "./../../001_documentation"
},
{
"path": "../../000_AI_WORKSPACE"
}
],
"settings": {}
}

View File

@@ -4,13 +4,16 @@
"version": "7.0.0",
"private": true,
"engines": {
"node": ">=18"
"node": "==22"
},
"scripts": {
"dev": "next dev",
"dev": "next dev -H 0.0.0.0",
"build": "next build",
"build:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 15 --exec \"pnpm run build\"",
"start": "next start",
"docker:push": "docker push 192.168.10.61:5000/demo_ls_cms ",
"docker:build": "docker build -t 192.168.10.61:5000/demo_ls_cms .",
"build:docker": "pnpm run build && pnpm run docker:build && pnpm run docker:push",
"start": "next start -H 0.0.0.0",
"lint": "next lint --quiet",
"lint:fix": "next lint --fix",
"lint:w": "pnpx nodemon --ext ts,tsx,json,mjs,js,jsx --delay 5 --exec \"pnpm run lint\"",
@@ -117,4 +120,4 @@
"protobufjs"
]
}
}
}

View File

@@ -29,7 +29,8 @@ const config = {
'^[./]',
],
plugins: [
// '@ianvs/prettier-plugin-sort-imports'
'@ianvs/prettier-plugin-sort-imports',
//
],
overrides: [
{

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38c0-.27.01-1.13.01-2.2c0-.75-.25-1.23-.54-1.48c1.78-.2 3.65-.88 3.65-3.95c0-.88-.31-1.59-.82-2.15c.08-.2.36-1.02-.08-2.12c0 0-.67-.22-2.2.82c-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82c-.44 1.1-.16 1.92-.08 2.12c-.51.56-.82 1.28-.82 2.15c0 3.06 1.86 3.75 3.64 3.95c-.23.2-.44.55-.51 1.07c-.46.21-1.61.55-2.33-.66c-.15-.24-.6-.83-1.23-.82c-.67.01-.27.38.01.53c.34.19.73.9.82 1.13c.16.45.68 1.31 2.69.94c0 .67.01 1.3.01 1.49c0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/></svg>

After

Width:  |  Height:  |  Size: 695 B

Some files were not shown because too many files have changed in this diff Show More