Giter Site home page Giter Site logo

sparked-next's Introduction

Gitpod Ready-to-Code

Sparked-next

This is an actively maintained new version of SparkEd, Your feedback & contributions are greatly appreciated.

Note: We only support Node^18

For Contributors

Read the Code of Conduct here

The project uses the following stack

  • Nextjs as the overall framework
  • React as the User Interface library
  • eslint to lint files
  • MongoDB as a noSql Database
  • TailwindCSS for styling

Development

Clone the repo

git clone https://github.com/olivierjm/sparked-next.git cd sparked-next

Install dependencies

yarn

Run the application

yarn run dev

Using Docker

Install Docker on your machine, for better performance install https://orbstack.dev/ instead of docker Run your container: docker-compose up dev.

Contribution

Fork this repo

Clone your forked repo

git clone https://github.com/your-github-username/SparkEd.git

Add this repo to your remotes as upstream.

git remote add upstream https://github.com/olivierjm/sparked-next

Before pushing anything to your fork, always

git pull upstream master

Make sure your commit messages should be clear not vague e.g "Changes and Updates made" Work from a branch other than main whenever possible and branch name should be clear Write clean and transparent code which is easy to maintain When making PRs, give clear descriptions of the changes you made. Make sure that all pipelines are passing

linting

yarn run lint

Before you make commit, make sure that the linting are passing, check with the eslintrc.yml to check the rules.

Issues

Check here for issues, urgent issues that need attention are pinned on top of other issues. feel free to file an issue if you are experiencing a problem or dive in the existing ones to contribute.

sparked-next's People

Contributors

bmuks avatar brianmuks avatar mikemtdev avatar olivierjm avatar renovate[bot] avatar yewomhango avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

sparked-next's Issues

Improve the resource view section

The left section here should maybe list all courses(grades) then on dropdown the units

The top part that currently shows tags maybe should show all topics based on currently selected grade/units, then for the resources since these are likely to be many, we should make the cards a little bit smaller to accommodate more in a view.

This is also one example where the #62 will work since we don't want to fetch all the resources, we can show 20 by default and then as they scroll we fetch more, we can use this or something better if there's https://github.com/ankeetmaini/react-infinite-scroll-component#readme

Screenshot 2024-04-11 at 07 04 01

Fix error 500 on /library

It seems server side rendered pages are failing with error 500, This is happening in the production url and on all active PR preview links

Screenshot 2024-06-02 at 00 56 19

Ability to create categories

These will be used to categorize contents.

e.g:

  • Text Books
  • Syllabus
  • Supplementary videos
  • Stem Power
  • Simulated Laboratory Videos
  • Reference Books
  • Laboratories
  • Human Anatomy
  • ESTP (Grade 11 And 12 Revision)
  • Educational Plasma Programs
  • Addis Ababa Education Bureau

setup docker & its instructions

Since Sparked will be distributed to different setup with different operating systems, we need a docker option that allows a smooth way to run a production version of this.

On the dashboard the whole page should not be scrollable

So basically we should not scroll the whole page together sidebar, the sidebar should always be shown as it is and only scroll the table itself(when we have infinite scroll or load more fetch) if not then we should show what fits on the table and the rest we paginate.

Return correct status codes

@brianmuks I have noticed that in lots of places in BE we are returning 200 when instead it should be an error maybe 500 or something close to it.
Can we handle these properly to make sure we are properly communicating with the frontend.

Allow to dynamically search and choose other collections

When creating a grade for example we should choose a school
When creating a course we need to select a grade, instead of preloading all courses we should have an autocomplete, limit list to like 10 items and the rest can be searched, this should be similar to subjects/units/topics

Implement a global search

We should be able to do a debounced search for topics and resources, fetch should offer suggestions to make it easier for users.

URGENT - Convert endpoints to GET

For better performance and to be able to achieve this #60 we need to have fetch endpoints as GET instead of POST.

For dashboard

  • fetch courses
  • fetch units
  • fetch topics
  • fetch media contents

For client

  • fetch units
  • fetch topics
  • fetch media contents
  • fetch individual media content.

@brianmuks this is blocking #60 it would be great if we can start on this especially dashboard links.

Clean up the build errors & warnings

@brianmuks this is my build log on my local, we should clean it up and make sure we are using the best nextjs practices

yarn run v1.22.19
$ next build
- info Loaded env from /Users/olivierjm/sparked-next/.env
- info Creating an optimized production build
- info Compiled successfully

./src/app/library/media/[id]/page.tsx
18:6  Warning: React Hook useEffect has missing dependencies: 'fetchMediaContentById' and 'params.id'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps
41:15  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element

