r/Backend • u/draeky_ • Jun 13 '26
How to design backend before actually coding it
Im working on a e commerce website using spring boot.
Initially i have created end point ' /products ' and written CRUD functions in ProuctController.java and follwed MVC architecture and also connected database also. (Spring Data JPA)
Then using antigravity i cteated a react project with prompt explaining my project.
Now im confused! How to proceed writing backend.
Like for every button i should be writing a API.
Or for every table in my database i need to write CRUD functions.
Help!
28
Upvotes
14
u/dbsaw Jun 13 '26 edited Jun 13 '26
You need to get back to the fundamentals. The backend handles all the processes that the user doesn't see. For example, the user wouldn't care which database you are using; this is your choice depending on your preference and the business needs. Starting with CRUD for all tables is a great starting point, and most of the time, yes, you'll need that. However, moving forward, you might see that some entities don't need an endpoint because they are either unused or would create some vulnerabilities. You'll gain this knowledge as you get more experience. Do you need an endpoint for each button? Maybe it depends on your business needs, but as I mentioned earlier, anything related to the UI that can be displayed to the user without touching the backend, like the logo or about us page, can technically be served by the backend, but I think they fit the front-end more. Again, there is no standard way of doing things; it's all about trade-offs. The nice thing about software development is that you can do whatever you want, however you want, and most of the time, it's free. If you don't get it right the first time, you'll most likely learn a lot. Good luck!
6
u/[deleted] Jun 13 '26
[removed] — view removed comment