The Spotify DBMS project is a application to manage and query data related to tracks, artists, albums, and user details. It allows both users and administrators to interact with the database through a streamlined interface and includes features like sign-up, sign-in, and advanced search functionality.
-
Sign-Up:
- Allows new users to create an account with their details: Name, Date of Birth (DOB), Email, and Password.
- Password validation ensures matching confirmation passwords.
- Validates that DOB is not set in the future.
- Duplicate email addresses are restricted.
-
Sign-In:
- Allows users to log in using their credentials.
- Redirects to a search page upon successful login.
- Displays appropriate error messages for invalid usernames or passwords.
-
Search Functionality:
- Users can search for tracks, artists, or albums based on:
- Song Title
- Artist Name
- Album Name
- Genre
- Release Year
- Supports multiple filters in a single query.
- Displays results dynamically.
- Users can search for tracks, artists, or albums based on:
-
View Top 25 Songs:
- Fetches the top 25 songs ordered by popularity.
-
Admin Login:
- Admin credentials (
admin
,admin789456
) allow access to the Admin Dashboard.
- Admin credentials (
-
Add Records:
- Add new Artists, Albums, and Tracks to the database.
- Validates the existence of dependent records (e.g.,
Artist_ID
for albums,Album_ID
for tracks). - Ensures no duplicate entries using primary keys.
-
Remove Records:
- Remove records such as Artists, Albums, or Tracks by their ID.
- Cascade deletions handled through foreign key constraints.
-
Data Integrity:
- Ensures relational integrity for all operations.
- Prevents deletion of records in use unless handled explicitly.
Column | Type | Constraints |
---|---|---|
User_ID | INT | Primary Key, Auto Increment |
User_Name | VARCHAR(255) | NOT NULL |
DOB | DATE | NOT NULL |
VARCHAR(255) | UNIQUE, NOT NULL | |
Password | VARCHAR(255) | NOT NULL |
Column | Type | Constraints |
---|---|---|
Artist_ID | INT | Primary Key |
Name | VARCHAR(255) | NOT NULL |
Bio | TEXT | Optional |
Genre | VARCHAR(100) | Optional |
Column | Type | Constraints |
---|---|---|
Album_ID | INT | Primary Key |
Name | VARCHAR(255) | NOT NULL |
Artist_ID | INT | Foreign Key (references Artist_ID ) |
Genre | VARCHAR(100) | Optional |
Release_Date | DATE | Optional |
Column | Type | Constraints |
---|---|---|
Track_ID | INT | Primary Key |
Title | VARCHAR(255) | NOT NULL |
Album_ID | INT | Foreign Key (references Album_ID ) |
Duration | VARCHAR(50) | Optional |
Popularity | INT | Default: 0 |
PlayCount | INT | Default: 0 |
- Endpoint:
/signup
- Method:
POST
- Parameters:
User_Name
: Stringdob
: Date (YYYY-MM-DD)email
: Stringpass
: Stringre_pass
: String
- Response:
- Success:
{"message": "Registration successful!"}
- Error:
{"error": "Error message..."}
- Success:
- Endpoint:
/signin
- Method:
POST
- Parameters:
your_name
: Stringyour_pass
: String
- Response:
- Success: Redirects to
/search
- Error:
User not found
orIncorrect password
- Success: Redirects to
- Endpoint:
/search
- Method:
POST
- Parameters:
songQuery
: Optional (String)artistQuery
: Optional (String)albumQuery
: Optional (String)genre
: Optional (String)releaseYear
: Optional (Number)
- Response: JSON array of matching songs.
- Endpoint:
/top-songs
- Method:
GET
- Response: JSON array of the top 25 songs.
- Endpoint:
/addArtist
- Method:
POST
- Parameters:
Artist_ID
: NumberName
: StringBio
: Optional (String)Genre
: Optional (String)
- Response:
- Success:
{"message": "Artist added successfully."}
- Error:
{"error": "Error message..."}
- Success:
- Endpoint:
/addAlbum
- Method:
POST
- Parameters:
Album_ID
: NumberAlbum_Name
: StringArtist_ID
: NumberGenre
: Optional (String)Release_Date
: Optional (Date)
- Response:
- Success:
{"message": "Album added successfully."}
- Error:
{"error": "Error message..."}
- Success:
- Endpoint:
/addTrack
- Method:
POST
- Parameters:
TrackID
: NumberTitle
: StringAlbum_ID
: NumberDuration
: Optional (String)Popularity
: Optional (Number)PlayCount
: Optional (Number)
- Response:
- Success:
{"message": "Track added successfully."}
- Error:
{"error": "Error message..."}
- Success:
- Clone Repository:
git clone https://github.com/MusadiqPasha/Spotify-DBMS cd Spotify-DBMS
- Install Dependencies::
npm install
- Install Dependencies::
node app.js
- Access Application::
Sign-Up Page: http://localhost:3000/signup Sign-In Page: http://localhost:3000/signin Admin Dashboard: http://localhost:3000/admin
- Enable user profile customization.
- Add analytics for popular searches.
- Include audio file storage and playback features.
- Feel free to edit it according to your preferences or specific project needs!
- This project is licensed under the MIT License - see the LICENSE file for details.