./src/components/courses/courseListView.tsx
34:6  Warning: React Hook useEffect has a missing dependency: 'fetchCourses'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
34:7  Warning: The 0 literal is not a valid dependency because it never changes. You can safely remove it.  react-hooks/exhaustive-deps

./src/components/layouts/library/index.tsx
60:6  Warning: React Hook useEffect has missing dependencies: 'fetchPrograms' and 'fetchSchools'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/media-content/FileUploadSection.tsx
45:11  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
67:9  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element

./src/components/media-content/media-content-list-view.tsx
39:6  Warning: React Hook useEffect has a missing dependency: 'fetchMediaContent'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/programs/programListView.tsx
34:6  Warning: React Hook useEffect has a missing dependency: 'fetchPrograms'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/school/schoolsListView.tsx
40:6  Warning: React Hook useEffect has a missing dependency: 'fetchSchools'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/topic/topics-list-view.tsx
34:6  Warning: React Hook useEffect has a missing dependency: 'fetchTopics'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/units/unitListView.tsx
34:6  Warning: React Hook useEffect has a missing dependency: 'fetchUnits'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/users/UsersListView.tsx
36:6  Warning: React Hook useEffect has a missing dependency: 'fetchUnits'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

./src/components/welcomePage/HeroSection.tsx
21:13  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
- info Linting and checking validity of types
- info Collecting page data ..(node:66825) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
- info Collecting page data
[=   ] - info Generating static pages (0/30)i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
i18next: languageChanged en
i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
[Arguments] {
  '0': { disabled: false, name: 'name', label: undefined, required: true },
  '1': {}
}
[Arguments] {
  '0': { disabled: false, name: 'name', label: undefined, required: true },
  '1': {}
}
[Arguments] {
  '0': {
    disabled: false,
    name: 'description',
    label: undefined,
    required: true
  },
  '1': {}
}
[Arguments] {
  '0': {
    disabled: false,
    name: 'description',
    label: undefined,
    required: true
  },
  '1': {}
}
- warn Entire page /admin/courses/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/courses/edit
i18next: languageChanged en
i18next: initialized {
  debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'dev' ],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: '.',
  nsSeparator: ':',
  pluralSeparator: '_',
  contextSeparator: '_',
  partialBundledLanguages: false,
  saveMissing: true,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: {
    escapeValue: true,
    format: [Function: bound format],
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    unescapePrefix: '-',
    nestingPrefix: '$t(',
    nestingSuffix: ')',
    nestingOptionsSeparator: ',',
    maxReplaces: 1000,
    skipOnVariables: true
  },
  lng: 'en',
  resources: { en: { translation: [Object] } },
  ignoreJSONStructure: true
}
- warn Entire page /admin/media-content/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/media-content/edit
[Arguments] {
  '0': { disabled: false, name: 'name', label: undefined, required: true },
  '1': {}
}
i18next::translator: missingKey en translation confirm_action confirm_action
[==  ] - info Generating static pages (5/30)i18next::translator: missingKey en translation search_courses search_courses
[Arguments] {
  '0': { disabled: false, name: 'name', label: 'Name', required: true },
  '1': {}
}
[Arguments] {
  '0': {
    disabled: false,
    name: 'description',
    label: 'Description',
    required: true
  },
  '1': {}
}
i18next::translator: missingKey en translation Program Program
- warn Entire page /admin/schools/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/schools/edit
[Arguments] {
  '0': { disabled: false, name: 'name', label: 'Name', required: true },
  '1': {}
}
- warn Entire page /admin/topics/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/topics/edit
[Arguments] {
  '0': {
    disabled: false,
    name: 'description',
    label: 'Description',
    required: true
  },
  '1': {}
}
[Arguments] {
  '0': { disabled: false, name: 'name', label: 'Name', required: true },
  '1': {}
}
[Arguments] {
  '0': {
    disabled: false,
    name: 'description',
    label: 'Description',
    required: true
  },
  '1': {}
}
i18next::translator: missingKey en translation Program Program
i18next::translator: missingKey en translation Program Program
- warn Entire page /admin/units/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/units/edit
- warn Entire page /admin/users/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/users/edit
i18next::translator: missingKey en translation Program Program
i18next::translator: missingKey en translation search_units search_units
i18next::translator: missingKey en translation search_programs search_programs
i18next::translator: missingKey en translation search_media_content search_media_content
i18next::translator: missingKey en translation search_units search_units
- warn Entire page /admin/programs/edit deopted into client-side rendering. https://nextjs.org/docs/messages/deopted-into-client-rendering /admin/programs/edit
i18next::translator: missingKey en translation search_schools search_schools
- info Generating static pages (30/30)
- info Finalizing page optimization

