Next.js scalable architecture template #33732
Unanswered
shreyas-jadhav
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i recently made this Next.js template made with
next-auth
, Material UI, mongodb nodejs driver, Joi Validation &react-hook-from
. It has everything set up in place to get started.Server and Client folders contains the separated code.. further divided in controllers, dals (data access layers) which can allow easily switching databases. Server has controllers made in such way to easily switch to express when needed. And there is automatic error handling in APIs and also client.
models folder which can contain all typescript interfaces and Joi schemas which will validate in both server side and client side.
react-hook-form
blends well with joi schemas and super useful to avoid writing lot of code.next-auth
is already setup.. you can plug your own providers and configuration, and basics work.There are also helper components and middlwares already built, like
withAuth
(sends 403) andAuthRequried
(shows login if not auth) which can be used to wrap controllers / components.There are lot of things to know more about, I recommend reading here https://next-architecture-docs.vercel.app/.
or you can checkout the code itself: https://github.com/shreyas-jadhav/next-architecture-template
Beta Was this translation helpful? Give feedback.
All reactions