From b29f65248c842d3bbd5e5a606a0a19691c0fa6c1 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 16 Feb 2026 12:08:29 +0000 Subject: [PATCH] Initial version --- .cursorrules | 305 + .dockerignore | 3 + .gitignore | 3 + .perm_test_apache | 0 .perm_test_exec | 0 502.html | 187 + Dockerfile | 21 + Dockerfile.dev | 85 + LICENSE | 1 + README.md | 244 + backend/.env | 14 + backend/.eslintignore | 4 + backend/.eslintrc.cjs | 15 + backend/.prettierrc | 11 + backend/.sequelizerc | 7 + backend/Dockerfile | 23 + backend/README.md | 56 + backend/package.json | 56 + backend/src/ai/LocalAIApi.js | 484 ++ backend/src/auth/auth.js | 68 + backend/src/config.js | 80 + backend/src/db/api/accounts.js | 591 ++ backend/src/db/api/activities.js | 724 ++ backend/src/db/api/automations.js | 578 ++ backend/src/db/api/contacts.js | 644 ++ backend/src/db/api/deals.js | 827 +++ backend/src/db/api/file.js | 87 + backend/src/db/api/leads.js | 710 ++ backend/src/db/api/notifications.js | 643 ++ backend/src/db/api/organizations.js | 401 ++ backend/src/db/api/permissions.js | 343 + backend/src/db/api/pipeline_stages.js | 553 ++ backend/src/db/api/pipelines.js | 428 ++ backend/src/db/api/roles.js | 445 ++ backend/src/db/api/tasks.js | 818 +++ backend/src/db/api/users.js | 1025 +++ backend/src/db/db.config.js | 33 + backend/src/db/migrations/1771243631264.js | 3599 ++++++++++ backend/src/db/models/accounts.js | 169 + backend/src/db/models/activities.js | 189 + backend/src/db/models/automations.js | 170 + backend/src/db/models/contacts.js | 191 + backend/src/db/models/deals.js | 255 + backend/src/db/models/file.js | 53 + backend/src/db/models/index.js | 38 + backend/src/db/models/leads.js | 223 + backend/src/db/models/notifications.js | 170 + backend/src/db/models/organizations.js | 167 + backend/src/db/models/permissions.js | 79 + backend/src/db/models/pipeline_stages.js | 137 + backend/src/db/models/pipelines.js | 121 + backend/src/db/models/roles.js | 122 + backend/src/db/models/tasks.js | 245 + backend/src/db/models/users.js | 301 + backend/src/db/reset.js | 16 + .../db/seeders/20200430130759-admin-user.js | 77 + .../db/seeders/20200430130760-user-roles.js | 369 + .../db/seeders/20231127130745-sample-data.js | 6168 +++++++++++++++++ backend/src/db/utils.js | 27 + backend/src/helpers.js | 23 + backend/src/index.js | 189 + backend/src/middlewares/check-permissions.js | 149 + backend/src/middlewares/upload.js | 11 + backend/src/routes/accounts.js | 458 ++ backend/src/routes/activities.js | 444 ++ backend/src/routes/auth.js | 209 + backend/src/routes/automations.js | 451 ++ backend/src/routes/contactForm.js | 0 backend/src/routes/contacts.js | 459 ++ backend/src/routes/deals.js | 454 ++ backend/src/routes/file.js | 32 + backend/src/routes/leads.js | 460 ++ backend/src/routes/notifications.js | 445 ++ backend/src/routes/openai.js | 328 + backend/src/routes/organizationLogin.js | 55 + backend/src/routes/organizations.js | 440 ++ backend/src/routes/permissions.js | 429 ++ backend/src/routes/pexels.js | 104 + backend/src/routes/pipeline_stages.js | 446 ++ backend/src/routes/pipelines.js | 440 ++ backend/src/routes/roles.js | 438 ++ backend/src/routes/search.js | 56 + backend/src/routes/sql.js | 61 + backend/src/routes/tasks.js | 446 ++ backend/src/routes/users.js | 451 ++ backend/src/services/accounts.js | 138 + backend/src/services/activities.js | 138 + backend/src/services/auth.js | 314 + backend/src/services/automations.js | 138 + backend/src/services/contacts.js | 138 + backend/src/services/deals.js | 138 + .../emailAddressVerification.html | 52 + .../invitation/invitationTemplate.html | 55 + .../passwordReset/passwordResetEmail.html | 52 + backend/src/services/email/index.js | 44 + .../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 + backend/src/services/leads.js | 138 + backend/src/services/notifications.js | 138 + .../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 | 80 + backend/src/services/organizations.js | 138 + backend/src/services/permissions.js | 138 + backend/src/services/pipeline_stages.js | 138 + backend/src/services/pipelines.js | 138 + backend/src/services/roles.js | 399 ++ backend/src/services/search.js | 387 ++ backend/src/services/tasks.js | 138 + backend/src/services/users.js | 179 + backend/watcher.js | 49 + backend/yarn.lock | 4470 ++++++++++++ docker/.gitignore | 1 + docker/README.md | 46 + docker/docker-compose.yml | 58 + docker/start-backend.sh | 2 + docker/wait-for-it.sh | 182 + frontend/.eslintignore | 3 + frontend/.eslintrc.cjs | 25 + 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 | 79 + 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 + .../src/components/Accounts/CardAccounts.tsx | 207 + .../src/components/Accounts/ListAccounts.tsx | 152 + .../src/components/Accounts/TableAccounts.tsx | 463 ++ .../Accounts/configureAccountsCols.tsx | 217 + .../components/Activities/CardActivities.tsx | 250 + .../components/Activities/ListActivities.tsx | 183 + .../components/Activities/TableActivities.tsx | 463 ++ .../Activities/configureActivitiesCols.tsx | 305 + frontend/src/components/AsideMenu.tsx | 30 + frontend/src/components/AsideMenuItem.tsx | 102 + frontend/src/components/AsideMenuLayer.tsx | 94 + frontend/src/components/AsideMenuList.tsx | 35 + .../Automations/CardAutomations.tsx | 207 + .../Automations/ListAutomations.tsx | 152 + .../Automations/TableAutomations.tsx | 463 ++ .../Automations/configureAutomationsCols.tsx | 219 + 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/Contacts/CardContacts.tsx | 231 + .../src/components/Contacts/ListContacts.tsx | 168 + .../src/components/Contacts/TableContacts.tsx | 463 ++ .../Contacts/configureContactsCols.tsx | 254 + .../src/components/DataGridMultiSelect.tsx | 55 + frontend/src/components/Deals/CardDeals.tsx | 279 + frontend/src/components/Deals/ListDeals.tsx | 200 + frontend/src/components/Deals/TableDeals.tsx | 506 ++ .../components/Deals/configureDealsCols.tsx | 343 + frontend/src/components/DevModeBadge.tsx | 150 + .../src/components/DragDropFilePicker.tsx | 124 + frontend/src/components/ErrorBoundary.tsx | 218 + frontend/src/components/FooterBar.tsx | 35 + 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 | 96 + frontend/src/components/Leads/CardLeads.tsx | 255 + frontend/src/components/Leads/ListLeads.tsx | 184 + frontend/src/components/Leads/TableLeads.tsx | 463 ++ .../components/Leads/configureLeadsCols.tsx | 284 + .../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 + .../Notifications/CardNotifications.tsx | 219 + .../Notifications/ListNotifications.tsx | 160 + .../Notifications/TableNotifications.tsx | 463 ++ .../configureNotificationsCols.tsx | 252 + .../Organizations/CardOrganizations.tsx | 111 + .../Organizations/ListOrganizations.tsx | 88 + .../Organizations/TableOrganizations.tsx | 463 ++ .../configureOrganizationsCols.tsx | 83 + 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 + .../Pipeline_stages/CardPipeline_stages.tsx | 171 + .../Pipeline_stages/ListPipeline_stages.tsx | 128 + .../Pipeline_stages/TablePipeline_stages.tsx | 463 ++ .../configurePipeline_stagesCols.tsx | 169 + .../components/Pipelines/CardPipelines.tsx | 135 + .../components/Pipelines/ListPipelines.tsx | 104 + .../components/Pipelines/TablePipelines.tsx | 476 ++ .../Pipelines/configurePipelinesCols.tsx | 121 + frontend/src/components/RichTextField.tsx | 44 + frontend/src/components/Roles/CardRoles.tsx | 135 + frontend/src/components/Roles/ListRoles.tsx | 104 + frontend/src/components/Roles/TableRoles.tsx | 463 ++ .../components/Roles/configureRolesCols.tsx | 119 + frontend/src/components/Search.tsx | 50 + 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 + frontend/src/components/Tasks/CardTasks.tsx | 279 + frontend/src/components/Tasks/ListTasks.tsx | 200 + frontend/src/components/Tasks/TableTasks.tsx | 489 ++ .../components/Tasks/configureTasksCols.tsx | 345 + .../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 | 220 + frontend/src/components/Users/ListUsers.tsx | 163 + frontend/src/components/Users/TableUsers.tsx | 463 ++ .../components/Users/configureUsersCols.tsx | 229 + .../components/WidgetCreator/RoleSelect.tsx | 53 + .../WidgetCreator/WidgetCreator.tsx | 140 + 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 | 279 + 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 | 139 + frontend/src/menuNavBar.ts | 53 + frontend/src/pages/_app.tsx | 201 + frontend/src/pages/accounts/[accountsId].tsx | 770 ++ frontend/src/pages/accounts/accounts-edit.tsx | 767 ++ frontend/src/pages/accounts/accounts-list.tsx | 168 + frontend/src/pages/accounts/accounts-new.tsx | 530 ++ .../src/pages/accounts/accounts-table.tsx | 170 + frontend/src/pages/accounts/accounts-view.tsx | 938 +++ .../src/pages/activities/[activitiesId].tsx | 1136 +++ .../src/pages/activities/activities-edit.tsx | 1133 +++ .../src/pages/activities/activities-list.tsx | 184 + .../src/pages/activities/activities-new.tsx | 690 ++ .../src/pages/activities/activities-table.tsx | 186 + .../src/pages/activities/activities-view.tsx | 702 ++ frontend/src/pages/api/hello.js | 5 + frontend/src/pages/api/logError.ts | 83 + .../src/pages/automations/[automationsId].tsx | 781 +++ .../pages/automations/automations-edit.tsx | 778 +++ .../pages/automations/automations-list.tsx | 168 + .../src/pages/automations/automations-new.tsx | 543 ++ .../pages/automations/automations-table.tsx | 170 + .../pages/automations/automations-view.tsx | 456 ++ frontend/src/pages/contacts/[contactsId].tsx | 950 +++ frontend/src/pages/contacts/contacts-edit.tsx | 947 +++ frontend/src/pages/contacts/contacts-list.tsx | 172 + frontend/src/pages/contacts/contacts-new.tsx | 643 ++ .../src/pages/contacts/contacts-table.tsx | 174 + frontend/src/pages/contacts/contacts-view.tsx | 923 +++ frontend/src/pages/dashboard.tsx | 557 ++ frontend/src/pages/deals/[dealsId].tsx | 1341 ++++ frontend/src/pages/deals/deals-edit.tsx | 1338 ++++ frontend/src/pages/deals/deals-list.tsx | 186 + frontend/src/pages/deals/deals-new.tsx | 849 +++ frontend/src/pages/deals/deals-table.tsx | 186 + frontend/src/pages/deals/deals-view.tsx | 1130 +++ frontend/src/pages/error.tsx | 35 + frontend/src/pages/forgot.tsx | 82 + frontend/src/pages/forms.tsx | 142 + frontend/src/pages/index.tsx | 166 + frontend/src/pages/leads/[leadsId].tsx | 1071 +++ frontend/src/pages/leads/leads-edit.tsx | 1068 +++ frontend/src/pages/leads/leads-list.tsx | 168 + frontend/src/pages/leads/leads-new.tsx | 767 ++ frontend/src/pages/leads/leads-table.tsx | 170 + frontend/src/pages/leads/leads-view.tsx | 836 +++ frontend/src/pages/login.tsx | 283 + .../pages/notifications/[notificationsId].tsx | 929 +++ .../notifications/notifications-edit.tsx | 926 +++ .../notifications/notifications-list.tsx | 176 + .../pages/notifications/notifications-new.tsx | 587 ++ .../notifications/notifications-table.tsx | 178 + .../notifications/notifications-view.tsx | 566 ++ .../pages/organizations/[organizationsId].tsx | 191 + .../organizations/organizations-edit.tsx | 188 + .../organizations/organizations-list.tsx | 162 + .../pages/organizations/organizations-new.tsx | 143 + .../organizations/organizations-table.tsx | 160 + .../organizations/organizations-view.tsx | 1288 ++++ frontend/src/pages/password-reset.tsx | 12 + .../src/pages/permissions/[permissionsId].tsx | 191 + .../pages/permissions/permissions-edit.tsx | 188 + .../pages/permissions/permissions-list.tsx | 162 + .../src/pages/permissions/permissions-new.tsx | 143 + .../pages/permissions/permissions-table.tsx | 160 + .../pages/permissions/permissions-view.tsx | 135 + .../pipeline_stages/[pipeline_stagesId].tsx | 651 ++ .../pipeline_stages/pipeline_stages-edit.tsx | 648 ++ .../pipeline_stages/pipeline_stages-list.tsx | 166 + .../pipeline_stages/pipeline_stages-new.tsx | 439 ++ .../pipeline_stages/pipeline_stages-table.tsx | 168 + .../pipeline_stages/pipeline_stages-view.tsx | 532 ++ .../src/pages/pipelines/[pipelinesId].tsx | 355 + .../src/pages/pipelines/pipelines-edit.tsx | 352 + .../src/pages/pipelines/pipelines-list.tsx | 168 + .../src/pages/pipelines/pipelines-new.tsx | 239 + .../src/pages/pipelines/pipelines-table.tsx | 166 + .../src/pages/pipelines/pipelines-view.tsx | 555 ++ frontend/src/pages/privacy-policy.tsx | 292 + frontend/src/pages/profile.tsx | 180 + frontend/src/pages/register.tsx | 134 + frontend/src/pages/roles/[rolesId].tsx | 352 + frontend/src/pages/roles/roles-edit.tsx | 349 + frontend/src/pages/roles/roles-list.tsx | 162 + frontend/src/pages/roles/roles-new.tsx | 245 + frontend/src/pages/roles/roles-table.tsx | 160 + frontend/src/pages/roles/roles-view.tsx | 359 + frontend/src/pages/search.tsx | 96 + frontend/src/pages/tables.tsx | 33 + frontend/src/pages/tasks/[tasksId].tsx | 1346 ++++ frontend/src/pages/tasks/tasks-edit.tsx | 1343 ++++ frontend/src/pages/tasks/tasks-list.tsx | 188 + frontend/src/pages/tasks/tasks-new.tsx | 860 +++ frontend/src/pages/tasks/tasks-table.tsx | 186 + frontend/src/pages/tasks/tasks-view.tsx | 908 +++ frontend/src/pages/terms-of-use.tsx | 206 + frontend/src/pages/users/[usersId].tsx | 830 +++ frontend/src/pages/users/users-edit.tsx | 827 +++ frontend/src/pages/users/users-list.tsx | 168 + frontend/src/pages/users/users-new.tsx | 548 ++ frontend/src/pages/users/users-table.tsx | 166 + frontend/src/pages/users/users-view.tsx | 1353 ++++ frontend/src/pages/verify-email.tsx | 62 + frontend/src/stores/accounts/accountsSlice.ts | 231 + .../src/stores/activities/activitiesSlice.ts | 231 + frontend/src/stores/authSlice.ts | 124 + .../stores/automations/automationsSlice.ts | 231 + frontend/src/stores/contacts/contactsSlice.ts | 231 + frontend/src/stores/deals/dealsSlice.ts | 231 + frontend/src/stores/hooks.ts | 6 + frontend/src/stores/introSteps.ts | 139 + frontend/src/stores/leads/leadsSlice.ts | 231 + frontend/src/stores/mainSlice.ts | 36 + .../notifications/notificationsSlice.ts | 231 + frontend/src/stores/openAiSlice.ts | 151 + .../organizations/organizationsSlice.ts | 231 + .../stores/permissions/permissionsSlice.ts | 231 + .../pipeline_stages/pipeline_stagesSlice.ts | 231 + .../src/stores/pipelines/pipelinesSlice.ts | 231 + frontend/src/stores/roles/rolesSlice.ts | 280 + frontend/src/stores/store.ts | 49 + frontend/src/stores/styleSlice.ts | 103 + frontend/src/stores/tasks/tasksSlice.ts | 231 + 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 + 436 files changed, 116706 insertions(+) create mode 100644 .cursorrules create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 .perm_test_apache create mode 100644 .perm_test_exec 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 backend/.env create mode 100644 backend/.eslintignore create mode 100644 backend/.eslintrc.cjs 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/ai/LocalAIApi.js create mode 100644 backend/src/auth/auth.js create mode 100644 backend/src/config.js create mode 100644 backend/src/db/api/accounts.js create mode 100644 backend/src/db/api/activities.js create mode 100644 backend/src/db/api/automations.js create mode 100644 backend/src/db/api/contacts.js create mode 100644 backend/src/db/api/deals.js create mode 100644 backend/src/db/api/file.js create mode 100644 backend/src/db/api/leads.js create mode 100644 backend/src/db/api/notifications.js create mode 100644 backend/src/db/api/organizations.js create mode 100644 backend/src/db/api/permissions.js create mode 100644 backend/src/db/api/pipeline_stages.js create mode 100644 backend/src/db/api/pipelines.js create mode 100644 backend/src/db/api/roles.js create mode 100644 backend/src/db/api/tasks.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/1771243631264.js create mode 100644 backend/src/db/models/accounts.js create mode 100644 backend/src/db/models/activities.js create mode 100644 backend/src/db/models/automations.js create mode 100644 backend/src/db/models/contacts.js create mode 100644 backend/src/db/models/deals.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/leads.js create mode 100644 backend/src/db/models/notifications.js create mode 100644 backend/src/db/models/organizations.js create mode 100644 backend/src/db/models/permissions.js create mode 100644 backend/src/db/models/pipeline_stages.js create mode 100644 backend/src/db/models/pipelines.js create mode 100644 backend/src/db/models/roles.js create mode 100644 backend/src/db/models/tasks.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/accounts.js create mode 100644 backend/src/routes/activities.js create mode 100644 backend/src/routes/auth.js create mode 100644 backend/src/routes/automations.js create mode 100644 backend/src/routes/contactForm.js create mode 100644 backend/src/routes/contacts.js create mode 100644 backend/src/routes/deals.js create mode 100644 backend/src/routes/file.js create mode 100644 backend/src/routes/leads.js create mode 100644 backend/src/routes/notifications.js create mode 100644 backend/src/routes/openai.js create mode 100644 backend/src/routes/organizationLogin.js create mode 100644 backend/src/routes/organizations.js create mode 100644 backend/src/routes/permissions.js create mode 100644 backend/src/routes/pexels.js create mode 100644 backend/src/routes/pipeline_stages.js create mode 100644 backend/src/routes/pipelines.js create mode 100644 backend/src/routes/roles.js create mode 100644 backend/src/routes/search.js create mode 100644 backend/src/routes/sql.js create mode 100644 backend/src/routes/tasks.js create mode 100644 backend/src/routes/users.js create mode 100644 backend/src/services/accounts.js create mode 100644 backend/src/services/activities.js create mode 100644 backend/src/services/auth.js create mode 100644 backend/src/services/automations.js create mode 100644 backend/src/services/contacts.js create mode 100644 backend/src/services/deals.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/leads.js create mode 100644 backend/src/services/notifications.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/organizations.js create mode 100644 backend/src/services/permissions.js create mode 100644 backend/src/services/pipeline_stages.js create mode 100644 backend/src/services/pipelines.js create mode 100644 backend/src/services/roles.js create mode 100644 backend/src/services/search.js create mode 100644 backend/src/services/tasks.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/.eslintignore 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/Accounts/CardAccounts.tsx create mode 100644 frontend/src/components/Accounts/ListAccounts.tsx create mode 100644 frontend/src/components/Accounts/TableAccounts.tsx create mode 100644 frontend/src/components/Accounts/configureAccountsCols.tsx create mode 100644 frontend/src/components/Activities/CardActivities.tsx create mode 100644 frontend/src/components/Activities/ListActivities.tsx create mode 100644 frontend/src/components/Activities/TableActivities.tsx create mode 100644 frontend/src/components/Activities/configureActivitiesCols.tsx 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/Automations/CardAutomations.tsx create mode 100644 frontend/src/components/Automations/ListAutomations.tsx create mode 100644 frontend/src/components/Automations/TableAutomations.tsx create mode 100644 frontend/src/components/Automations/configureAutomationsCols.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/Contacts/CardContacts.tsx create mode 100644 frontend/src/components/Contacts/ListContacts.tsx create mode 100644 frontend/src/components/Contacts/TableContacts.tsx create mode 100644 frontend/src/components/Contacts/configureContactsCols.tsx create mode 100644 frontend/src/components/DataGridMultiSelect.tsx create mode 100644 frontend/src/components/Deals/CardDeals.tsx create mode 100644 frontend/src/components/Deals/ListDeals.tsx create mode 100644 frontend/src/components/Deals/TableDeals.tsx create mode 100644 frontend/src/components/Deals/configureDealsCols.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/Leads/CardLeads.tsx create mode 100644 frontend/src/components/Leads/ListLeads.tsx create mode 100644 frontend/src/components/Leads/TableLeads.tsx create mode 100644 frontend/src/components/Leads/configureLeadsCols.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/Notifications/CardNotifications.tsx create mode 100644 frontend/src/components/Notifications/ListNotifications.tsx create mode 100644 frontend/src/components/Notifications/TableNotifications.tsx create mode 100644 frontend/src/components/Notifications/configureNotificationsCols.tsx create mode 100644 frontend/src/components/Organizations/CardOrganizations.tsx create mode 100644 frontend/src/components/Organizations/ListOrganizations.tsx create mode 100644 frontend/src/components/Organizations/TableOrganizations.tsx create mode 100644 frontend/src/components/Organizations/configureOrganizationsCols.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/Pipeline_stages/CardPipeline_stages.tsx create mode 100644 frontend/src/components/Pipeline_stages/ListPipeline_stages.tsx create mode 100644 frontend/src/components/Pipeline_stages/TablePipeline_stages.tsx create mode 100644 frontend/src/components/Pipeline_stages/configurePipeline_stagesCols.tsx create mode 100644 frontend/src/components/Pipelines/CardPipelines.tsx create mode 100644 frontend/src/components/Pipelines/ListPipelines.tsx create mode 100644 frontend/src/components/Pipelines/TablePipelines.tsx create mode 100644 frontend/src/components/Pipelines/configurePipelinesCols.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/Tasks/CardTasks.tsx create mode 100644 frontend/src/components/Tasks/ListTasks.tsx create mode 100644 frontend/src/components/Tasks/TableTasks.tsx create mode 100644 frontend/src/components/Tasks/configureTasksCols.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/accounts/[accountsId].tsx create mode 100644 frontend/src/pages/accounts/accounts-edit.tsx create mode 100644 frontend/src/pages/accounts/accounts-list.tsx create mode 100644 frontend/src/pages/accounts/accounts-new.tsx create mode 100644 frontend/src/pages/accounts/accounts-table.tsx create mode 100644 frontend/src/pages/accounts/accounts-view.tsx create mode 100644 frontend/src/pages/activities/[activitiesId].tsx create mode 100644 frontend/src/pages/activities/activities-edit.tsx create mode 100644 frontend/src/pages/activities/activities-list.tsx create mode 100644 frontend/src/pages/activities/activities-new.tsx create mode 100644 frontend/src/pages/activities/activities-table.tsx create mode 100644 frontend/src/pages/activities/activities-view.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/automations/[automationsId].tsx create mode 100644 frontend/src/pages/automations/automations-edit.tsx create mode 100644 frontend/src/pages/automations/automations-list.tsx create mode 100644 frontend/src/pages/automations/automations-new.tsx create mode 100644 frontend/src/pages/automations/automations-table.tsx create mode 100644 frontend/src/pages/automations/automations-view.tsx create mode 100644 frontend/src/pages/contacts/[contactsId].tsx create mode 100644 frontend/src/pages/contacts/contacts-edit.tsx create mode 100644 frontend/src/pages/contacts/contacts-list.tsx create mode 100644 frontend/src/pages/contacts/contacts-new.tsx create mode 100644 frontend/src/pages/contacts/contacts-table.tsx create mode 100644 frontend/src/pages/contacts/contacts-view.tsx create mode 100644 frontend/src/pages/dashboard.tsx create mode 100644 frontend/src/pages/deals/[dealsId].tsx create mode 100644 frontend/src/pages/deals/deals-edit.tsx create mode 100644 frontend/src/pages/deals/deals-list.tsx create mode 100644 frontend/src/pages/deals/deals-new.tsx create mode 100644 frontend/src/pages/deals/deals-table.tsx create mode 100644 frontend/src/pages/deals/deals-view.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/leads/[leadsId].tsx create mode 100644 frontend/src/pages/leads/leads-edit.tsx create mode 100644 frontend/src/pages/leads/leads-list.tsx create mode 100644 frontend/src/pages/leads/leads-new.tsx create mode 100644 frontend/src/pages/leads/leads-table.tsx create mode 100644 frontend/src/pages/leads/leads-view.tsx create mode 100644 frontend/src/pages/login.tsx create mode 100644 frontend/src/pages/notifications/[notificationsId].tsx create mode 100644 frontend/src/pages/notifications/notifications-edit.tsx create mode 100644 frontend/src/pages/notifications/notifications-list.tsx create mode 100644 frontend/src/pages/notifications/notifications-new.tsx create mode 100644 frontend/src/pages/notifications/notifications-table.tsx create mode 100644 frontend/src/pages/notifications/notifications-view.tsx create mode 100644 frontend/src/pages/organizations/[organizationsId].tsx create mode 100644 frontend/src/pages/organizations/organizations-edit.tsx create mode 100644 frontend/src/pages/organizations/organizations-list.tsx create mode 100644 frontend/src/pages/organizations/organizations-new.tsx create mode 100644 frontend/src/pages/organizations/organizations-table.tsx create mode 100644 frontend/src/pages/organizations/organizations-view.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/pipeline_stages/[pipeline_stagesId].tsx create mode 100644 frontend/src/pages/pipeline_stages/pipeline_stages-edit.tsx create mode 100644 frontend/src/pages/pipeline_stages/pipeline_stages-list.tsx create mode 100644 frontend/src/pages/pipeline_stages/pipeline_stages-new.tsx create mode 100644 frontend/src/pages/pipeline_stages/pipeline_stages-table.tsx create mode 100644 frontend/src/pages/pipeline_stages/pipeline_stages-view.tsx create mode 100644 frontend/src/pages/pipelines/[pipelinesId].tsx create mode 100644 frontend/src/pages/pipelines/pipelines-edit.tsx create mode 100644 frontend/src/pages/pipelines/pipelines-list.tsx create mode 100644 frontend/src/pages/pipelines/pipelines-new.tsx create mode 100644 frontend/src/pages/pipelines/pipelines-table.tsx create mode 100644 frontend/src/pages/pipelines/pipelines-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/tasks/[tasksId].tsx create mode 100644 frontend/src/pages/tasks/tasks-edit.tsx create mode 100644 frontend/src/pages/tasks/tasks-list.tsx create mode 100644 frontend/src/pages/tasks/tasks-new.tsx create mode 100644 frontend/src/pages/tasks/tasks-table.tsx create mode 100644 frontend/src/pages/tasks/tasks-view.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/accounts/accountsSlice.ts create mode 100644 frontend/src/stores/activities/activitiesSlice.ts create mode 100644 frontend/src/stores/authSlice.ts create mode 100644 frontend/src/stores/automations/automationsSlice.ts create mode 100644 frontend/src/stores/contacts/contactsSlice.ts create mode 100644 frontend/src/stores/deals/dealsSlice.ts create mode 100644 frontend/src/stores/hooks.ts create mode 100644 frontend/src/stores/introSteps.ts create mode 100644 frontend/src/stores/leads/leadsSlice.ts create mode 100644 frontend/src/stores/mainSlice.ts create mode 100644 frontend/src/stores/notifications/notificationsSlice.ts create mode 100644 frontend/src/stores/openAiSlice.ts create mode 100644 frontend/src/stores/organizations/organizationsSlice.ts create mode 100644 frontend/src/stores/permissions/permissionsSlice.ts create mode 100644 frontend/src/stores/pipeline_stages/pipeline_stagesSlice.ts create mode 100644 frontend/src/stores/pipelines/pipelinesSlice.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/tasks/tasksSlice.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