Source: cirosantilli/sponsor/updates/4/further-improvements-to-the-website-s-base-technology

= Further improvements to the website's base technology

https://github.com/cirosantilli/node-express-sequelize-nextjs-realworld-example-app contains the same baseline tech as OurBigBook, and I have been use to quickly test/benchmark new concepts for the website base.

I'm almost proud about that project, as a reasonable template for a Next.js project. It is not perfect, notably see issues on the issue tracker, but it it quite reasonable.

<The side effects of ambitious goals are often the most valuable thing achieved> once again? I to actually make the project be more important thatn the side effects this time, but we'll see.

Since the last update, I've made some major improvements to the baseline tech of the website, which I'll move little by little into OurBigBook. Some of the improvements actually started in OurBigBook.com. The improvements were:
* got a satisfactorily comprehensive linting working at: https://github.com/cirosantilli/node-express-sequelize-nextjs-realworld-example-app/commit/bf2eec3537a70e56b89e6e3cc3e546610cf8f51c[this commit]. Nothing is easy, not even that! Part of the wisdom extracted to: https://stackoverflow.com/questions/58233482/next-js-setting-up-eslint-for-nextjs/70519682#70519682[].
* fully rationalized directory structure to avoid nasty errors that show up in <Next.js> when accidentally requiring backend stuff on the client. https://github.com/cirosantilli/node-express-sequelize-nextjs-realworld-example-app/commit/67962af74b5c7e5efe9b3af168763d16a2e7c9f0[Commit]. A detailed explanation of this was extracted to: https://stackoverflow.com/questions/64926174/module-not-found-cant-resolve-fs-in-next-js-application/70363153#70363153[].
* create an extremely clean and rationalized way to do API tests from a simple `npm test`. These now actually start a clean server, and make full HTTP requests to that server. https://github.com/cirosantilli/node-express-sequelize-nextjs-realworld-example-app/commit/9ee4962b04d75399bf8ab04ae0540e5d039cff45[Commit]. Wisdom extracted to: https://stackoverflow.com/questions/63762896/whats-the-best-way-to-test-express-js-api/70479940#70479940[].
* greatly reduce the number of SQL queries, fully understood every problem 
  * more intelligently using JOINs where I have managed to get <Sequelize> to do what I fucking want. This also led to several sequelize Stack Overflow answers as usual: https://stackoverflow.com/search?tab=newest&q=user%3a895245%20%5bsequelize%5d

    Everything that I didn't manage to do because of crappy sequelize is documented at: https://github.com/cirosantilli/node-express-sequelize-nextjs-realworld-example-app/issues/5
  * better understanding Next.js/React/useSWR do avoid doing double API queries