Module 01
Module 01
Summary Table
Layer Technology Responsibility
Controller Handles user input, updates the model and view accordingly
How MVC Works:
1. User interacts with the View (UI)
2. View sends input to the Controller
3. Controller processes the input, calls the appropriate Model
4. Model updates data and returns the result
5. Controller passes this data to the View
6. View displays updated data to the user
Example (Full Stack Context):
Tech Stack:
• Frontend (View): React / HTML + CSS + JS
• Backend (Controller): Express.js
• Database (Model): MongoDB / MySQL
Use Case: User Registration
• View (React): Form to take user details
• Controller (Node.js/Express): Receives data via POST, validates it
• Model (Mongoose/Sequelize): Saves the user to the database
• Then sends response back → updates UI
Benefits of MVC:
• Separation of Concerns (easier to maintain)
• Scalable and testable
• Supports team collaboration (frontend/backend separation)
• Makes code reusable