Architecture Design Pattern - BadhonDatta-git/Melodise-music GitHub Wiki

MVC Design Pattern and Its Application in Our Project

What is MVC? MVC (Model-View-Controller) is a widely-used design pattern in software development that separates the application into three main components:

Model: This part is responsible for managing the data and business logic of the application. View: The View is the presentation layer that displays the data to the user. Controller: The Controller acts as an intermediary between the Model and the View, receiving user inputs and updating the View and Model accordingly. How the MVC Design Pattern is Applied in Our Project

Our project, which is a Music app named melodies, follows the MVC design pattern with clear separation of concerns. Here’s how each component fits into the MVC structure:

Model Layer (Backend/Database) The Model is the core component of the application. In our project, this is handled through PHP files and database interactions, as seen in files like:

Common files:

connect.php (DB connection)

db_config.php

Functions to fetch songs, update user info, etc.

Locations:

/AdminEnd/connect.php

/ArtistEnd/connect.php

Possibly shared models in a common Models/ directory

  1. View (User Interface) Presents data to the user. These are typically HTML/CSS with embedded PHP for dynamic data.

Admin Views:

adminHome.php

adminLogin.php

Artist Views:

artistDashboard.php

uploadSong.php

User Views:

index.php

home.php

browse.php![](C:\Users\NSU Student\Downloads)

playlist.php

Location:

/AdminEnd/

/ArtistEnd/

/UserEnd/

/index.php

  1. Controller (Handles Requests) Takes input from the user (via forms or URLs), communicates with the model, and updates the view

Melodise/ β”‚ β”œβ”€β”€ index.php β”œβ”€β”€ Controllers/ β”‚ β”œβ”€β”€ loginController.php β”‚ β”œβ”€β”€ songController.php β”‚ └── adminController.php β”‚ β”œβ”€β”€ Models/ β”‚ β”œβ”€β”€ db.php β”‚ β”œβ”€β”€ Song.php β”‚ └── User.php β”‚ β”œβ”€β”€ Views/ β”‚ β”œβ”€β”€ Admin/ β”‚ β”‚ └── adminHome.php β”‚ β”œβ”€β”€ Artist/ β”‚ β”‚ └── uploadSong.php β”‚ └── User/ β”‚ └── home.php β”‚ β”œβ”€β”€ AdminEnd/ β”œβ”€β”€ ArtistEnd/ β”œβ”€β”€ UserEnd/ └── Resources/ (for CSS, JS, images)