From f0d5a2b62dc50b7d403c323c47ea7a47e7f5b0c0 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 9 Jun 2025 13:40:30 +0000 Subject: [PATCH] Initial version --- .cursorrules | 305 ++ .dockerignore | 3 + .gitignore | 3 + .idea/.gitignore | 5 + .idea/dbnavigator.xml | 426 ++ .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/modules.xml | 8 + .idea/test-i18-20250514-140606918.iml | 12 + 502.html | 187 + Dockerfile | 17 + Dockerfile.dev | 73 + LICENSE | 1 + README.md | 200 + 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 | 42 + app-shell/src/_schema.json | 5 + app-shell/src/config.js | 16 + 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 | 312 ++ 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/vcs.js | 1205 +++++ app-shell/yarn.lock | 3044 +++++++++++ backend/.prettierrc | 11 + backend/.sequelizerc | 7 + backend/Dockerfile | 23 + backend/README.md | 67 + backend/package.json | 53 + backend/src/auth/auth.js | 79 + backend/src/config.js | 75 + backend/src/db/api/analytics.js | 366 ++ backend/src/db/api/courses.js | 372 ++ backend/src/db/api/discussion_boards.js | 352 ++ backend/src/db/api/enrollments.js | 338 ++ backend/src/db/api/file.js | 73 + backend/src/db/api/instructors.js | 315 ++ backend/src/db/api/permissions.js | 253 + backend/src/db/api/roles.js | 316 ++ backend/src/db/api/students.js | 310 ++ backend/src/db/api/users.js | 747 +++ backend/src/db/db.config.js | 31 + backend/src/db/migrations/1746807042625.js | 780 +++ backend/src/db/models/analytics.js | 65 + backend/src/db/models/courses.js | 113 + backend/src/db/models/discussion_boards.js | 75 + backend/src/db/models/enrollments.js | 67 + backend/src/db/models/file.js | 53 + backend/src/db/models/index.js | 47 + backend/src/db/models/instructors.js | 71 + backend/src/db/models/permissions.js | 49 + backend/src/db/models/roles.js | 79 + backend/src/db/models/students.js | 71 + backend/src/db/models/users.js | 179 + backend/src/db/reset.js | 16 + .../db/seeders/20200430130759-admin-user.js | 73 + .../db/seeders/20200430130760-user-roles.js | 1001 ++++ .../db/seeders/20231127130745-sample-data.js | 386 ++ backend/src/db/utils.js | 24 + backend/src/helpers.js | 23 + backend/src/index.js | 191 + backend/src/middlewares/check-permissions.js | 176 + backend/src/middlewares/upload.js | 11 + backend/src/routes/analytics.js | 449 ++ backend/src/routes/auth.js | 268 + backend/src/routes/contactForm.js | 33 + backend/src/routes/courses.js | 441 ++ backend/src/routes/discussion_boards.js | 444 ++ backend/src/routes/enrollments.js | 439 ++ backend/src/routes/file.js | 40 + backend/src/routes/instructors.js | 445 ++ backend/src/routes/openai.js | 244 + backend/src/routes/organizationLogin.js | 0 backend/src/routes/permissions.js | 442 ++ backend/src/routes/pexels.js | 106 + backend/src/routes/roles.js | 433 ++ backend/src/routes/search.js | 54 + backend/src/routes/students.js | 441 ++ backend/src/routes/users.js | 444 ++ backend/src/services/analytics.js | 114 + backend/src/services/auth.js | 226 + backend/src/services/courses.js | 114 + backend/src/services/discussion_boards.js | 121 + .../emailAddressVerification.html | 52 + .../invitation/invitationTemplate.html | 56 + .../passwordReset/passwordResetEmail.html | 55 + backend/src/services/email/index.js | 41 + .../email/list/addressVerification.js | 41 + backend/src/services/email/list/invitation.js | 41 + .../src/services/email/list/passwordReset.js | 42 + backend/src/services/enrollments.js | 114 + backend/src/services/file.js | 202 + backend/src/services/instructors.js | 114 + .../notifications/errors/forbidden.js | 16 + .../notifications/errors/validation.js | 16 + backend/src/services/notifications/helpers.js | 30 + backend/src/services/notifications/list.js | 100 + backend/src/services/openai.js | 68 + backend/src/services/permissions.js | 114 + backend/src/services/roles.js | 430 ++ backend/src/services/search.js | 145 + backend/src/services/students.js | 114 + backend/src/services/users.js | 152 + backend/watcher.js | 45 + backend/yarn.lock | 4470 +++++++++++++++++ docker/.gitignore | 1 + docker/README.md | 46 + docker/docker-compose.yml | 35 + 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 | 91 + frontend/next-env.d.ts | 5 + frontend/next.config.mjs | 57 + frontend/package.json | 77 + frontend/postcss.config.js | 9 + frontend/prettier.config.js | 13 + frontend/public/data-sources/clients.json | 224 + frontend/public/data-sources/history.json | 40 + 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 | 145 + .../components/Analytics/CardAnalytics.tsx | 142 + .../components/Analytics/ListAnalytics.tsx | 112 + .../components/Analytics/TableAnalytics.tsx | 484 ++ .../Analytics/configureAnalyticsCols.tsx | 124 + frontend/src/components/AsideMenu.tsx | 32 + frontend/src/components/AsideMenuItem.tsx | 116 + frontend/src/components/AsideMenuLayer.tsx | 68 + frontend/src/components/AsideMenuList.tsx | 35 + frontend/src/components/BaseButton.tsx | 106 + frontend/src/components/BaseButtons.tsx | 40 + frontend/src/components/BaseDivider.tsx | 14 + frontend/src/components/BaseIcon.tsx | 39 + frontend/src/components/BigCalendar.tsx | 171 + frontend/src/components/CardBox.tsx | 70 + .../src/components/CardBoxComponentBody.tsx | 21 + .../src/components/CardBoxComponentEmpty.tsx | 11 + .../src/components/CardBoxComponentFooter.tsx | 10 + .../src/components/CardBoxComponentTitle.tsx | 17 + frontend/src/components/CardBoxModal.tsx | 75 + .../src/components/ChartLineSample/config.ts | 54 + .../src/components/ChartLineSample/index.tsx | 44 + frontend/src/components/ClickOutside.tsx | 45 + .../src/components/Courses/CardCourses.tsx | 142 + .../src/components/Courses/ListCourses.tsx | 110 + .../src/components/Courses/TableCourses.tsx | 481 ++ .../Courses/configureCoursesCols.tsx | 124 + .../src/components/DataGridMultiSelect.tsx | 55 + .../CardDiscussion_boards.tsx | 132 + .../ListDiscussion_boards.tsx | 106 + .../TableDiscussion_boards.tsx | 497 ++ .../configureDiscussion_boardsCols.tsx | 113 + .../src/components/DragDropFilePicker.tsx | 124 + .../Enrollments/CardEnrollments.tsx | 131 + .../Enrollments/ListEnrollments.tsx | 103 + .../Enrollments/TableEnrollments.tsx | 484 ++ .../Enrollments/configureEnrollmentsCols.tsx | 114 + frontend/src/components/ErrorBoundary.tsx | 218 + frontend/src/components/FooterBar.tsx | 37 + frontend/src/components/FormCheckRadio.tsx | 20 + .../src/components/FormCheckRadioGroup.tsx | 26 + frontend/src/components/FormField.tsx | 92 + frontend/src/components/FormFilePicker.tsx | 101 + frontend/src/components/FormImagePicker.tsx | 102 + frontend/src/components/IconRounded.tsx | 36 + frontend/src/components/ImageField.tsx | 51 + .../Instructors/CardInstructors.tsx | 133 + .../Instructors/ListInstructors.tsx | 101 + .../Instructors/TableInstructors.tsx | 497 ++ .../Instructors/configureInstructorsCols.tsx | 105 + frontend/src/components/IntroGuide.tsx | 54 + .../components/KanbanBoard/KanbanBoard.tsx | 51 + .../src/components/KanbanBoard/KanbanCard.tsx | 64 + .../components/KanbanBoard/KanbanColumn.tsx | 211 + frontend/src/components/LanguageSwitcher.tsx | 104 + .../src/components/ListActionsPopover.tsx | 114 + frontend/src/components/LoadingSpinner.tsx | 14 + frontend/src/components/Logo/index.tsx | 15 + frontend/src/components/NavBar.tsx | 64 + frontend/src/components/NavBarItem.tsx | 149 + frontend/src/components/NavBarItemPlain.tsx | 35 + frontend/src/components/NavBarMenuList.tsx | 19 + frontend/src/components/NotificationBar.tsx | 65 + frontend/src/components/OverlayLayer.tsx | 41 + frontend/src/components/Pagination.tsx | 85 + .../src/components/PasswordSetOrReset.tsx | 111 + .../Permissions/CardPermissions.tsx | 105 + .../Permissions/ListPermissions.tsx | 87 + .../Permissions/TablePermissions.tsx | 484 ++ .../Permissions/configurePermissionsCols.tsx | 74 + frontend/src/components/RichTextField.tsx | 41 + frontend/src/components/Roles/CardRoles.tsx | 118 + frontend/src/components/Roles/ListRoles.tsx | 96 + frontend/src/components/Roles/TableRoles.tsx | 481 ++ .../components/Roles/configureRolesCols.tsx | 93 + frontend/src/components/Search.tsx | 56 + frontend/src/components/SearchResults.tsx | 83 + frontend/src/components/SectionFullScreen.tsx | 32 + frontend/src/components/SectionMain.tsx | 10 + frontend/src/components/SectionTitle.tsx | 38 + .../components/SectionTitleLineWithButton.tsx | 40 + frontend/src/components/SelectField.tsx | 60 + frontend/src/components/SelectFieldMany.tsx | 75 + .../components/SmartWidget/SmartWidget.tsx | 101 + .../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 | 38 + .../src/components/Students/CardStudents.tsx | 133 + .../src/components/Students/ListStudents.tsx | 101 + .../src/components/Students/TableStudents.tsx | 494 ++ .../Students/configureStudentsCols.tsx | 105 + frontend/src/components/SwitchField.tsx | 19 + .../src/components/TableSampleClients.tsx | 149 + .../src/components/Uploaders/FilesUploader.js | 133 + .../components/Uploaders/ImagesUploader.js | 227 + .../src/components/Uploaders/UploadService.js | 82 + frontend/src/components/UserAvatar.tsx | 48 + .../src/components/UserAvatarCurrentUser.tsx | 48 + frontend/src/components/UserCard.tsx | 47 + frontend/src/components/Users/CardUsers.tsx | 196 + frontend/src/components/Users/ListUsers.tsx | 145 + frontend/src/components/Users/TableUsers.tsx | 482 ++ .../components/Users/configureUsersCols.tsx | 183 + .../AboutUsComponent/designs/ImageLeft.tsx | 54 + .../AboutUsComponent/designs/ImageRight.tsx | 53 + .../AboutUsComponent/index.tsx | 85 + .../designs/FormWithImage.tsx | 95 + .../designs/HighlightedForm.tsx | 126 + .../designs/SimpleAndCleanForm.tsx | 162 + .../ContactFormComponent/index.tsx | 89 + .../FaqComponent/designs/FAQAccordion.tsx | 74 + .../FaqComponent/designs/FAQSplitList.tsx | 69 + .../FaqComponent/designs/FAQTwoColumn.tsx | 28 + .../WebPageComponents/FaqComponent/index.tsx | 75 + .../designs/CardsGridWithIcons.tsx | 72 + .../FeaturesComponent/designs/IconsTop.tsx | 49 + .../designs/IconsWithImage.tsx | 81 + .../designs/LargeNumbers.tsx | 52 + .../FeaturesComponent/index.tsx | 136 + .../components/WebPageComponents/Footer.tsx | 75 + .../designs/HorizontalGalleryWithButtons.tsx | 106 + .../designs/OverlappingCentralImage.tsx | 128 + .../GalleryPortfolioComponent/index.tsx | 75 + .../components/WebPageComponents/Header.tsx | 81 + .../HeroComponent/designs/HeroImageBg.tsx | 38 + .../HeroComponent/designs/HeroImageLeft.tsx | 48 + .../HeroComponent/designs/HeroImageRight.tsx | 48 + .../HeroComponent/designs/HeroTextCenter.tsx | 22 + .../WebPageComponents/HeroComponent/index.tsx | 73 + .../PricingComponent/index.tsx | 240 + .../designs/HorizontalCarousel.tsx | 85 + .../designs/MultiCardDisplay.tsx | 76 + .../TestimonialsComponent/index.tsx | 112 + .../components/WebPageComponents/designs.ts | 77 + .../components/WidgetCreator/RoleSelect.tsx | 65 + .../WidgetCreator/WidgetCreator.tsx | 156 + frontend/src/config.ts | 22 + frontend/src/css/_app.css | 34 + frontend/src/css/_calendar.css | 37 + frontend/src/css/_checkbox-radio-switch.css | 73 + frontend/src/css/_helper.css | 24 + frontend/src/css/_progress.css | 21 + frontend/src/css/_rich-text.css | 0 frontend/src/css/_scrollbars.css | 41 + frontend/src/css/_select-dropdown.css | 32 + frontend/src/css/_table.css | 117 + frontend/src/css/_theme.css | 105 + frontend/src/css/main.css | 34 + 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 | 136 + frontend/src/helpers/fileSaver.ts | 6 + frontend/src/helpers/humanize.ts | 12 + frontend/src/helpers/notifyStateHandler.ts | 32 + frontend/src/helpers/pexels.ts | 75 + frontend/src/helpers/userPermissions.ts | 18 + frontend/src/hooks/sampleData.ts | 22 + frontend/src/i18n.ts | 21 + frontend/src/interfaces/index.ts | 122 + frontend/src/layouts/Authenticated.tsx | 132 + frontend/src/layouts/Guest.tsx | 19 + frontend/src/menuAside.ts | 122 + frontend/src/menuNavBar.ts | 72 + frontend/src/pages/_app.tsx | 190 + .../src/pages/analytics/[analyticsId].tsx | 163 + .../src/pages/analytics/analytics-edit.tsx | 161 + .../src/pages/analytics/analytics-list.tsx | 172 + .../src/pages/analytics/analytics-new.tsx | 134 + .../src/pages/analytics/analytics-table.tsx | 175 + .../src/pages/analytics/analytics-view.tsx | 99 + frontend/src/pages/api/hello.js | 5 + frontend/src/pages/api/logError.ts | 83 + frontend/src/pages/chat-gpt.tsx | 347 ++ frontend/src/pages/courses/[coursesId].tsx | 160 + frontend/src/pages/courses/courses-edit.tsx | 158 + frontend/src/pages/courses/courses-list.tsx | 168 + frontend/src/pages/courses/courses-new.tsx | 132 + frontend/src/pages/courses/courses-table.tsx | 171 + frontend/src/pages/courses/courses-view.tsx | 341 ++ frontend/src/pages/dashboard.tsx | 509 ++ .../[discussion_boardsId].tsx | 159 + .../discussion_boards-edit.tsx | 157 + .../discussion_boards-list.tsx | 177 + .../discussion_boards-new.tsx | 124 + .../discussion_boards-table.tsx | 174 + .../discussion_boards-view.tsx | 146 + .../src/pages/enrollments/[enrollmentsId].tsx | 162 + .../pages/enrollments/enrollments-edit.tsx | 160 + .../pages/enrollments/enrollments-list.tsx | 176 + .../src/pages/enrollments/enrollments-new.tsx | 132 + .../pages/enrollments/enrollments-table.tsx | 179 + .../pages/enrollments/enrollments-view.tsx | 95 + frontend/src/pages/error.tsx | 35 + frontend/src/pages/forgot.tsx | 81 + frontend/src/pages/forms.tsx | 162 + frontend/src/pages/index.tsx | 128 + .../src/pages/instructors/[instructorsId].tsx | 145 + .../pages/instructors/instructors-edit.tsx | 143 + .../pages/instructors/instructors-list.tsx | 174 + .../src/pages/instructors/instructors-new.tsx | 116 + .../pages/instructors/instructors-table.tsx | 173 + .../pages/instructors/instructors-view.tsx | 123 + frontend/src/pages/login.tsx | 364 ++ frontend/src/pages/password-reset.tsx | 12 + .../src/pages/permissions/[permissionsId].tsx | 126 + .../pages/permissions/permissions-edit.tsx | 124 + .../pages/permissions/permissions-list.tsx | 165 + .../src/pages/permissions/permissions-new.tsx | 98 + .../pages/permissions/permissions-table.tsx | 164 + .../pages/permissions/permissions-view.tsx | 83 + frontend/src/pages/privacy-policy.tsx | 292 ++ frontend/src/pages/profile.tsx | 178 + frontend/src/pages/register.tsx | 88 + frontend/src/pages/roles/[rolesId].tsx | 137 + frontend/src/pages/roles/roles-edit.tsx | 135 + frontend/src/pages/roles/roles-list.tsx | 164 + frontend/src/pages/roles/roles-new.tsx | 110 + frontend/src/pages/roles/roles-table.tsx | 163 + frontend/src/pages/roles/roles-view.tsx | 171 + frontend/src/pages/search.tsx | 93 + frontend/src/pages/students/[studentsId].tsx | 143 + frontend/src/pages/students/students-edit.tsx | 141 + frontend/src/pages/students/students-list.tsx | 171 + frontend/src/pages/students/students-new.tsx | 116 + .../src/pages/students/students-table.tsx | 170 + frontend/src/pages/students/students-view.tsx | 127 + frontend/src/pages/tables.tsx | 37 + frontend/src/pages/terms-of-use.tsx | 205 + frontend/src/pages/users/[usersId].tsx | 205 + frontend/src/pages/users/users-edit.tsx | 203 + frontend/src/pages/users/users-list.tsx | 173 + frontend/src/pages/users/users-new.tsx | 171 + frontend/src/pages/users/users-table.tsx | 168 + frontend/src/pages/users/users-view.tsx | 199 + frontend/src/pages/verify-email.tsx | 65 + frontend/src/pages/web_pages/about.tsx | 143 + frontend/src/pages/web_pages/contact.tsx | 65 + frontend/src/pages/web_pages/faq.tsx | 102 + frontend/src/pages/web_pages/home.tsx | 154 + frontend/src/pages/web_pages/services.tsx | 131 + .../src/stores/analytics/analyticsSlice.ts | 236 + frontend/src/stores/authSlice.ts | 125 + frontend/src/stores/courses/coursesSlice.ts | 236 + .../discussion_boardsSlice.ts | 250 + .../stores/enrollments/enrollmentsSlice.ts | 241 + frontend/src/stores/hooks.ts | 6 + .../stores/instructors/instructorsSlice.ts | 241 + frontend/src/stores/introSteps.ts | 152 + frontend/src/stores/mainSlice.ts | 36 + frontend/src/stores/openAiSlice.ts | 116 + .../stores/permissions/permissionsSlice.ts | 241 + frontend/src/stores/roles/rolesSlice.ts | 283 ++ frontend/src/stores/store.ts | 39 + frontend/src/stores/students/studentsSlice.ts | 236 + frontend/src/stores/styleSlice.ts | 107 + frontend/src/stores/users/usersSlice.ts | 236 + frontend/src/stores/usersSlice.ts | 119 + frontend/src/styles.ts | 106 + frontend/tailwind.config.js | 106 + frontend/tsconfig.json | 20 + frontend/yarn.lock | 4040 +++++++++++++++ nginx.conf | 89 + package.json | 9 + pids/backend.pid | 1 + pids/frontend.pid | 1 + 418 files changed, 64306 insertions(+) create mode 100644 .cursorrules create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/dbnavigator.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/test-i18-20250514-140606918.iml 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/vcs.js create mode 100644 app-shell/yarn.lock 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/analytics.js create mode 100644 backend/src/db/api/courses.js create mode 100644 backend/src/db/api/discussion_boards.js create mode 100644 backend/src/db/api/enrollments.js create mode 100644 backend/src/db/api/file.js create mode 100644 backend/src/db/api/instructors.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/students.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/1746807042625.js create mode 100644 backend/src/db/models/analytics.js create mode 100644 backend/src/db/models/courses.js create mode 100644 backend/src/db/models/discussion_boards.js create mode 100644 backend/src/db/models/enrollments.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/instructors.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/students.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/analytics.js create mode 100644 backend/src/routes/auth.js create mode 100644 backend/src/routes/contactForm.js create mode 100644 backend/src/routes/courses.js create mode 100644 backend/src/routes/discussion_boards.js create mode 100644 backend/src/routes/enrollments.js create mode 100644 backend/src/routes/file.js create mode 100644 backend/src/routes/instructors.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/students.js create mode 100644 backend/src/routes/users.js create mode 100644 backend/src/services/analytics.js create mode 100644 backend/src/services/auth.js create mode 100644 backend/src/services/courses.js create mode 100644 backend/src/services/discussion_boards.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/enrollments.js create mode 100644 backend/src/services/file.js create mode 100644 backend/src/services/instructors.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/students.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/Analytics/CardAnalytics.tsx create mode 100644 frontend/src/components/Analytics/ListAnalytics.tsx create mode 100644 frontend/src/components/Analytics/TableAnalytics.tsx create mode 100644 frontend/src/components/Analytics/configureAnalyticsCols.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/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/Courses/CardCourses.tsx create mode 100644 frontend/src/components/Courses/ListCourses.tsx create mode 100644 frontend/src/components/Courses/TableCourses.tsx create mode 100644 frontend/src/components/Courses/configureCoursesCols.tsx create mode 100644 frontend/src/components/DataGridMultiSelect.tsx create mode 100644 frontend/src/components/Discussion_boards/CardDiscussion_boards.tsx create mode 100644 frontend/src/components/Discussion_boards/ListDiscussion_boards.tsx create mode 100644 frontend/src/components/Discussion_boards/TableDiscussion_boards.tsx create mode 100644 frontend/src/components/Discussion_boards/configureDiscussion_boardsCols.tsx create mode 100644 frontend/src/components/DragDropFilePicker.tsx create mode 100644 frontend/src/components/Enrollments/CardEnrollments.tsx create mode 100644 frontend/src/components/Enrollments/ListEnrollments.tsx create mode 100644 frontend/src/components/Enrollments/TableEnrollments.tsx create mode 100644 frontend/src/components/Enrollments/configureEnrollmentsCols.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/Instructors/CardInstructors.tsx create mode 100644 frontend/src/components/Instructors/ListInstructors.tsx create mode 100644 frontend/src/components/Instructors/TableInstructors.tsx create mode 100644 frontend/src/components/Instructors/configureInstructorsCols.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/Students/CardStudents.tsx create mode 100644 frontend/src/components/Students/ListStudents.tsx create mode 100644 frontend/src/components/Students/TableStudents.tsx create mode 100644 frontend/src/components/Students/configureStudentsCols.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/WebPageComponents/AboutUsComponent/designs/ImageLeft.tsx create mode 100644 frontend/src/components/WebPageComponents/AboutUsComponent/designs/ImageRight.tsx create mode 100644 frontend/src/components/WebPageComponents/AboutUsComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/ContactFormComponent/designs/FormWithImage.tsx create mode 100644 frontend/src/components/WebPageComponents/ContactFormComponent/designs/HighlightedForm.tsx create mode 100644 frontend/src/components/WebPageComponents/ContactFormComponent/designs/SimpleAndCleanForm.tsx create mode 100644 frontend/src/components/WebPageComponents/ContactFormComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/FaqComponent/designs/FAQAccordion.tsx create mode 100644 frontend/src/components/WebPageComponents/FaqComponent/designs/FAQSplitList.tsx create mode 100644 frontend/src/components/WebPageComponents/FaqComponent/designs/FAQTwoColumn.tsx create mode 100644 frontend/src/components/WebPageComponents/FaqComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/FeaturesComponent/designs/CardsGridWithIcons.tsx create mode 100644 frontend/src/components/WebPageComponents/FeaturesComponent/designs/IconsTop.tsx create mode 100644 frontend/src/components/WebPageComponents/FeaturesComponent/designs/IconsWithImage.tsx create mode 100644 frontend/src/components/WebPageComponents/FeaturesComponent/designs/LargeNumbers.tsx create mode 100644 frontend/src/components/WebPageComponents/FeaturesComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/Footer.tsx create mode 100644 frontend/src/components/WebPageComponents/GalleryPortfolioComponent/designs/HorizontalGalleryWithButtons.tsx create mode 100644 frontend/src/components/WebPageComponents/GalleryPortfolioComponent/designs/OverlappingCentralImage.tsx create mode 100644 frontend/src/components/WebPageComponents/GalleryPortfolioComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/Header.tsx create mode 100644 frontend/src/components/WebPageComponents/HeroComponent/designs/HeroImageBg.tsx create mode 100644 frontend/src/components/WebPageComponents/HeroComponent/designs/HeroImageLeft.tsx create mode 100644 frontend/src/components/WebPageComponents/HeroComponent/designs/HeroImageRight.tsx create mode 100644 frontend/src/components/WebPageComponents/HeroComponent/designs/HeroTextCenter.tsx create mode 100644 frontend/src/components/WebPageComponents/HeroComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/PricingComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/TestimonialsComponent/designs/HorizontalCarousel.tsx create mode 100644 frontend/src/components/WebPageComponents/TestimonialsComponent/designs/MultiCardDisplay.tsx create mode 100644 frontend/src/components/WebPageComponents/TestimonialsComponent/index.tsx create mode 100644 frontend/src/components/WebPageComponents/designs.ts 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/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/analytics/[analyticsId].tsx create mode 100644 frontend/src/pages/analytics/analytics-edit.tsx create mode 100644 frontend/src/pages/analytics/analytics-list.tsx create mode 100644 frontend/src/pages/analytics/analytics-new.tsx create mode 100644 frontend/src/pages/analytics/analytics-table.tsx create mode 100644 frontend/src/pages/analytics/analytics-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/chat-gpt.tsx create mode 100644 frontend/src/pages/courses/[coursesId].tsx create mode 100644 frontend/src/pages/courses/courses-edit.tsx create mode 100644 frontend/src/pages/courses/courses-list.tsx create mode 100644 frontend/src/pages/courses/courses-new.tsx create mode 100644 frontend/src/pages/courses/courses-table.tsx create mode 100644 frontend/src/pages/courses/courses-view.tsx create mode 100644 frontend/src/pages/dashboard.tsx create mode 100644 frontend/src/pages/discussion_boards/[discussion_boardsId].tsx create mode 100644 frontend/src/pages/discussion_boards/discussion_boards-edit.tsx create mode 100644 frontend/src/pages/discussion_boards/discussion_boards-list.tsx create mode 100644 frontend/src/pages/discussion_boards/discussion_boards-new.tsx create mode 100644 frontend/src/pages/discussion_boards/discussion_boards-table.tsx create mode 100644 frontend/src/pages/discussion_boards/discussion_boards-view.tsx create mode 100644 frontend/src/pages/enrollments/[enrollmentsId].tsx create mode 100644 frontend/src/pages/enrollments/enrollments-edit.tsx create mode 100644 frontend/src/pages/enrollments/enrollments-list.tsx create mode 100644 frontend/src/pages/enrollments/enrollments-new.tsx create mode 100644 frontend/src/pages/enrollments/enrollments-table.tsx create mode 100644 frontend/src/pages/enrollments/enrollments-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/instructors/[instructorsId].tsx create mode 100644 frontend/src/pages/instructors/instructors-edit.tsx create mode 100644 frontend/src/pages/instructors/instructors-list.tsx create mode 100644 frontend/src/pages/instructors/instructors-new.tsx create mode 100644 frontend/src/pages/instructors/instructors-table.tsx create mode 100644 frontend/src/pages/instructors/instructors-view.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/students/[studentsId].tsx create mode 100644 frontend/src/pages/students/students-edit.tsx create mode 100644 frontend/src/pages/students/students-list.tsx create mode 100644 frontend/src/pages/students/students-new.tsx create mode 100644 frontend/src/pages/students/students-table.tsx create mode 100644 frontend/src/pages/students/students-view.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/pages/web_pages/about.tsx create mode 100644 frontend/src/pages/web_pages/contact.tsx create mode 100644 frontend/src/pages/web_pages/faq.tsx create mode 100644 frontend/src/pages/web_pages/home.tsx create mode 100644 frontend/src/pages/web_pages/services.tsx create mode 100644 frontend/src/stores/analytics/analyticsSlice.ts create mode 100644 frontend/src/stores/authSlice.ts create mode 100644 frontend/src/stores/courses/coursesSlice.ts create mode 100644 frontend/src/stores/discussion_boards/discussion_boardsSlice.ts create mode 100644 frontend/src/stores/enrollments/enrollmentsSlice.ts create mode 100644 frontend/src/stores/hooks.ts create mode 100644 frontend/src/stores/instructors/instructorsSlice.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/students/studentsSlice.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 create mode 100644 pids/backend.pid create mode 100644 pids/frontend.pid 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