Welcome to the Music Recommendation App! This Node.js and Express project allows users to discover new songs. It provides personalized music recommendations based on user input of genre and artist.
public/
: Folder containing static files such as images, CSS, and JS files.index.html
: Main HTML file for the application home page.
views/
: Folder containing ejs filesapp.js
: Server file containing the main logic for handling HTTP requests, integrating with the MySQL Database, and serving static files.songs.json
: A JSON file containing song data exported from the MongoDB database.import_songs.py
: A Python script to import songs fromsongs.json
into a user-provided MongoDB database.
app.js
: This file contains the main application logic. It sets up the Express.js server, handles routes, connects to the MySQL database, and renders EJS templates.songs.json
: This JSON file contains the schema definition and sample data for songs, including title, artist, genre, release date, duration, album, and Spotify link.personalizedMusic.ejs
: This EJS template file contains the HTML markup for the personalized music recommendation form. It allows users to select a genre and artist to get recommendations.recommendations.ejs
: This EJS template file contains the HTML markup for displaying the music recommendations. It dynamically generates Spotify iframes for each recommended song.index.html
: This HTML file contains the landing page for the application. It provides links to different genres of music.import_songs.py
: A Python script for importing songs from thesongs.json
file into a specified MongoDB database.
- User Input: Users can specify their preferred genre and artist to get personalized music recommendations.
- Database: The app uses a MySQL database to store and retrieve song information.
- Responsive Design: The application is designed to work on various devices.
-
Clone the repository:
git clone https://github.com/sabhisharma-ise/MUCE_app.git cd MUCE_app
-
Install dependencies:
npm i npm i mongoose express dotenv ejs
-
Configure the
import_songs.py
file:
- Update the DESTINATION_DB_URL to point to your local or remote MongoDB instance.
-
Run the
import_songs.py
script:python import_songs.py
This script will transfer songs data from the
songs.json
to your provided local or remote MongoDB instance. -
Configure the database connection:
- Create a new file
.env
in the same directory - Add the database connection details in the .env file
MONGO_URI=your-mongodb-uri
-
Run the application:
node app.js
The app will be accessible at http://localhost:3000.