MUSIC SELL AND BUY WEBAPP
A PROJECT REPORT
Submitted by
PINTU KUMAR PASWAN (61232112048)
VIKASH KUMAR (61232112074)
VIPIN KUMAR (61232112075)
in partial fulfillment for the award of the degree
of
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
SENGUNTHAR ENGINEERING COLLEGE TIRUCHENGODE
(AUTONOMOUS)
ANNA UNIVERSITY : CHENNAI 600 025
MAY 2025
BONAFIDE CERTIFICATE
Certified that this project report “MUSIC SELL AND BUY WEBAPP” is
the bonafide work of “PINTU KUMAR PASWAN (61232112048),VIKASH
SIGNATURE KUMAR
(61232112074),VIPIN KUMAR(61232112075),”who [Link].M.E.,
out the Project Report under
my supervision. SUPERVISOR
Assistant Professor/CSE (CS),
SIGNATURE [Link],M.E., Dept of Computer Science &
Ph.D HEAD OF THE DEPARTMENT Engineering (Cyber Security),
Sengunthar Engineering College
Professor,
(Autonomous),
Department of Computer Science and
Tiruchengode 637205.
Engineering,
Sengunthar Engineering College
(Autonomous),
Tiruchengode - 637205.
Submitted for the Project Phase – II examination and Viva Voice held on ………………
INTERNAL EXAMINER EXTERNAL EXAMINER
ii
ACKNOWLEDGEMENT
We wish to express our sincere thanks to our honorable Chairman
[Link] Sengunthar Institutions, Tiruchengode for providing
opportunity to do this project
We wish to extend our heartfelt thanks to our honorable Secretary and
Correspondent [Link], M.A., [Link], and other respected
Trust members for providing us with all the facilities to develop the project
successfully.
We would like to express our sincere gratitude to our beloved Principal
Dr. R. SATISH KUMAR M.E., Ph.D., for rendered us moral support in our
endeavour.
We feel elated by the encouragement of our Head of the Department of
Computer Science and Engineering [Link],M.E.,Ph.D, for
motivating throughout the completion of this project.
We thank [Link],M.E., the project coordinator for having
provided us the unfathomable support and facility to complete this project successfully.
We glad to express our thanks to Mrs. [Link], M.E who has guided us in the
apt way to get the expected results in this project.
We submit our whole hearted thanks to all our Staff members of the
Department of Computer Science and Engineering, for their invaluable cooperation
and immeasurable timely help.
We thank GOD the almighty for showing the right way to travel in untrodden
ways.
iii
ABSTRACT
This project details the development of a web application called“Melodyne "
designed to equip sales teams with the tools and insights needed to consistently
exceed their quotas. Music Selling tackles the challenges of traditional sales
methodologies by providing a centralized platform for managing prospects, tracking
interactions, and optimizing the sales process. The application leverages data
analytics to identify sales trends, pinpoint areas for improvement, and personalize
outreach strategies. Key functionalities include prospect management with detailed
profiles, activity tracking with automated logging, and data-driven sales pipelines for
clear visibility into deal progress. By streamlining workflows, enhancing
communication, and fostering data- backed decision-making, Melodyne empowers
sales teams to close more deals and achieve superior sales performance.
This project report provides a comprehensive overview of the web application,
detailing its conceptualization, design, development, and deployment. The platform
is designed to cater to two primary user groups: producers and buyers (artists).
Producers can create accounts, upload their beats, set prices, and manage their beat
portfolios, while buyers can search for beats based on genres, moods, and tempo,
preview tracks, and purchase them securely. The application is built on the MERN
stack, offering a modern, scalable, and efficient solution to handle the dynamic
needs of the music marketplace.
At the heart of this project is the goal to simplify the transaction process between
music producers and artists. Traditionally, the process of selling and buying beats
has been fragmented, often requiring producers to rely on social media, third-party
marketplaces, or direct messaging to facilitate sales. This web application
consolidates these functions into a single, integrated platform, enhancing the user
experience and enabling secure, efficient transactions.
1
TABLE OF CONTENTS
CHAPTER NO TITLE PAGE
NO ABSTRACT
1 INTRODUCTION 4
2 OBJECTIVE 5
3 LITERATURE REVIEW 6
4 SYSTEM ANAYLASIS 7
4.1 Existing System
4.11 Disadvantage
4.2 Proposed System
4.21 Advantage
5 SYSTEM REQUIREMENT 10
6 DESCRIPTION 12
6.1 Data Flow Diagram
6.2 Modules
6.3 Module Description
6.4 System Implementation
7 CONCLUSION 21
8 FUTURE ENCHANCEMENT 23
9 SOURCE CODE 25
10 OUTPUT 30
11 REFRENCES 36
2
LIST OF FIGURES
Fig No Topic Name Page No
4.1 System Anaylysis 7
5.1 Hardware Requirement 10
5.2 Software Requirement 11
6.1 User features 12
6.2 Seller features 14
6.3 Buyers Features 15
6.4 Management 16
6.5 System Implementation 19
7.1 Conculation 21
8.1 Future Enhacement 23
3
CHAPTER 1
1. INTRODUCTION
The ever-growing music production landscape demands efficient tools for both creators and
consumers. Music makers struggle to find a platform that simplifies the process of
uploading, showcasing, and selling their music, while music producers and artists
often face difficulty in discovering high-quality of music that fit their creative vision.
This web application aims to bridge this gap by providing a user- friendly platform
specifically designed for music selling. It empowers music makers to establish an
online presence, manage their music library, and connect directly with potential
buyers. Artists and producers will benefit from a streamlined browsing experience
with advanced search filters and secure purchasing options, allowing them to find
the perfect music to fuel their musical endeavors. This project will address the
current limitations by offering a comprehensive solution for both sides of the music
selling market.
The music industry has seen rapid digitalization, and with the rise of independent artists and
producers, the demand for high-quality, accessible beats has grown exponentially.
This project focuses on developing a beat selling and buying web application that
connects music producers with artists and creatives who need instrumental tracks for
their projects. Built using the Mern stack (MongoDB, Express, React, [Link]), this
web application provides a seamless platform where producers can upload and sell
their beats, while buyers can browse, listen, and purchase these beats with ease.
The web app not only streamlines the process of beat transactions but also fosters a creative
marketplace where collaboration between artists and producers is encouraged.
Through this platform, the aim is to build a community-driven environment that
supports independent music production and consumption, enabling growth for both
producers and artists.
4
.
CHAPTER 2
2. OBJECTIVE
The primary objective of the Beat Selling and Buying web application is to create an
efficient, user-friendly platform that bridges the gap between music producers and
artists seeking high-quality beats. By utilizing the MERN (MongoDB, [Link],
React, and [Link]) stack, the platform aims to offer a seamless and scalable
environment for users to upload, browse, purchase, and sell beats.
For producers, the platform provides a marketplace to showcase their work to a
global audience, offering tools to easily upload, categorize, and manage their beats.
Through secure payment gateways, producers can monetize their creations, setting
their own prices and license terms. For buyers, including artists, filmmakers, and
content creators, the platform ensures an intuitive experience to discover beats that
suit their specific needs. Features like advanced search filters, genre classifications,
and previews make the process of finding the right beat quick and efficient.
Additionally, the web app focuses on maintaining security and transparency in
transactions, ensuring copyright protection and license compliance for both
producers and buyers. The overall goal is to cultivate a vibrant community that
fosters collaboration, creativity, and success in the music industry.
One of the core objectives is to empower music producers to monetize their creative
output. The application will provide them with a centralized platform to upload,
manage, and sell their beats in various licensing formats such as exclusive and non-
exclusive rights. It will also offer a customizable profile page, where producers can
showcase their brand, provide detailed information about their work, and gain
insights into customer preferences through sales analytics and feedback.
5
CHAPTER 3
3. LITERATURE REVIEW
E-commerce has transformed how artists, producers, and consumers engage with
music. the digital age has disrupted traditional music distribution, leading to a rise in
independent artists and producers who can sell their music directly to consumers
online. Platforms like iTunes and Bandcamp have demonstrated the viability of
digital music sales, allowing creators to reach global audiences without major record
labels.
As Choi and Burnes (2008) noted, the evolution of the music marketplace from
physical to digital formats allowed artists to take greater control over their content,
and beat-selling websites have further facilitated this trend by providing producers
with a way to sell music beats directly to buyers, including other artists, content
creators, and businesses
Security in online transactions is vital to building trust in digital marketplaces. A
study by Abuhamad et al. (2020) discusses the importance of integrating secure
payment gateways like PayPal or Stripe upi to safeguard user data and prevent fraud.
Additionally, ensuring secure cloud storage for beats and user accounts is essential
for protecting digital content. SSL encryption, multi-factor authentication, and
secure cloud solutions are common features implemented by leading beat-selling
platforms.
Online beat-selling platforms such as BeatStars and Airbit have emerged as
intermediaries between producers and buyers, offering tools that streamline the
process of uploading, tagging, selling, and licensing beats. Both platforms allow
producers to keep ownership of their work while giving them access to a global
customer base. Studies by Johnson and Sundararajan (2018) show that these
platforms have fostered a competitive marketplace where quality and niche
specialization often drive success.
6
CHAPTER 4
4. SYSTEM ANALYSIS
Fig: 4.1 System Analysis
4.1 EXISTING SYSTEM
Melodyne is one of the online platforms for buying and selling beats, Producers
can sell beats using different licensing options, including non-exclusive leasing and
exclusive rights. The platform integrates with PayPal and Stripe for secure
transactions, making it easy for users to receive payments. Melodyne allows users
to create custom stores to sell their music, offering various design tools and
customization features. Users can collaborate with other producers and artists
directly on the platform, enhancing the social aspect of music creation. Free and
premium membership options are available, with the premium tier offering more
uploads, analytics, and promotional tools.
7
Users can track sales, play counts, and other metrics to analyze how their beats are
performing in the marketplace. The marketplace offers a clean, searchable interface
where buyers can filter beats by genre, mood, tempo, and other criteria. Users can
earn through beat sales, licensing, and synchronization opportunities
4.1.1 DISADVANTAGES
One of the significant challenges in the beat-selling industry is the saturation of the
market. Platforms like BeatStars and Airbit host millions of beats, making it
difficult for new or less-established producers to stand out. With so much
competition, producers might prioritize quantity over quality, diluting the overall
value of the marketplace. If a beat is sold under multiple non-exclusive licenses, it
can create confusion about who holds the rights to use the beat in commercial
projects, which may lead to legal disputes.
8
PROPOSED SYSTEM
The Melodyne music selling application will comprise several core modules:
User Management for handling user accounts Authentication, and Profiles.
Music Catalog for storing and managing music metadata, including artists,
albums, songs, and pricing.
Payment Gateway for processing transactions securely.
Content Delivery Network (CDN) for efficient music streaming and downloads.
Analytics for tracking user behavior, sales, and performance metrics.
Admin Panel for managing the platform, users, and content.
Playlist Management, and Social Features for enhancing user experience and engagement.
4.1.2 ADVANTAGES
A beat-selling and buying web application offers numerous advantages for both
producers and buyers, leveraging technology to streamline music transactions and
reach a global audience. A web application allows music producers to reach a
global audience without geographical limitations. Independent producers can
showcase and sell their beats to artists, content creators, and businesses worldwide,
significantly expanding their potential market. Buyers can easily access a vast
catalog of beats from producers across the globe, providing a wider range of music
styles, genres, and price points than what may be available locally. Producers can
generate income directly from their beats without relying on third parties like
record labels or distributors. This reduces intermediary costs and ensures that
producers retain a larger share of their earnings.
9
CHAPTER 5
5. SYSTEM REQUIREMENT
HARDWARE:
Processor : Intel Core i3
RAM : Minimum 4 GB
Storage : Minimum 256 GB SSD
Network : Stable internet connection
Keyboard : Standard Keyboard
Scroll Mouse : Standard Mouse
Fig: 5.1 Hardware Requirement
10
SOFTWARE:
Operating System : Windows
Programming Languages : Javascript
Libraries and Frameworks : React,Nodejs,Expressjs
Database : Mongodb
IDE : Visual Studio Code
Version Control : Git
Fig: 5.2 Software Requirement
11
CHAPTER 6
6. DESCRIPTION
DATA FLOW DIAGRAM
Fig: 6.1 User Features
12
Users start by creating an account, entering their credentials, and registering on the
platform. This input is processed by the system, storing user details in the
[Link] registration, users create or update their profile. This includes their
preferences, bio, and any other relevant information. The system uses this data to
customize the user experience. Once logged in, users can build a library of their
favorite songs, playlists, and albums. The system saves these preferences, offering
personalized content based on their library choices. Users can create, manage, and edit
playlists. The system allows them to group songs for easy playback. Playlists are stored
in the user's account, allowing for easy access across devices. Users can browse artist
and album profiles. These profiles contain information about the music creators and
their albums, which the system retrieves and presents dynamically from the database.
The platform features a music player that allows users to listen to songs from their
library or playlists. The system streams the selected songs through the player interface.
13
6.1 MODULES
Fig: 6.1 Seller Features
For Music Sellers:
Music Management
Pricing and Licensing
Secure Sales Platform
Customer
Management
Marketing Tools
14
For Music Buyers:
Extensive Music
Library Preview and
Download Secure
Transactions
Fig: 6.2 Buyers Features
15
6.2 MODULES DESCRIPTION
Fig: 6.3 Management
16
[Link] Management:
Sellers can upload and organize their music (beats, tracks, or albums) with
ease. They can
add metadata like genre, mood, and tempo, which helps with categorizing and
searching.
Sellers can manage their music library, track sales performance, and update or
remove tracks as needed.
2. Pricing and Licensing:
Sellers can set custom pricing for their music based on various licensing options (e.g.,
non- exclusive, exclusive, or sync licenses).
Licensing terms are attached to each sale, ensuring that the rights and usage terms are
clear to buyers.
3. Secure Sales Platform:
The platform provides a secure and transparent process for selling music. All
payments are handled through secure gateways like PayPal or [Link]
delivery of music files and licensing agreements upon purchase ensures a seamless
and trustworthy experience for both sellers and buyers.
4. Customer Management:
Sellers can view buyer profiles, track sales history, and communicate with customers if
[Link] data is securely managed, allowing sellers to build relationships and
understand their target audience better.
5. Marketing Tools:
The platform offers integrated marketing tools such as email notifications, discount
codes, and promotional [Link] can leverage these tools to increase their
visibility, promote their music, and attract more buyers through social media
integration.
17
For Music Buyers:
1. Extensive Music Library:
Buyers have access to a large and diverse collection of music and beats,
searchable by genre, mood, tempo, and other [Link] collections, top-
rated tracks, and recommendations based on previous purchases enhance the
browsing experience.
2. Preview and Download:
Buyers can preview music before purchasing to ensure the beat or track fits
their [Link] purchase, buyers receive immediate access to download the
music files, along with the appropriate licensing agreements for legal use.
3. Secure Transactions:
The platform guarantees secure payments through trusted payment gateways,
ensuring buyers' information is protected.
Order history and transaction details are available to buyers, making it easy
to track past purchases and access previously bought music.
18
6.3 SYSTEM IMPLEMENTATION
Fig: 6.4 System Implementation
The system implementation of a beat-selling and buying platform involves several key
stages, beginning with the selection of a suitable technology stack. The frontend is built
using [Link] to create a responsive and user-friendly interface that allows producers and
buyers to navigate seamlessly across various devices. For the backend, [Link] with
[Link] serves as the server framework, enabling efficient handling of user requests and
data processing. MongoDB is utilized as the database to store user profiles, beat metadata,
transactions, and licensing agreements, ensuring fast data retrieval and scalability. The
platform integrates secure payment gateways like Stripe and PayPal to facilitate
transactions, allowing users to purchase beats easily and securely.
19
File storage is managed through cloud services such as AWS S3, ensuring reliable and
scalable access to beat files for buyers post-purchase.
During implementation, attention is given to security protocols, including data encryption
and user authentication through JWT (JSON Web Tokens) to protect sensitive
information. The application includes features like user registration and login, beat
uploading and management, an intuitive search and filtering system, and a shopping cart
for a seamless purchasing experience. An admin panel is also developed for managing
users, monitoring sales, and handling disputes. Testing is conducted throughout the
development process to identify and rectify any issues, ensuring a robust and bug-free
application. Once the platform is deployed, continuous monitoring and updates will be
carried out based on user feedback and technological advancements to enhance
functionality and maintain user engagement. This comprehensive implementation strategy
aims to create a reliable, user- centric platform that facilitates the buying and selling of
beats while fostering a vibrant community of music producers and artists.
20
CHAPTER 7
7. CONCLUSION:
Fig: 7.1 Conculation
21
Melodyne a beat-selling and buying platform represents a transformative
opportunity within the music industry, leveraging technology to empower
producers and artists alike. By providing a user-friendly interface that facilitates
seamless transactions, the platform not only democratizes access to quality beats
but also enables producers to retain control over their intellectual property and
monetize their work directly. The integration of robust features such as automated
licensing, secure payment options, and community engagement tools fosters a
vibrant marketplace that enhances collaboration and creativity. As the demand for
digital music continues to grow, this platform stands poised to become an essential
resource for both emerging and established artists, driving innovation and
redefining the way music is produced, shared, and consumed in the digital age.
Ultimately, by prioritizing user experience, security, and scalability, the beat-
selling and buying platform can contribute significantly to the evolution of the
music ecosystem, ensuring a sustainable and thriving environment for all
stakeholders involved.
22
CHAPTER 8
8. FUTURE ENHANCEMENT
Fig: 8.1 Future Enhacement
Future enhancements for a beat-selling and buying platform can significantly
improve user experience, expand market reach, and foster community engagement.
23
One potential enhancement is the integration of artificial intelligence (AI) to offer
personalized beat recommendations based on users’ listening habits and
preferences, making it easier for buyers to discover music that resonates with their
style. Additionally, incorporating features for live collaboration would enable
producers to work together in real-time, creating a dynamic space for creativity and
innovation. Implementing a subscription model could also provide buyers with
exclusive access to a curated library of beats, fostering a sense of membership and
loyalty. Furthermore, expanding the platform to support various multimedia
projects, such as film scoring or advertising jingles, would diversify the offerings
and attract a broader audience. Community-building features, such as forums,
mentorship programs, and contests, could strengthen connections between
producers and buyers, promoting collaboration and engagement within the music
ecosystem. Finally, ongoing improvements in user interface design and mobile
optimization will ensure a seamless experience across all devices, making the
platform more accessible and user-friendly. By continually evolving with
technological advancements and user needs, the platform can position itself as a
leading marketplace in the ever-changing music industry.
24
CHAPTER 9
SOURCE CODE
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/[Link]" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Melodyne</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/[Link]"></script>
</body>
</html>
25
import { useAuthStore } from "@/stores/useAuthStore";
import Header from "./components/Header";
import DashboardStats from "./components/DashboardStats";
import { Album, Music } from "lucide-react";
const AdminPage = () => {
const { isAdmin, isLoading } = useAuthStore();
const { fetchAlbums, fetchSongs, fetchStats } = useMusicStore();
if (!isAdmin && !isLoading) return <div>Unauthorized</div>;
return (
<div
className='min-h-screen bg-gradient-to-b from-zinc-900 via-zinc-900
to-black text-zinc-100 p-8'
>
<Header />
<DashboardStats />
<Tabs defaultValue='songs' className='space-y-6'>
<TabsList className='p-1 bg-zinc-800/50'>
<TabsTrigger value='songs' className='data-[state=active]:bg-zinc-
<Album className='mr-2 size-4' />
Albums
</TabsTrigger>
</TabsList>
<TabsContent value='songs'>
<SongsTabContent />
</TabsContent>
<TabsContent value='albums'>
<AlbumsTabContent />
</TabsContent>
</Tabs>
</div>
);
};
export default AdminPage;
26
import Topbar from "@/components/Topbar";
const HomePage = () => {
const { fetchFeaturedSongs, fetchMadeForYouSongs, fetchTrendingSongs,
isLoading, madeForYouSongs, featuredSongs, trendingSongs,
} = useMusicStore();
const { initializeQueue } = usePlayerStore();
useEffect(() => {
fetchFeaturedSongs();
fetchMadeForYouSongs();
fetchTrendingSongs();
}, [fetchFeaturedSongs, fetchMadeForYouSongs, fetchTrendingSongs]);
useEffect(() => {
if ([Link] > 0 && [Link] > 0 &&
[Link] > 0) {
const allSongs = [...featuredSongs, ...madeForYouSongs, ...trendingSongs];
initializeQueue(allSongs);
}
}, [initializeQueue, madeForYouSongs, trendingSongs, featuredSongs]);
return (
<main className='rounded-md overflow-hidden h-full bg-gradient-to-b
from-zinc-800 to-zinc-900'>
<Topbar />
<ScrollArea className='h-[calc(100vh-180px)]'>
<div className='p-4 sm:p-6'>
<FeaturedSection />
<div className='space-y-8'>
<SectionGrid title='Made For You' songs={madeForYouSongs}
</div>
</div>
</ScrollArea>
</main>
);
};
27
import mongoose from "mongoose";
const userSchema = new [Link](
{
fullName: {
type: String,
required: true,
},
imageUrl: {
type: String,
required: true,
},
clerkId: {
type: String,
required: true,
unique: true,
},
},
{ timestamps: true } // createdAt, updatedAt
);
export const User = [Link]("User", userSchema);
28
import mongoose from "mongoose";
const songSchema = new [Link](
{
title: {
type: String,
required: true,
},
artist: {
type: String,
required: true,
},
imageUrl: {
type: String,
required: true,
},
audioUrl: {
type: String,
required: true,
},
duration: {
type: Number,
required: true,
},
albumId: {
type: [Link],
ref: "Album",
required: false,
},
},
{ timestamps: true }
);
export const Song = [Link]("Song", songSchema);
29
import mongoose from "mongoose";
const albumSchema = new [Link](
{
title: { type: String, required: true },
artist: { type: String, required: true },
imageUrl: { type: String, required: true },
releaseYear: { type: Number, required: true },
songs: [{ type: [Link], ref: "Song" }],
},
{ timestamps: true }
); // createdAt, updatedAt
export const Album = [Link]("Album",
30 albumSchema);
import { clerkClient } from "@clerk/express";
export const protectRoute = async (req, res, next) => {
if (![Link]) {
return [Link](401).json({ message: "Unauthorized - you must be logged
in" });
}
next();
};
export const requireAdmin = async (req, res, next) => {
try {
const currentUser = await [Link]([Link]);
const isAdmin = [Link].ADMIN_EMAIL ===
31
[Link]?.emailAddress;
if (!isAdmin) {
return [Link](403).json({ message: "Unauthorized - you must be an
import { Router } from "express";
import { checkAdmin, createAlbum, createSong, deleteAlbum, deleteSong } from
"../controller/[Link]";
import { protectRoute, requireAdmin } from "../middleware/[Link]";
const router = Router();
[Link](protectRoute, requireAdmin);
[Link]("/check", checkAdmin);
[Link]("/songs", createSong);
[Link]("/songs/:id", deleteSong);
[Link]("/albums", createAlbum);
[Link]("/albums/:id", deleteAlbum);
export default
import router; } from "./lib/[Link]";
{ connectDB
import userRoutes from "./routes/[Link]";
import songRoutes from "./routes/[Link]";
[Link]();
const __dirname = [Link]();
const app = express();
const PORT = [Link];
const httpServer = createServer(app);
initializeSocket(httpServer);
);
[Link]([Link]());
[Link](clerkMiddleware());
[Link](
fileUpload({
useTempFiles: true,
tempFileDir: [Link](__dirname, "tmp"),
createParentPath: true,
limits: {
fileSize: 10 * 1024 * 1024,
},
})
); 32
const tempDir = [Link]([Link](), "tmp");
[Link]("0 * * * *", () => {
[Link]("error", err);
import { Server } from "[Link]";
import { Message } from "../models/[Link]";
export const initializeSocket = (server) => {
const io = new Server(server, {
cors: {
origin: "[Link]
credentials: true,
},
});
const userSockets = new Map(); // { userId: socketId}
const userActivities = new Map(); // {userId: activity}
[Link]("connection", (socket) => {
[Link]("user_connected", (userId) => {
[Link](userId, [Link]);
[Link](userId, "Idle");
// broadcast to all connected sockets that this user just logged in
[Link]("user_connected", userId);
[Link]("users_online", [Link]([Link]()));
33
[Link]("activities", [Link]([Link]()));
});
[Link]("disconnect", () => {
import { Song } from "../models/[Link]";
import { Album } from "../models/[Link]";
import cloudinary from "../lib/[Link]";
export const createSong = async (req, res, next) => {
try {
if (![Link] || ![Link] || ![Link]) {
return [Link](400).json({ message: "Please upload all files" });
}
const audioUrl = await uploadToCloudinary(audioFile);
const imageUrl = await uploadToCloudinary(imageFile);
const song = new Song({
title,
artist,
audioUrl,
imageUrl,
duration,
albumId: albumId || null,
});
await [Link]();
34
// if song belongs to an album, update the album's songs array
if (albumId) {
await [Link](albumId, {
$push: { songs: song._id },
CHAPTER 10
10. OUTPUT
35
36
37
38
39
40
41
42
43
45
46
47
46
CHAPTER 11
1.1 REFERENCES
1. Spotify (Daniel Ek and Martin Lorentzon, 2008): “Introduced a streaming
model emphasizing access over ownership, offering a vast library of music
through subscriptions or ad-supported free tiers.”
2. Bandcamp (Ethan Diamond, Shawn Grunberger, Joe Holt, and Neal
Tucker, 2008): “ Provides a platform where artists sell music directly to fans,
emphasizing fair compensation and supporting independent musicians.”
3. SoundCloud (Alexander Ljung and Eric Wahlforss, 2007): “ Began as a
community-driven platform for sharing and promoting music, later incorporating
monetization and streaming features.”
4. Amazon Music ([Link], Inc., 2007): “Started as a digital music store
offering DRM-free MP3 downloads and evolved into a comprehensive streaming
service integrated with Alexa and Prime memberships.”
5. iTunes Store (Apple Inc., 2003): “ Revolutionized digital music sales by
offering a legal platform for purchasing individual songs and albums,
transitioning the music industry from physical media to digital downloads.”
48
46