More best practices: Make sure to make authorization checks on every server action and route handler. After all they’re public endpoints and anyone can hit them from anywhere. One thing you could do is moving the database access/request logic part into functions in a separate folder and create a *data access* layer and make sure database read and write operations are always protected and execute after the USER HAS BEEN AUTHORIZED, then you can use these functions inside server actions (for the mutations - “write” logic ) and directly inside server components (for getting data - “read” logic). By the time the function executes you’ll be guaranteed the user can perform the operation.
Yes caching really is a hard topic to explain because there is a lot to handle I think I will make a video when Next 15 is dropping so in a few weeks I guess
More best practices:
Make sure to make authorization checks on every server action and route handler. After all they’re public endpoints and anyone can hit them from anywhere.
One thing you could do is moving the database access/request logic part into functions in a separate folder and create a *data access* layer and make sure database read and write operations are always protected and execute after the USER HAS BEEN AUTHORIZED, then you can use these functions inside server actions (for the mutations - “write” logic ) and directly inside server components (for getting data - “read” logic).
By the time the function executes you’ll be guaranteed the user can perform the operation.
@@Luisllaboj19 Great Addition, thank you!
Great video, I'd love to watch a caching video :D
Noted!
I’d like to see more depth videos for caching and seo. Came for i18n tutorial stuck watching the rest of the channel 😂
@@Serkan_Durgun thank man! I really appreciate that!!
such a good video, really want you to make a video explaining cache in detail, since the resources online rn are just too confusing
Yes caching really is a hard topic to explain because there is a lot to handle I think I will make a video when Next 15 is dropping so in a few weeks I guess
just use the app router bruv
I do 🧐
@@tobitacklestech it's a meme! please keep making nextjs projects and tutorials
@@cant_sleeeep haha okay ✌🏼✌🏼