Route (app)                                Size     First Load JS
┌ ○ /                                      53.2 kB         659 kB
├ ○ /admin                                 529 B           748 kB
├ ○ /admin/courses                         4.84 kB         766 kB
├ ○ /admin/courses/create                  2.99 kB         762 kB
├ ○ /admin/courses/edit                    3.05 kB         762 kB
├ ○ /admin/media-content                   6.25 kB         768 kB
├ ○ /admin/media-content/create            1.13 kB         764 kB
├ ○ /admin/media-content/edit              1.21 kB         765 kB
├ ○ /admin/programs                        3.54 kB         764 kB
├ ○ /admin/programs/create                 1.64 kB         761 kB
├ ○ /admin/programs/edit                   1.72 kB         761 kB
├ ○ /admin/schools                         28.2 kB         806 kB
├ ○ /admin/schools/create                  2.7 kB          760 kB
├ ○ /admin/schools/edit                    2.76 kB         760 kB
├ ○ /admin/topics                          6.11 kB         767 kB
├ ○ /admin/topics/create                   2.63 kB         765 kB
├ ○ /admin/topics/edit                     2.68 kB         765 kB
├ ○ /admin/units                           5.52 kB         766 kB
├ ○ /admin/units/create                    1.07 kB         763 kB
├ ○ /admin/units/edit                      1.16 kB         763 kB
├ ○ /admin/users                           2.37 kB         750 kB
├ ○ /admin/users/create                    33.4 kB         805 kB
├ ○ /admin/users/edit                      1.16 kB         763 kB
├ λ /api/auth/[...nextauth]                0 B                0 B
├ λ /api/authentication/[slug]             0 B                0 B
├ λ /api/course/[slug]                     0 B                0 B
├ λ /api/file-upload/[slug]                0 B                0 B
├ λ /api/media-content/[slug]              0 B                0 B
├ λ /api/program/[slug]                    0 B                0 B
├ λ /api/school/[slug]                     0 B                0 B
├ λ /api/topic/[slug]                      0 B                0 B
├ λ /api/unit/[slug]                       0 B                0 B
├ ○ /auth/login                            3.14 kB         707 kB
├ ○ /auth/signup                           3.13 kB         707 kB
├ ○ /favicon.ico                           0 B                0 B
├ ○ /library                               3.38 kB         622 kB
├ λ /library/media/[id]                    108 kB          836 kB
└ ○ /portal                                966 B           603 kB
+ First Load JS shared by all              553 kB
  ├ chunks/2234-4730a22451ed1ea6.js        15.1 kB
  ├ chunks/596-725fa13c10229e7a.js         26.2 kB
  ├ chunks/82240af4-f0018250e32e564a.js    28.9 kB
  ├ chunks/8bbc9ccd-701eb7bf73a8e345.js    430 kB
  ├ chunks/fd9d1056-890a99abdda3e0c9.js    50.5 kB
  ├ chunks/main-app-352c5f1f25c2c513.js    225 B
  └ chunks/webpack-b2cfb766613d1faa.js     1.82 kB

Route (pages)                              Size     First Load JS
─ ○ /404                                   185 B          76.9 kB
+ First Load JS shared by all              76.7 kB
  ├ chunks/framework-4498e84bb0ba1830.js   45.1 kB
  ├ chunks/main-604b61fbb55745da.js        29.6 kB
  ├ chunks/pages/_app-8af45f6c5c3cbc8e.js  201 B
  └ chunks/webpack-b2cfb766613d1faa.js     1.82 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)

✨  Done in 117.23s.

We should also aim to have all these in green for an optimum build

Screenshot 2024-04-17 at 06 31 36

JSON configuration file

Since we don't have a settings page to configure certain things I'd prefer we start with a JSON file and then read from that, this is what we used in the previous version https://github.com/SparkEdUAB/SparkEd/blob/master/config.json and we can extend this with other configs.

{
  "name": "Inspired",
  "tag": "To Inspire",
  "isUserAuth": false,
  "isHighSchool": false,
  "isConfigured": true,
  "server": "http://localhost:3000"
}

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update dependency @types/node to v20.16.1
  • Update react monorepo (@types/react, @types/react-dom)
  • Update dependency @openpanel/nextjs to v1
  • Update dependency react-i18next to v15
  • Update typescript-eslint monorepo to v8 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
docker/Dockerfile.dev
  • node 20
  • node 20-alpine3.19
docker/Dockerfile.prod
  • node 20
  • node 20-alpine3.19
github-actions
.github/workflows/codeql.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/greetings.yml
  • actions/first-interaction v1
