Frontend vs Backend Responsibility

Full-stack apps become messy when frontend and backend responsibilities are unclear.

React and Express should not do the same job.

Frontend responsibility

React should handle:

Backend responsibility

Express/Node should handle:

Example

Frontend can check:

Password must be at least 8 characters.

Backend must also check it.

Why? Because anyone can bypass React and call the API directly.

Simple rule

If it affects security, data correctness, permissions, or secrets, it belongs on the backend.

If it affects presentation and user interaction, it belongs on the frontend.

Interview answer

In MERN, React is responsible for UI, interactions, client-side state, and calling APIs. The backend is responsible for authentication, authorization, validation, business rules, database operations, and secrets. Frontend validation improves UX, but backend validation is required for correctness and security.