Architecture - acreid77/top-knowledge GitHub Wiki

Tech stack

The project will be implemented on MERN stack - MySQL or PostgreSQL, Express.js, React, Node.js. We will use multilayered architecture - Next.js and React on the frontend and Express REST API on the backend.
The knowledge project should be SEO-friendly as much as possible. When users search specific keywords in popular search engines like Google, they should get our website page as a result, just like we get Wikipedia links in all search results. This goal will be impossible to achieve with a simple React SPA. Google can't scrape SPAs well. So we need Server Side Rendering and the best solution for this issue nowadays is Next.js.

MERN

Front end

We will use popular React technologies:

  • Next.js
  • React Hooks
  • Functional components
  • Redux for global state management
  • Material-UI as an UI framework
  • Axios for communication with back end
  • Notistack for notifications.
  • Make sure to use virtualization for long lists(like news feed) not to overload page with a lot of DOM elements.
  • Use memoization where really needed (React.memo, PureComponent, useMemo, useCallback...),
  • Include CRM and CMS integration.

Back end

  • MySQL or PostgreSQL to communicate with SQL database, create DB schema, add to DB models, add middlewares (pre/post hooks), add pagination support for some endpoints, add validation plugins.
  • Use Express-validator to validate http request body, parameters, query parameters.
  • Extensively use Express middlewares for authentication, user role checking, validation error handling. This will make architecture much simpler and easier to add new features.
  • JsonWebToken for authentication.
  • Sendgrid to send emails.
  • Follow all the industry standards for security (like not saving passwords but "salting" and hashing it with bcryptjs).
  • We will store image files in AWS S3
  • Include CRM and CMS integration.

Mobile Application

We are going to have one code base for iOS and Android not to spend too much resources. React Native is the best choice to build such cross-platform mobile apps.

Testing

We will have all types of tests: