From cdccf7d72e4bf028c75e58667ebc429226781a53 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 26 Dec 2025 13:54:12 +0000 Subject: [PATCH] Initial version --- .cursorrules | 305 ++ .dockerignore | 3 + .gitignore | 3 + 502.html | 187 + Dockerfile | 12 + Dockerfile.dev | 85 + LICENSE | 1 + README.md | 146 + app-shell/.eslintrc.cjs | 26 + app-shell/.prettierrc | 11 + app-shell/.sequelizerc | 7 + app-shell/Dockerfile | 23 + app-shell/README.md | 13 + app-shell/package.json | 43 + app-shell/src/_schema.json | 7 + app-shell/src/config.js | 18 + app-shell/src/helpers.js | 23 + app-shell/src/index.js | 54 + .../src/middlewares/check-permissions.js | 17 + app-shell/src/middlewares/modify-path.js | 8 + app-shell/src/routes/executor.js | 346 ++ app-shell/src/routes/vcs.js | 40 + app-shell/src/services/database.js | 88 + app-shell/src/services/executor.js | 1206 +++++ .../notifications/errors/forbidden.js | 16 + .../notifications/errors/validation.js | 16 + .../src/services/notifications/helpers.js | 30 + app-shell/src/services/notifications/list.js | 100 + app-shell/src/services/project-events.js | 67 + app-shell/src/services/screenshot_service.js | 83 + app-shell/src/services/vcs.js | 1205 +++++ app-shell/yarn.lock | 3044 +++++++++++ backend/.env | 14 + backend/.prettierrc | 11 + backend/.sequelizerc | 7 + backend/Dockerfile | 23 + backend/README.md | 56 + backend/package.json | 53 + backend/src/auth/auth.js | 68 + backend/src/config.js | 77 + backend/src/db/api/file.js | 87 + backend/src/db/api/permissions.js | 329 ++ backend/src/db/api/roles.js | 399 ++ backend/src/db/api/users.js | 927 ++++ backend/src/db/db.config.js | 33 + backend/src/db/migrations/1704722142.js | 539 ++ backend/src/db/models/file.js | 53 + backend/src/db/models/index.js | 38 + backend/src/db/models/permissions.js | 68 + backend/src/db/models/roles.js | 101 + backend/src/db/models/users.js | 226 + backend/src/db/reset.js | 16 + .../db/seeders/20200430130759-admin-user.js | 66 + .../db/seeders/20200430130760-user-roles.js | 130 + .../db/seeders/20231127130745-sample-data.js | 135 + backend/src/db/utils.js | 27 + backend/src/helpers.js | 23 + backend/src/index.js | 132 + backend/src/middlewares/check-permissions.js | 149 + backend/src/middlewares/upload.js | 11 + backend/src/routes/auth.js | 207 + backend/src/routes/contactForm.js | 0 backend/src/routes/file.js | 32 + backend/src/routes/openai.js | 251 + backend/src/routes/organizationLogin.js | 2 + backend/src/routes/permissions.js | 429 ++ backend/src/routes/pexels.js | 104 + backend/src/routes/roles.js | 429 ++ backend/src/routes/search.js | 52 + backend/src/routes/users.js | 440 ++ backend/src/services/auth.js | 312 ++ .../emailAddressVerification.html | 52 + .../invitation/invitationTemplate.html | 55 + .../passwordReset/passwordResetEmail.html | 52 + backend/src/services/email/index.js | 41 + .../email/list/addressVerification.js | 38 + backend/src/services/email/list/invitation.js | 37 + .../src/services/email/list/passwordReset.js | 38 + backend/src/services/file.js | 213 + .../notifications/errors/forbidden.js | 17 + .../notifications/errors/validation.js | 18 + backend/src/services/notifications/helpers.js | 35 + backend/src/services/notifications/list.js | 104 + backend/src/services/openai.js | 67 + backend/src/services/permissions.js | 138 + backend/src/services/roles.js | 437 ++ backend/src/services/search.js | 142 + backend/src/services/users.js | 171 + backend/watcher.js | 45 + backend/yarn.lock | 4470 +++++++++++++++++ docker/.gitignore | 1 + docker/README.md | 46 + docker/docker-compose.yml | 56 + docker/start-backend.sh | 2 + docker/wait-for-it.sh | 182 + frontend/.eslintrc.cjs | 10 + frontend/.gitignore | 33 + frontend/.prettierrc | 10 + frontend/Dockerfile | 19 + frontend/LICENSE-justboil | 21 + frontend/README.md | 92 + frontend/next-env.d.ts | 6 + frontend/next.config.mjs | 32 + frontend/package.json | 77 + frontend/postcss.config.js | 9 + frontend/prettier.config.js | 13 + frontend/public/data-sources/clients.json | 1 + frontend/public/data-sources/history.json | 1 + frontend/public/favicon.svg | 27 + frontend/public/locales/de/common.json | 55 + frontend/public/locales/en/common.json | 52 + frontend/public/locales/es/common.json | 55 + frontend/public/locales/fr/common.json | 55 + frontend/src/colors.ts | 138 + frontend/src/components/AsideMenu.tsx | 30 + frontend/src/components/AsideMenuItem.tsx | 102 + frontend/src/components/AsideMenuLayer.tsx | 63 + frontend/src/components/AsideMenuList.tsx | 35 + frontend/src/components/BaseButton.tsx | 96 + frontend/src/components/BaseButtons.tsx | 38 + frontend/src/components/BaseDivider.tsx | 14 + frontend/src/components/BaseIcon.tsx | 32 + frontend/src/components/BigCalendar.tsx | 175 + frontend/src/components/CardBox.tsx | 64 + .../src/components/CardBoxComponentBody.tsx | 12 + .../src/components/CardBoxComponentEmpty.tsx | 11 + .../src/components/CardBoxComponentFooter.tsx | 10 + .../src/components/CardBoxComponentTitle.tsx | 17 + frontend/src/components/CardBoxModal.tsx | 59 + .../src/components/ChartLineSample/config.ts | 54 + .../src/components/ChartLineSample/index.tsx | 37 + frontend/src/components/ClickOutside.tsx | 35 + .../src/components/DataGridMultiSelect.tsx | 55 + frontend/src/components/DevModeBadge.tsx | 150 + .../src/components/DragDropFilePicker.tsx | 124 + frontend/src/components/ErrorBoundary.tsx | 218 + frontend/src/components/FooterBar.tsx | 37 + frontend/src/components/FormCheckRadio.tsx | 20 + .../src/components/FormCheckRadioGroup.tsx | 20 + frontend/src/components/FormField.tsx | 80 + frontend/src/components/FormFilePicker.tsx | 92 + frontend/src/components/FormImagePicker.tsx | 90 + frontend/src/components/IconRounded.tsx | 34 + frontend/src/components/ImageField.tsx | 51 + frontend/src/components/IntroGuide.tsx | 55 + .../components/KanbanBoard/KanbanBoard.tsx | 51 + .../src/components/KanbanBoard/KanbanCard.tsx | 64 + .../components/KanbanBoard/KanbanColumn.tsx | 209 + frontend/src/components/LanguageSwitcher.tsx | 100 + .../src/components/ListActionsPopover.tsx | 115 + frontend/src/components/LoadingSpinner.tsx | 18 + frontend/src/components/Logo/index.tsx | 15 + frontend/src/components/NavBar.tsx | 57 + frontend/src/components/NavBarItem.tsx | 132 + frontend/src/components/NavBarItemPlain.tsx | 30 + frontend/src/components/NavBarMenuList.tsx | 19 + frontend/src/components/NotificationBar.tsx | 57 + frontend/src/components/OverlayLayer.tsx | 41 + frontend/src/components/Pagination.tsx | 85 + .../src/components/PasswordSetOrReset.tsx | 113 + .../Permissions/CardPermissions.tsx | 111 + .../Permissions/ListPermissions.tsx | 88 + .../Permissions/TablePermissions.tsx | 463 ++ .../Permissions/configurePermissionsCols.tsx | 83 + frontend/src/components/RichTextField.tsx | 44 + frontend/src/components/Roles/CardRoles.tsx | 123 + frontend/src/components/Roles/ListRoles.tsx | 96 + frontend/src/components/Roles/TableRoles.tsx | 463 ++ .../components/Roles/configureRolesCols.tsx | 103 + frontend/src/components/Search.tsx | 52 + frontend/src/components/SearchResults.tsx | 83 + frontend/src/components/SectionFullScreen.tsx | 27 + frontend/src/components/SectionMain.tsx | 10 + frontend/src/components/SectionTitle.tsx | 27 + .../components/SectionTitleLineWithButton.tsx | 29 + frontend/src/components/SelectField.tsx | 53 + frontend/src/components/SelectFieldMany.tsx | 67 + .../components/SmartWidget/SmartWidget.tsx | 99 + .../SmartWidget/components/AreaChart.tsx | 18 + .../components/AreaChart/ApexAreaChart.tsx | 135 + .../components/AreaChart/ChartJSAreaChart.tsx | 96 + .../SmartWidget/components/BarChart.tsx | 18 + .../components/BarChart/ApexBarChart.tsx | 131 + .../components/BarChart/ChartJSBarChart.tsx | 92 + .../SmartWidget/components/FunnelChart.tsx | 134 + .../SmartWidget/components/LineChart.tsx | 18 + .../components/LineChart/ApexLineChart.tsx | 135 + .../components/LineChart/ChartJSLineChart.tsx | 97 + .../SmartWidget/components/PieChart.tsx | 18 + .../components/PieChart/ApexPieChart.tsx | 106 + .../components/PieChart/ChartJSPieChart.tsx | 81 + .../SmartWidget/models/widget.model.ts | 35 + .../components/SmartWidget/widgetHelpers.tsx | 36 + frontend/src/components/SwitchField.tsx | 22 + .../src/components/TableSampleClients.tsx | 141 + .../src/components/Uploaders/FilesUploader.js | 150 + .../components/Uploaders/ImagesUploader.js | 237 + .../src/components/Uploaders/UploadService.js | 79 + frontend/src/components/UserAvatar.tsx | 46 + .../src/components/UserAvatarCurrentUser.tsx | 43 + frontend/src/components/UserCard.tsx | 49 + frontend/src/components/Users/CardUsers.tsx | 208 + frontend/src/components/Users/ListUsers.tsx | 155 + frontend/src/components/Users/TableUsers.tsx | 463 ++ .../components/Users/configureUsersCols.tsx | 207 + .../components/WidgetCreator/RoleSelect.tsx | 53 + .../WidgetCreator/WidgetCreator.tsx | 142 + frontend/src/config.ts | 15 + frontend/src/css/_app.css | 32 + frontend/src/css/_calendar.css | 39 + frontend/src/css/_checkbox-radio-switch.css | 59 + frontend/src/css/_helper.css | 23 + frontend/src/css/_progress.css | 21 + frontend/src/css/_rich-text.css | 1 + frontend/src/css/_scrollbars.css | 41 + frontend/src/css/_select-dropdown.css | 31 + frontend/src/css/_table.css | 117 + frontend/src/css/_theme.css | 103 + frontend/src/css/main.css | 35 + frontend/src/css/tailwind/_base.css | 1 + frontend/src/css/tailwind/_components.css | 1 + frontend/src/css/tailwind/_utilities.css | 1 + frontend/src/helpers/dataFormatter.js | 86 + frontend/src/helpers/fileSaver.ts | 6 + frontend/src/helpers/humanize.ts | 11 + frontend/src/helpers/notifyStateHandler.ts | 31 + frontend/src/helpers/pexels.ts | 76 + frontend/src/helpers/userPermissions.ts | 18 + frontend/src/hooks/sampleData.ts | 22 + frontend/src/hooks/useDevCompilationStatus.ts | 44 + frontend/src/i18n.ts | 21 + frontend/src/interfaces/index.ts | 109 + frontend/src/layouts/Authenticated.tsx | 129 + frontend/src/layouts/Guest.tsx | 17 + frontend/src/menuAside.ts | 51 + frontend/src/menuNavBar.ts | 53 + frontend/src/pages/_app.tsx | 173 + frontend/src/pages/api/hello.js | 5 + frontend/src/pages/api/logError.ts | 83 + frontend/src/pages/dashboard.tsx | 238 + frontend/src/pages/error.tsx | 35 + frontend/src/pages/forgot.tsx | 82 + frontend/src/pages/forms.tsx | 142 + frontend/src/pages/index.tsx | 173 + frontend/src/pages/login.tsx | 278 + frontend/src/pages/password-reset.tsx | 12 + .../src/pages/permissions/[permissionsId].tsx | 187 + .../pages/permissions/permissions-edit.tsx | 184 + .../pages/permissions/permissions-list.tsx | 162 + .../src/pages/permissions/permissions-new.tsx | 143 + .../pages/permissions/permissions-table.tsx | 160 + .../pages/permissions/permissions-view.tsx | 120 + frontend/src/pages/privacy-policy.tsx | 292 ++ frontend/src/pages/profile.tsx | 180 + frontend/src/pages/register.tsx | 92 + frontend/src/pages/roles/[rolesId].tsx | 262 + frontend/src/pages/roles/roles-edit.tsx | 259 + frontend/src/pages/roles/roles-list.tsx | 162 + frontend/src/pages/roles/roles-new.tsx | 195 + frontend/src/pages/roles/roles-table.tsx | 160 + frontend/src/pages/roles/roles-view.tsx | 283 ++ frontend/src/pages/search.tsx | 91 + frontend/src/pages/tables.tsx | 33 + frontend/src/pages/terms-of-use.tsx | 206 + frontend/src/pages/users/[usersId].tsx | 682 +++ frontend/src/pages/users/users-edit.tsx | 679 +++ frontend/src/pages/users/users-list.tsx | 166 + frontend/src/pages/users/users-new.tsx | 502 ++ frontend/src/pages/users/users-table.tsx | 164 + frontend/src/pages/users/users-view.tsx | 407 ++ frontend/src/pages/verify-email.tsx | 62 + frontend/src/stores/authSlice.ts | 124 + frontend/src/stores/hooks.ts | 6 + frontend/src/stores/introSteps.ts | 139 + frontend/src/stores/mainSlice.ts | 36 + frontend/src/stores/openAiSlice.ts | 115 + .../stores/permissions/permissionsSlice.ts | 231 + frontend/src/stores/roles/rolesSlice.ts | 280 ++ frontend/src/stores/store.ts | 27 + frontend/src/stores/styleSlice.ts | 103 + frontend/src/stores/users/usersSlice.ts | 231 + frontend/src/stores/usersSlice.ts | 117 + frontend/src/styles.ts | 107 + frontend/tailwind.config.js | 110 + frontend/tsconfig.json | 30 + frontend/yarn.lock | 3608 +++++++++++++ nginx.conf | 96 + package.json | 8 + 288 files changed, 42250 insertions(+) create mode 100644 .cursorrules create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 502.html create mode 100644 Dockerfile create mode 100644 Dockerfile.dev create mode 100644 LICENSE create mode 100644 README.md create mode 100644 app-shell/.eslintrc.cjs create mode 100644 app-shell/.prettierrc create mode 100644 app-shell/.sequelizerc create mode 100644 app-shell/Dockerfile create mode 100644 app-shell/README.md create mode 100644 app-shell/package.json create mode 100644 app-shell/src/_schema.json create mode 100644 app-shell/src/config.js create mode 100644 app-shell/src/helpers.js create mode 100644 app-shell/src/index.js create mode 100644 app-shell/src/middlewares/check-permissions.js create mode 100644 app-shell/src/middlewares/modify-path.js create mode 100644 app-shell/src/routes/executor.js create mode 100644 app-shell/src/routes/vcs.js create mode 100644 app-shell/src/services/database.js create mode 100644 app-shell/src/services/executor.js create mode 100644 app-shell/src/services/notifications/errors/forbidden.js create mode 100644 app-shell/src/services/notifications/errors/validation.js create mode 100644 app-shell/src/services/notifications/helpers.js create mode 100644 app-shell/src/services/notifications/list.js create mode 100644 app-shell/src/services/project-events.js create mode 100644 app-shell/src/services/screenshot_service.js create mode 100644 app-shell/src/services/vcs.js create mode 100644 app-shell/yarn.lock create mode 100644 backend/.env create mode 100644 backend/.prettierrc create mode 100644 backend/.sequelizerc create mode 100644 backend/Dockerfile create mode 100644 backend/README.md create mode 100644 backend/package.json create mode 100644 backend/src/auth/auth.js create mode 100644 backend/src/config.js create mode 100644 backend/src/db/api/file.js create mode 100644 backend/src/db/api/permissions.js create mode 100644 backend/src/db/api/roles.js create mode 100644 backend/src/db/api/users.js create mode 100644 backend/src/db/db.config.js create mode 100644 backend/src/db/migrations/1704722142.js create mode 100644 backend/src/db/models/file.js create mode 100644 backend/src/db/models/index.js create mode 100644 backend/src/db/models/permissions.js create mode 100644 backend/src/db/models/roles.js create mode 100644 backend/src/db/models/users.js create mode 100644 backend/src/db/reset.js create mode 100644 backend/src/db/seeders/20200430130759-admin-user.js create mode 100644 backend/src/db/seeders/20200430130760-user-roles.js create mode 100644 backend/src/db/seeders/20231127130745-sample-data.js create mode 100644 backend/src/db/utils.js create mode 100644 backend/src/helpers.js create mode 100644 backend/src/index.js create mode 100644 backend/src/middlewares/check-permissions.js create mode 100644 backend/src/middlewares/upload.js create mode 100644 backend/src/routes/auth.js create mode 100644 backend/src/routes/contactForm.js create mode 100644 backend/src/routes/file.js create mode 100644 backend/src/routes/openai.js create mode 100644 backend/src/routes/organizationLogin.js create mode 100644 backend/src/routes/permissions.js create mode 100644 backend/src/routes/pexels.js create mode 100644 backend/src/routes/roles.js create mode 100644 backend/src/routes/search.js create mode 100644 backend/src/routes/users.js create mode 100644 backend/src/services/auth.js create mode 100644 backend/src/services/email/htmlTemplates/addressVerification/emailAddressVerification.html create mode 100644 backend/src/services/email/htmlTemplates/invitation/invitationTemplate.html create mode 100644 backend/src/services/email/htmlTemplates/passwordReset/passwordResetEmail.html create mode 100644 backend/src/services/email/index.js create mode 100644 backend/src/services/email/list/addressVerification.js create mode 100644 backend/src/services/email/list/invitation.js create mode 100644 backend/src/services/email/list/passwordReset.js create mode 100644 backend/src/services/file.js create mode 100644 backend/src/services/notifications/errors/forbidden.js create mode 100644 backend/src/services/notifications/errors/validation.js create mode 100644 backend/src/services/notifications/helpers.js create mode 100644 backend/src/services/notifications/list.js create mode 100644 backend/src/services/openai.js create mode 100644 backend/src/services/permissions.js create mode 100644 backend/src/services/roles.js create mode 100644 backend/src/services/search.js create mode 100644 backend/src/services/users.js create mode 100644 backend/watcher.js create mode 100644 backend/yarn.lock create mode 100644 docker/.gitignore create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml create mode 100644 docker/start-backend.sh create mode 100644 docker/wait-for-it.sh create mode 100644 frontend/.eslintrc.cjs create mode 100644 frontend/.gitignore create mode 100644 frontend/.prettierrc create mode 100644 frontend/Dockerfile create mode 100644 frontend/LICENSE-justboil create mode 100644 frontend/README.md create mode 100644 frontend/next-env.d.ts create mode 100644 frontend/next.config.mjs create mode 100644 frontend/package.json create mode 100644 frontend/postcss.config.js create mode 100644 frontend/prettier.config.js create mode 100644 frontend/public/data-sources/clients.json create mode 100644 frontend/public/data-sources/history.json create mode 100644 frontend/public/favicon.svg create mode 100644 frontend/public/locales/de/common.json create mode 100644 frontend/public/locales/en/common.json create mode 100644 frontend/public/locales/es/common.json create mode 100644 frontend/public/locales/fr/common.json create mode 100644 frontend/src/colors.ts create mode 100644 frontend/src/components/AsideMenu.tsx create mode 100644 frontend/src/components/AsideMenuItem.tsx create mode 100644 frontend/src/components/AsideMenuLayer.tsx create mode 100644 frontend/src/components/AsideMenuList.tsx create mode 100644 frontend/src/components/BaseButton.tsx create mode 100644 frontend/src/components/BaseButtons.tsx create mode 100644 frontend/src/components/BaseDivider.tsx create mode 100644 frontend/src/components/BaseIcon.tsx create mode 100644 frontend/src/components/BigCalendar.tsx create mode 100644 frontend/src/components/CardBox.tsx create mode 100644 frontend/src/components/CardBoxComponentBody.tsx create mode 100644 frontend/src/components/CardBoxComponentEmpty.tsx create mode 100644 frontend/src/components/CardBoxComponentFooter.tsx create mode 100644 frontend/src/components/CardBoxComponentTitle.tsx create mode 100644 frontend/src/components/CardBoxModal.tsx create mode 100644 frontend/src/components/ChartLineSample/config.ts create mode 100644 frontend/src/components/ChartLineSample/index.tsx create mode 100644 frontend/src/components/ClickOutside.tsx create mode 100644 frontend/src/components/DataGridMultiSelect.tsx create mode 100644 frontend/src/components/DevModeBadge.tsx create mode 100644 frontend/src/components/DragDropFilePicker.tsx create mode 100644 frontend/src/components/ErrorBoundary.tsx create mode 100644 frontend/src/components/FooterBar.tsx create mode 100644 frontend/src/components/FormCheckRadio.tsx create mode 100644 frontend/src/components/FormCheckRadioGroup.tsx create mode 100644 frontend/src/components/FormField.tsx create mode 100644 frontend/src/components/FormFilePicker.tsx create mode 100644 frontend/src/components/FormImagePicker.tsx create mode 100644 frontend/src/components/IconRounded.tsx create mode 100644 frontend/src/components/ImageField.tsx create mode 100644 frontend/src/components/IntroGuide.tsx create mode 100644 frontend/src/components/KanbanBoard/KanbanBoard.tsx create mode 100644 frontend/src/components/KanbanBoard/KanbanCard.tsx create mode 100644 frontend/src/components/KanbanBoard/KanbanColumn.tsx create mode 100644 frontend/src/components/LanguageSwitcher.tsx create mode 100644 frontend/src/components/ListActionsPopover.tsx create mode 100644 frontend/src/components/LoadingSpinner.tsx create mode 100644 frontend/src/components/Logo/index.tsx create mode 100644 frontend/src/components/NavBar.tsx create mode 100644 frontend/src/components/NavBarItem.tsx create mode 100644 frontend/src/components/NavBarItemPlain.tsx create mode 100644 frontend/src/components/NavBarMenuList.tsx create mode 100644 frontend/src/components/NotificationBar.tsx create mode 100644 frontend/src/components/OverlayLayer.tsx create mode 100644 frontend/src/components/Pagination.tsx create mode 100644 frontend/src/components/PasswordSetOrReset.tsx create mode 100644 frontend/src/components/Permissions/CardPermissions.tsx create mode 100644 frontend/src/components/Permissions/ListPermissions.tsx create mode 100644 frontend/src/components/Permissions/TablePermissions.tsx create mode 100644 frontend/src/components/Permissions/configurePermissionsCols.tsx create mode 100644 frontend/src/components/RichTextField.tsx create mode 100644 frontend/src/components/Roles/CardRoles.tsx create mode 100644 frontend/src/components/Roles/ListRoles.tsx create mode 100644 frontend/src/components/Roles/TableRoles.tsx create mode 100644 frontend/src/components/Roles/configureRolesCols.tsx create mode 100644 frontend/src/components/Search.tsx create mode 100644 frontend/src/components/SearchResults.tsx create mode 100644 frontend/src/components/SectionFullScreen.tsx create mode 100644 frontend/src/components/SectionMain.tsx create mode 100644 frontend/src/components/SectionTitle.tsx create mode 100644 frontend/src/components/SectionTitleLineWithButton.tsx create mode 100644 frontend/src/components/SelectField.tsx create mode 100644 frontend/src/components/SelectFieldMany.tsx create mode 100644 frontend/src/components/SmartWidget/SmartWidget.tsx create mode 100644 frontend/src/components/SmartWidget/components/AreaChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/AreaChart/ApexAreaChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/AreaChart/ChartJSAreaChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/BarChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/BarChart/ApexBarChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/BarChart/ChartJSBarChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/FunnelChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/LineChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/LineChart/ApexLineChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/LineChart/ChartJSLineChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/PieChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/PieChart/ApexPieChart.tsx create mode 100644 frontend/src/components/SmartWidget/components/PieChart/ChartJSPieChart.tsx create mode 100644 frontend/src/components/SmartWidget/models/widget.model.ts create mode 100644 frontend/src/components/SmartWidget/widgetHelpers.tsx create mode 100644 frontend/src/components/SwitchField.tsx create mode 100644 frontend/src/components/TableSampleClients.tsx create mode 100644 frontend/src/components/Uploaders/FilesUploader.js create mode 100644 frontend/src/components/Uploaders/ImagesUploader.js create mode 100644 frontend/src/components/Uploaders/UploadService.js create mode 100644 frontend/src/components/UserAvatar.tsx create mode 100644 frontend/src/components/UserAvatarCurrentUser.tsx create mode 100644 frontend/src/components/UserCard.tsx create mode 100644 frontend/src/components/Users/CardUsers.tsx create mode 100644 frontend/src/components/Users/ListUsers.tsx create mode 100644 frontend/src/components/Users/TableUsers.tsx create mode 100644 frontend/src/components/Users/configureUsersCols.tsx create mode 100644 frontend/src/components/WidgetCreator/RoleSelect.tsx create mode 100644 frontend/src/components/WidgetCreator/WidgetCreator.tsx create mode 100644 frontend/src/config.ts create mode 100644 frontend/src/css/_app.css create mode 100644 frontend/src/css/_calendar.css create mode 100644 frontend/src/css/_checkbox-radio-switch.css create mode 100644 frontend/src/css/_helper.css create mode 100644 frontend/src/css/_progress.css create mode 100644 frontend/src/css/_rich-text.css create mode 100644 frontend/src/css/_scrollbars.css create mode 100644 frontend/src/css/_select-dropdown.css create mode 100644 frontend/src/css/_table.css create mode 100644 frontend/src/css/_theme.css create mode 100644 frontend/src/css/main.css create mode 100644 frontend/src/css/tailwind/_base.css create mode 100644 frontend/src/css/tailwind/_components.css create mode 100644 frontend/src/css/tailwind/_utilities.css create mode 100644 frontend/src/helpers/dataFormatter.js create mode 100644 frontend/src/helpers/fileSaver.ts create mode 100644 frontend/src/helpers/humanize.ts create mode 100644 frontend/src/helpers/notifyStateHandler.ts create mode 100644 frontend/src/helpers/pexels.ts create mode 100644 frontend/src/helpers/userPermissions.ts create mode 100644 frontend/src/hooks/sampleData.ts create mode 100644 frontend/src/hooks/useDevCompilationStatus.ts create mode 100644 frontend/src/i18n.ts create mode 100644 frontend/src/interfaces/index.ts create mode 100644 frontend/src/layouts/Authenticated.tsx create mode 100644 frontend/src/layouts/Guest.tsx create mode 100644 frontend/src/menuAside.ts create mode 100644 frontend/src/menuNavBar.ts create mode 100644 frontend/src/pages/_app.tsx create mode 100644 frontend/src/pages/api/hello.js create mode 100644 frontend/src/pages/api/logError.ts create mode 100644 frontend/src/pages/dashboard.tsx create mode 100644 frontend/src/pages/error.tsx create mode 100644 frontend/src/pages/forgot.tsx create mode 100644 frontend/src/pages/forms.tsx create mode 100644 frontend/src/pages/index.tsx create mode 100644 frontend/src/pages/login.tsx create mode 100644 frontend/src/pages/password-reset.tsx create mode 100644 frontend/src/pages/permissions/[permissionsId].tsx create mode 100644 frontend/src/pages/permissions/permissions-edit.tsx create mode 100644 frontend/src/pages/permissions/permissions-list.tsx create mode 100644 frontend/src/pages/permissions/permissions-new.tsx create mode 100644 frontend/src/pages/permissions/permissions-table.tsx create mode 100644 frontend/src/pages/permissions/permissions-view.tsx create mode 100644 frontend/src/pages/privacy-policy.tsx create mode 100644 frontend/src/pages/profile.tsx create mode 100644 frontend/src/pages/register.tsx create mode 100644 frontend/src/pages/roles/[rolesId].tsx create mode 100644 frontend/src/pages/roles/roles-edit.tsx create mode 100644 frontend/src/pages/roles/roles-list.tsx create mode 100644 frontend/src/pages/roles/roles-new.tsx create mode 100644 frontend/src/pages/roles/roles-table.tsx create mode 100644 frontend/src/pages/roles/roles-view.tsx create mode 100644 frontend/src/pages/search.tsx create mode 100644 frontend/src/pages/tables.tsx create mode 100644 frontend/src/pages/terms-of-use.tsx create mode 100644 frontend/src/pages/users/[usersId].tsx create mode 100644 frontend/src/pages/users/users-edit.tsx create mode 100644 frontend/src/pages/users/users-list.tsx create mode 100644 frontend/src/pages/users/users-new.tsx create mode 100644 frontend/src/pages/users/users-table.tsx create mode 100644 frontend/src/pages/users/users-view.tsx create mode 100644 frontend/src/pages/verify-email.tsx create mode 100644 frontend/src/stores/authSlice.ts create mode 100644 frontend/src/stores/hooks.ts create mode 100644 frontend/src/stores/introSteps.ts create mode 100644 frontend/src/stores/mainSlice.ts create mode 100644 frontend/src/stores/openAiSlice.ts create mode 100644 frontend/src/stores/permissions/permissionsSlice.ts create mode 100644 frontend/src/stores/roles/rolesSlice.ts create mode 100644 frontend/src/stores/store.ts create mode 100644 frontend/src/stores/styleSlice.ts create mode 100644 frontend/src/stores/users/usersSlice.ts create mode 100644 frontend/src/stores/usersSlice.ts create mode 100644 frontend/src/styles.ts create mode 100644 frontend/tailwind.config.js create mode 100644 frontend/tsconfig.json create mode 100644 frontend/yarn.lock create mode 100644 nginx.conf create mode 100644 package.json diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..496b86f --- /dev/null +++ b/.cursorrules @@ -0,0 +1,305 @@ +# Cursor Rules - Group 1: Development Philosophy & Coding Conventions +1. Overall Architecture & Structure: + - Enforce a clear separation of concerns between the backend and the frontend: + - **Backend**: Use Express for routing, Passport for authentication, and Swagger for API documentation. Organize code into modules such as routes, services, and helpers. + - **Example**: + - Routes: `src/routes/auth.js` for authentication routes. + - Services: `src/services/auth.js` for authentication logic. + - Helpers: `src/helpers/wrapAsync.js` for wrapping asynchronous functions. + - **Frontend**: Use Next.js with React and TypeScript. Structure components using functional components, hooks, and layouts. + - **Example**: + - Pages: `pages/index.tsx` for the main page. + - Components: `components/Header.tsx` for the header component. + - Layouts: `layouts/MainLayout.tsx` for common page layouts. + - Ensure that backend modules and frontend components are organized for reusability and maintainability: + - **Backend**: Separate business logic into services and use middleware for common tasks. + - **Frontend**: Use reusable components and hooks to manage state and lifecycle. + +2. Coding Style & Formatting: + - For the backend (JavaScript): + • Use ES6+ features (const/let, arrow functions) consistently. + • Follow Prettier and ESLint configurations (e.g., consistent 2-space indentation, semicolons, and single quotes). + • Maintain clear asynchronous patterns with helper wrappers (e.g., wrapAsync). + - **Example from auth.js**: + ```javascript + router.post('/signin/local', wrapAsync(async (req, res) => { + const payload = await AuthService.signin(req.body.email, req.body.password, req); + res.status(200).send(payload); + })); + ``` + • Document API endpoints with inline Swagger comments to ensure API clarity and consistency. + - **Example**: + ```javascript + /** + * @swagger + * /api/auth/signin: + * post: + * summary: Sign in a user + * responses: + * 200: + * description: Successful login + */ + ``` + - For the frontend (TypeScript/React): + • Use functional components with strict typing and separation of concerns. + - **Example**: + ```typescript + const Button: React.FC<{ onClick: () => void }> = ({ onClick }) => ( + + ); + ``` + • Follow naming conventions: PascalCase for components and types/interfaces, camelCase for variables, hooks, and function names. + - **Example**: + ```typescript + const useCustomHook = () => { + const [state, setState] = useState(false); + return [state, setState]; + }; + ``` + • Utilize hooks (useEffect, useState) to manage state and lifecycle in a clear and concise manner. + - **Example**: + ```typescript + useEffect(() => { + console.log('Component mounted'); + }, []); + ``` + +3. Code Quality & Best Practices: + - Ensure code modularity by splitting complex logic into smaller, testable units. + - **Example**: In `auth.js`, routes are separated from business logic, which is handled in `AuthService`. + - Write self-documenting code and add comments where the logic is non-trivial. + - **Example**: Use descriptive function and variable names in `auth.js`, and add comments for complex asynchronous operations. + - Embrace declarative programming and adhere to SOLID principles. + - **Example**: In service functions, ensure each function has a single responsibility and dependencies are injected rather than hardcoded. + +4. Consistency & Tools Integration: + - Leverage existing tools like Prettier and ESLint to automatically enforce style and formatting rules. + - **Example**: Use `.prettierrc` and `.eslintrc.cjs` for configuration in your project. + - Use TypeScript in the frontend to ensure type safety and catch errors early. + - **Example**: Define interfaces and types in your React components to enforce strict typing. + - Maintain uniformity in API design and error handling strategies. + - **Example**: Consistently use Passport for authentication and a common error handling middleware in `auth.js`. + +## Group 2 – Naming Conventions +1. File Naming and Structure: + • Frontend: + - Page Files: Use lower-case filenames (e.g., index.tsx) as prescribed by Next.js conventions. + - **Example**: `pages/index.tsx`, `pages/about.tsx` + - Component Files: Use PascalCase for React component files (e.g., WebSiteHeader.tsx, NavBar.tsx). + - **Example**: `components/Header.tsx`, `components/Footer.tsx` + - Directories: Use clear, descriptive names (e.g., 'pages', 'components', 'WebPageComponents'). + - **Example**: `src/pages`, `src/components` + • Backend: + - Use lower-case filenames for modules (e.g., index.js, auth.js, projects.js). + - **Example**: `routes/auth.js`, `services/user.js` + - When needed, use hyphenation for clarity, but maintain consistency. + - **Example**: `helpers/wrap-async.js` + +2. Component and Module Naming: + • Frontend: + - React Components: Define components in PascalCase. + - TypeScript Interfaces/Types: Use PascalCase (e.g., WebSiteHeaderProps). + • Backend: + - Classes (if any) and constructors should be in PascalCase; most helper functions and modules use camelCase. + +3. Variable, Function, and Hook Naming: + • Use camelCase for variables and function names in both frontend and backend. + - **Example**: + ```javascript + const userName = 'John Doe'; + function handleLogin() { ... } + ``` + • Custom Hooks: Prefix with 'use' (e.g., useAuth, useForm). + - **Example**: + ```typescript + const useAuth = () => { + const [isAuthenticated, setIsAuthenticated] = useState(false); + return { isAuthenticated, setIsAuthenticated }; + }; + ``` + +4. Consistency and Readability: + • Maintain uniform naming across the project to ensure clarity and ease of maintenance. + - **Example**: Use consistent naming conventions for variables, functions, and components, such as camelCase for variables and functions, and PascalCase for components. + - **Example**: In `auth.js`, ensure that all function names clearly describe their purpose, such as `handleLogin` or `validateUserInput`. + +## Group 3 – Frontend & React Best Practices +1. Use of Functional Components & TypeScript: + • Build all components as functional components. + - **Example**: + ```typescript + const Header: React.FC = () => { + return
Header Content
; + }; + ``` + • Leverage TypeScript for static type checking and enforce strict prop and state types. + - **Example**: + ```typescript + interface ButtonProps { + onClick: () => void; + } + const Button: React.FC = ({ onClick }) => ( + + ); + ``` + +2. Effective Use of React Hooks: + • Utilize useState and useEffect appropriately with proper dependency arrays. + - **Example**: + ```typescript + const [count, setCount] = useState(0); + useEffect(() => { + console.log('Component mounted'); + }, []); + ``` + • Create custom hooks to encapsulate shared logic (e.g., useAppSelector). + - **Example**: + ```typescript + const useAuth = () => { + const [isAuthenticated, setIsAuthenticated] = useState(false); + return { isAuthenticated, setIsAuthenticated }; + }; + ``` + +3. Component Composition & Separation of Concerns: + • Separate presentational (stateless) components from container components managing logic. + - **Example**: Use `LayoutGuest` to encapsulate common page structures. + +4. Code Quality & Readability: + • Maintain consistent formatting and adhere to Prettier and ESLint rules. + • Use descriptive names for variables, functions, and components. + • Document non-trivial logic with inline comments and consider implementing error boundaries where needed. + • New code must adhere to these conventions to avoid ambiguity. + • Use descriptive names that reflect the purpose and domain, avoiding abbreviations unless standard in the project. + +## Group 4 – Backend & API Guidelines +1. API Endpoint Design & Documentation: + • Follow RESTful naming conventions; all route handlers should be named clearly and consistently. + - **Example**: Use verbs like `GET`, `POST`, `PUT`, `DELETE` to define actions, e.g., `GET /api/auth/me` to retrieve user info. + • Document endpoints with Swagger annotations to provide descriptions, expected request bodies, and response codes. + - **Example**: + ```javascript + /** + * @swagger + * /api/auth/signin: + * post: + * summary: Sign in a user + * requestBody: + * description: User credentials + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/Auth" + * responses: + * 200: + * description: Successful login + * 400: + * description: Invalid username/password supplied + */ + ``` + • Examples (for Auth endpoints): + - POST /api/auth/signin/local + • Description: Logs the user into the system. + • Request Body (application/json): + { "email": "admin@flatlogic.com", "password": "password" } + • Responses: + - 200: Successful login (returns token and user data). + - 400: Invalid username/password supplied. + - GET /api/auth/me + • Description: Retrieves current authorized user information. + • Secured via Passport JWT; uses req.currentUser. + • Responses: + - 200: Returns current user info. + - 400: Invalid credentials or missing user data. + - POST /api/auth/signup + • Description: Registers a new user. + • Request Body (application/json): + { "email": "admin@flatlogic.com", "password": "password" } + • Responses: + - 200: New user signed up successfully. + - 400: Invalid input supplied. + - 500: Server error. + +## Group 5 – Testing, Quality Assurance & Error Handling +1. Testing Guidelines: + • Write unit tests for critical backend and frontend components using frameworks such as Jest, React Testing Library, and Mocha/Chai. + - **Example**: + ```javascript + test('should return user data', async () => { + const user = await getUserData(); + expect(user).toHaveProperty('email'); + }); + ``` + • Practice test-driven development and maintain high test coverage. + • Regularly update tests following changes in business logic. + +2. Quality Assurance: + • Enforce code quality with ESLint, Prettier, and static analysis tools. + • Integrate continuous testing workflows (CI/CD) to catch issues early. + - **Example**: Use GitHub Actions for automated testing and deployment. + • Ensure documentation is kept up-to-date with the implemented code. + +3. Error Handling: + • Back-end: + - Wrap asynchronous route handlers with a helper (e.g., wrapAsync) to capture errors. + - **Example**: + ```javascript + router.post('/signin', wrapAsync(async (req, res) => { + const user = await AuthService.signin(req.body); + res.send(user); + })); + ``` + - Use centralized error handling middleware (e.g., commonErrorHandler) for uniform error responses. + • Front-end: + - Implement error boundaries in React to gracefully handle runtime errors. + - Display user-friendly error messages and log errors for further analysis. + +2. Authentication & Security: + • Protect endpoints by using Passport.js with JWT (e.g., passport.authenticate('jwt', { session: false })). + - **Example**: + ```javascript + router.get('/profile', passport.authenticate('jwt', { session: false }), (req, res) => { + res.send(req.user); + }); + ``` + • Ensure that secure routes check for existence of req.currentUser. If absent, return a ForbiddenError. + +3. Consistent Error Handling & Middleware Usage: + • Wrap asynchronous route handlers with helpers like wrapAsync for error propagation. + • Use centralized error handling middleware (e.g., commonErrorHandler) to capture and format errors uniformly. + +4. Modular Code Organization: + • Organize backend code into separate files for routes, services, and database access (e.g., auth.js, projects.js, tasks.js). + • Use descriptive, lowercase filenames for modules and routes. + +5. Endpoint Security Best Practices: + • Validate input data and sanitize requests where necessary. + • Restrict sensitive operations to authenticated users with proper role-based permissions. + + +──────────────────────────────────────── +Group 6 – Accessibility, UI, and Styling Guidelines (Updated) +──────────────────────────────────────── +1. Sidebar Styling: + • The sidebar is implemented in the authenticated layout via the AsideMenu component, with the actual element defined in AsideMenuLayer (located at frontend/src/components/AsideMenuLayer.tsx) as an