.github/workflows/sanity.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • actions/cache v4
.github/workflows/staleprs.yml
  • actions/stale v9
npm
package.json
  • @auth/mongodb-adapter ^3.0.0
  • @aws-sdk/client-s3 ^3.598.0
  • @headlessui/react ^2.0.0
  • @highlight-run/next ^7.5.4
  • @intelllex/react-pdf 0.0.1
  • @openpanel/nextjs ^0.0.8-beta
  • @types/node 20.14.13
  • @types/react 18.2.20
  • @types/react-dom 18.2.7
  • axios ^1.5.0
  • bcryptjs ^2.4.3
  • eslint 8.57.0
  • eslint-config-next ^14.2.3
  • flowbite ^2.0.0
  • flowbite-react ^0.9.0
  • i18next ^23.11.1
  • i18next-resources-to-backend ^1.2.1
  • jsonwebtoken ^9.0.2
  • mongodb ^6.1.0
  • next ^14.2.3
  • next-auth ^4.23.1
  • next-nprogress-bar ^2.3.4
  • react ^18.3.1
  • react-dom ^18.3.1
  • react-dropzone ^14.2.3
  • react-i18next ^14.1.0
  • react-icons ^5.0.1
  • react-infinite-scroll-component ^6.1.0
  • react-loading-skeleton ^3.4.0
  • realm ^12.1.0
  • sharp ^0.33.4
  • swr ^2.2.5
  • typescript 5.5.4
  • zod ^3.23.8
  • zod-form-data ^2.0.1
  • @types/formidable ^3.4.5
  • @types/jsonwebtoken ^9.0.6
  • @typescript-eslint/eslint-plugin ^6.21.0
  • @typescript-eslint/parser ^6.21.0
  • autoprefixer ^10.4.15
  • eslint-config-prettier ^9.1.0
  • lint-staged ^15.0.0
  • nodemailer ^6.9.5
  • postcss ^8.4.28
  • tailwindcss ^3.3.3
  • yarn 1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e

  • Check this box to trigger a request for Renovate to run again on this repository

Create a multi tenant architecture to allow one school per login

This way depending on either subdomain or who’s logged we can know which school or organization we are in instead of having multiple instances.

When create a user, they should select which school/institution they belong to so that when logging we know what to show them, if there's only one institution then we default to that one without asking the users.

Add basic stats on the dashboard

When a user is logged in, we should show sample statistics on this route /admin/dashboard

  • How many topics created
  • How many units
  • How many uploaded resources
  • How many users
  • Frequency of how resources are viewed (later)

setup tests - unit & e2e

before this is fully published we need to have a coverage of some tests then move on from there with end to end tests as well.

Add Grades

We should have ability for grades under a school

Optmize all endpoints by removing unnecessary calls

@brianmuks I still see that we are fetching schools & programs every time when creating somethings for example in this file https://github.com/OlivierJM/sparked-next/blob/main/src/app/api/media-content/create.ts and other examples we should avoid doing any db actions that don't need and minimise the ones we need to speed up the app.

This is just for media content, but we should do it for other collections as well, maybe once we have more than 10k items in one collection, it will take a long time to go through different collections before it can yield results.

Clean up errors

currently most errors are coded like 502, 101, etc ... which doesn't make sense to the end user, we should make these readable.

Remove requirement for thumbnail upload

Most users won't know what a thumbnail is, I think we should find some mechanism to auto create it on the server or use some placeholder markers for certain types of resources.

Replace primitive fetch with SWR/SSR across the code

I have noticed that we are not taking advantages of the best features that nextjs offers from the alternatives and because of this we lose out on performance.

So for pages that don't need realtime data or any type of immediate refetch, example user facing pages where we load either topics and their resources, we should use server side rendering ref: https://nextjs.org/docs/pages/building-your-application/rendering/server-side-rendering or SSG depending on what works best for our use case https://nextjs.org/docs/pages/building-your-application/rendering/static-site-generation
This will simplify our code and make pages render faster and smoother.

For dashboard pages where we need to refetch the same information after certain actions, we should use CSR https://nextjs.org/docs/pages/building-your-application/rendering/client-side-rendering (scroll down to swr) direct link here https://swr.vercel.app

ref: https://swr.vercel.app/docs/with-nextjs
With this we will have automatic caching and faster performance for our pages.

Filter like for user library

When navigating in the library, we need to imitate the filters they have here https://www.alemhulu.com

Ability to choose a grade first

Screenshot 2024-05-10 at 3 10 56 PM

Then subjects will only be those from the grade previously selected

Screenshot 2024-05-10 at 3 11 19 PM

Then so on for units, topics categories and media types as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.