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
- 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
playlist.php
Location:
/AdminEnd/
/ArtistEnd/
/UserEnd/
/index.php
- 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)