this is a bit of a general question that I haven't been able to find an answer to online.
I have just started to dabble in React and Next.JS and would like to create my own project with Next.js to enhance my learning.
I would like to create a point of sale system using next.js and am thinking that calculations of sales tax etc should happen serverside rather than client side (understand that anyone can read you client side code). i do know that the calculation of sales tax is no big secret, but i'm just doing this to learn the principles :)
so my question is
- Am I wrong that it is not safe to keep all business logic in the frontend (such as some proritetary calculation)?
- If i hence was going to do my calculation in the backend, where would I do them? a function in Express?
hope someone can help.